summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorCalcium <calcium@nurs.or.jp>2005-03-22 18:20:07 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-03-22 18:20:07 +0000
commitb6e16b8653ca2fcc9c6f60491101651fa4754a37 (patch)
treedc86c9eb9ff170f6eede97ce4974775f4785a3cd /ffmpeg.c
parentff8cc24bf54cd2163eb31efa25ff79ba62306784 (diff)
08_limit_in_filesize.patch by (Calcium | calcium nurs or jp)
Originally committed as revision 4061 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 1a63076c62..38c8cfca08 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -266,6 +266,7 @@ static int64_t extra_size = 0;
static int nb_frames_dup = 0;
static int nb_frames_drop = 0;
static int input_sync;
+static int limit_filesize = 0; //
static int pgmyuv_compatibility_hack=0;
@@ -1882,6 +1883,10 @@ static int av_encode(AVFormatContext **output_files,
if (recording_time > 0 && opts_min >= (recording_time / 1000000.0))
break;
+ /* finish if limit size exhausted */
+ if (limit_filesize != 0 && (limit_filesize * 1024) < url_ftell(&output_files[0]->pb))
+ break;
+
/* read a frame from it and output it in the fifo */
is = input_files[file_index];
if (av_read_frame(is, &pkt) < 0) {
@@ -3905,6 +3910,7 @@ const OptionDef options[] = {
{ "map", HAS_ARG | OPT_EXPERT, {(void*)opt_map}, "set input stream mapping", "file:stream" },
{ "map_meta_data", HAS_ARG | OPT_EXPERT, {(void*)opt_map_meta_data}, "set meta data information of outfile from infile", "outfile:infile" },
{ "t", HAS_ARG, {(void*)opt_recording_time}, "set the recording time", "duration" },
+ { "fs", HAS_ARG | OPT_INT, {(void*)&limit_filesize}, "set the limit file size", "limit_size" }, //
{ "ss", HAS_ARG, {(void*)opt_start_time}, "set the start time offset", "time_off" },
{ "itsoffset", HAS_ARG, {(void*)opt_input_ts_offset}, "set the input ts offset", "time_off" },
{ "title", HAS_ARG | OPT_STRING, {(void*)&str_title}, "set the title", "string" },