mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
08_limit_in_filesize.patch by (Calcium | calcium nurs or jp)
Originally committed as revision 4061 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
ff8cc24bf5
commit
b6e16b8653
6
ffmpeg.c
6
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" },
|
||||
|
Loading…
Reference in New Issue
Block a user