diff options
author | Justin Johnson <justin.johnson3@gmail.com> | 2010-02-02 22:23:09 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2010-02-02 22:23:09 +0000 |
commit | c5e1e9827d8aaced8b96a49859a6b0a1cd007d20 (patch) | |
tree | a8e68abd982a78422bfe5b36d13863ddb614a178 /ffmpeg.c | |
parent | a3cc2160e032481f5393304d5b6c61c550d116e7 (diff) | |
download | ffmpeg-c5e1e9827d8aaced8b96a49859a6b0a1cd007d20.tar.gz |
Guess the duration before converting video and write guessed duration
into flv header.
Patch by Justin Johnson, justin D johnson3 A gmail
Originally committed as revision 21615 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -2104,6 +2104,19 @@ static int av_encode(AVFormatContext **output_files, ist->is_start = 1; } + /* set the duration of the output to the duration of the input + * if the output ends up being different, it'll be corrected later */ + for (i=0;i<nb_output_files;i++) { + AVFormatContext *out_file = output_files[i]; + AVFormatContext *in_file = input_files[i]; + + if (recording_time != INT64_MAX) { + out_file->duration = recording_time / 1000000 * AV_TIME_BASE; + } else { + out_file->duration = in_file->duration; + } + } + /* set meta data information from input file if required */ for (i=0;i<nb_meta_data_maps;i++) { AVFormatContext *out_file; |