[FFmpeg-trac] #4037(undetermined:new): [Transcoding] Duration and frame number changed after transcoding

FFmpeg trac at avcodec.org
Fri Oct 17 05:11:31 CEST 2014


#4037: [Transcoding] Duration and frame number changed after transcoding
-------------------------------------+-------------------------------------
             Reporter:  hungnv       |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  important    |                Component:
              Version:  unspecified  |  undetermined
             Keywords:  mpegts       |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by hungnv):

 I have tried latest build from trunk, here is the output:
 {{{
  /usr/local/bin/ffmpeg -v debug -y -i yeuxa90.ts -vcodec mpeg2video -vb
 500000 -s 640x360 ffmpeg.ts
 ffmpeg version N-66929-gf6bb2cd Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Oct 17 2014 09:36:11 with gcc 4.6 (Ubuntu/Linaro
 4.6.4-3ubuntu1)
   configuration: --enable-libx264 --enable-libfdk-aac --enable-gpl
 --enable-nonfree --enable-shared --enable-avresample --enable-debug=3
 --enable-libfaac --enable-libvo-aacenc --enable-version3
   libavutil      54. 10.100 / 54. 10.100
   libavcodec     56.  8.100 / 56.  8.100
   libavformat    56.  9.100 / 56.  9.100
   libavdevice    56.  1.100 / 56.  1.100
   libavfilter     5.  1.106 /  5.  1.106
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  3.100 / 53.  3.100
 Splitting the commandline.
 Reading option '-v' ... matched as option 'v' (set logging level) with
 argument 'debug'.
 Reading option '-y' ... matched as option 'y' (overwrite output files)
 with argument '1'.
 Reading option '-i' ... matched as input file with argument 'yeuxa90.ts'.
 Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
 ('copy' to copy stream)) with argument 'mpeg2video'.
 Reading option '-vb' ... matched as AVOption 'vb' with argument '500000'.
 Reading option '-s' ... matched as option 's' (set frame size (WxH or
 abbreviation)) with argument '640x360'.
 Reading option 'ffmpeg.ts' ... matched as output file.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option v (set logging level) with argument debug.
 Applying option y (overwrite output files) with argument 1.
 Successfully parsed a group of options.
 Parsing a group of options: input file yeuxa90.ts.
 Successfully parsed a group of options.
 Opening an input file: yeuxa90.ts.
 [mpegts @ 0x900dc0] Format mpegts probed with size=2048 and score=100
 [mpegts @ 0x900dc0] stream=0 stream_type=1b pid=64 prog_reg_desc=
 [mpegts @ 0x900dc0] stream=1 stream_type=f pid=65 prog_reg_desc=
 [mpegts @ 0x900dc0] Before avformat_find_stream_info() pos: 0 bytes
 read:32768 seeks:0
 [mpegts @ 0x900dc0] All programs have pmt, headers found
 [h264 @ 0x904b40] no picture
 [mpegts @ 0x900dc0] All info found
 [mpegts @ 0x900dc0] After avformat_find_stream_info() pos: 0 bytes
 read:479376 seeks:2 frames:58
 Input #0, mpegts, from 'yeuxa90.ts':
   Duration: 00:00:15.08, start: 91.000511, bitrate: 1428 kb/s
   Program 1
     Stream #0:0[0x64], 21, 1/90000: Video: h264 (High) ([27][0][0][0] /
 0x001B), yuv420p(left), 1280x720 [SAR 1:1 DAR 16:9], 1/50, 25 fps, 25 tbr,
 90k tbn, 50 tbc
     Stream #0:1[0x65], 37, 1/90000: Audio: aac ([15][0][0][0] / 0x000F),
 44100 Hz, stereo, fltp, 129 kb/s
 Successfully opened the file.
 Parsing a group of options: output file ffmpeg.ts.
 Applying option vcodec (force video codec ('copy' to copy stream)) with
 argument mpeg2video.
 Applying option s (set frame size (WxH or abbreviation)) with argument
 640x360.
 Successfully parsed a group of options.
 Opening an output file: ffmpeg.ts.
 Successfully opened the file.
 detected 2 logical cores
 [graph 0 input from stream 0:0 @ 0x900320] Setting 'video_size' to value
 '1280x720'
 [graph 0 input from stream 0:0 @ 0x900320] Setting 'pix_fmt' to value '0'
 [graph 0 input from stream 0:0 @ 0x900320] Setting 'time_base' to value
 '1/90000'
 [graph 0 input from stream 0:0 @ 0x900320] Setting 'pixel_aspect' to value
 '1/1'
 [graph 0 input from stream 0:0 @ 0x900320] Setting 'sws_param' to value
 'flags=2'
 [graph 0 input from stream 0:0 @ 0x900320] Setting 'frame_rate' to value
 '25/1'
 [graph 0 input from stream 0:0 @ 0x900320] w:1280 h:720 pixfmt:yuv420p
 tb:1/90000 fr:25/1 sar:1/1 sws_param:flags=2
 [scaler for output stream 0:0 @ 0x8f8280] Setting 'w' to value '640'
 [scaler for output stream 0:0 @ 0x8f8280] Setting 'h' to value '360'
 [scaler for output stream 0:0 @ 0x8f8280] Setting 'flags' to value '0x4'
 [scaler for output stream 0:0 @ 0x8f8280] w:640 h:360 flags:'0x4' interl:0
 [format @ 0x8f89e0] compat: called with args=[yuv420p|yuv422p]
 [format @ 0x8f89e0] Setting 'pix_fmts' to value 'yuv420p|yuv422p'
 [AVFilterGraph @ 0x8efe40] query_formats: 5 queried, 4 merged, 0 already
 done, 0 delayed
 [scaler for output stream 0:0 @ 0x8f8280] w:1280 h:720 fmt:yuv420p sar:1/1
 -> w:640 h:360 fmt:yuv420p sar:1/1 flags:0x4
 [graph 1 input from stream 0:1 @ 0x9d1da0] Setting 'time_base' to value
 '1/44100'
 [graph 1 input from stream 0:1 @ 0x9d1da0] Setting 'sample_rate' to value
 '44100'
 [graph 1 input from stream 0:1 @ 0x9d1da0] Setting 'sample_fmt' to value
 'fltp'
 [graph 1 input from stream 0:1 @ 0x9d1da0] Setting 'channel_layout' to
 value '0x3'
 [graph 1 input from stream 0:1 @ 0x9d1da0] tb:1/44100 samplefmt:fltp
 samplerate:44100 chlayout:0x3
 [audio format for output stream 0:1 @ 0x9d2940] Setting 'sample_fmts' to
 value 's16'
 [audio format for output stream 0:1 @ 0x9d2940] Setting 'sample_rates' to
 value '44100|48000|32000|22050|24000|16000'
 [audio format for output stream 0:1 @ 0x9d2940] Setting 'channel_layouts'
 to value '0x4|0x3'
 [audio format for output stream 0:1 @ 0x9d2940] auto-inserting filter
 'auto-inserted resampler 0' between the filter 'Parsed_anull_0' and the
 filter 'audio format for output stream 0:1'
 [AVFilterGraph @ 0x900960] query_formats: 4 queried, 6 merged, 3 already
 done, 0 delayed
 [auto-inserted resampler 0 @ 0x9d4b80] ch:2 chl:stereo fmt:fltp r:44100Hz
 -> ch:2 chl:stereo fmt:s16 r:44100Hz
 [mpeg2video @ 0x923ae0] intra_quant_bias = 96 inter_quant_bias = 0
 [mpegts @ 0x908760] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
 every 40 pkts
 Output #0, mpegts, to 'ffmpeg.ts':
   Metadata:
     encoder         : Lavf56.9.100
     Stream #0:0, 0, 1/90000: Video: mpeg2video, yuv420p(left), 640x360
 [SAR 1:1 DAR 16:9], 1/25, q=2-31, 500 kb/s, 25 fps, 90k tbn, 25 tbc
     Metadata:
       encoder         : Lavc56.8.100 mpeg2video
     Stream #0:1, 0, 1/90000: Audio: mp2, 44100 Hz, stereo, s16, 384 kb/s
     Metadata:
       encoder         : Lavc56.8.100 mp2
 Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> mpeg2video (native))
   Stream #0:1 -> #0:1 (aac (native) -> mp2 (native))
 Press [q] to stop, [?] for help
 [h264 @ 0xa02920] no picture
 [h264 @ 0xa479c0] no picture
 *** 2 dup!
 [output stream 0:0 @ 0x8efc80] EOF on sink link output stream
 0:0:default.bits/s dup=2 drop=0
 [output stream 0:1 @ 0x9d2020] EOF on sink link output stream 0:1:default.
 No more output streams to write to, finishing.
 frame=  377 fps=172 q=5.5 Lsize=    1946kB time=00:00:15.04
 bitrate=1059.9kbits/s dup=2 drop=0
 video:1034kB audio:704kB subtitle:0kB other streams:0kB global headers:0kB
 muxing overhead: 11.966699%
 Input file #0 (yeuxa90.ts):
   Input stream #0:0 (video): 375 packets read (2297071 bytes); 375 frames
 decoded;
   Input stream #0:1 (audio): 646 packets read (244840 bytes); 646 frames
 decoded (661504 samples);
   Total: 1021 packets (2541911 bytes) demuxed
 Output file #0 (ffmpeg.ts):
   Output stream #0:0 (video): 377 frames encoded; 377 packets muxed
 (1058668 bytes);
   Output stream #0:1 (audio): 575 frames encoded (661504 samples); 575
 packets muxed (720979 bytes);
   Total: 952 packets (1779647 bytes) muxed
 1025 frames successfully decoded, 0 decoding errors
 [AVIOContext @ 0x9092c0] Statistics: 0 seeks, 665 writeouts
 [AVIOContext @ 0x8fff00] Statistics: 3172664 bytes read, 2 seeks
 }}}

 Here is the ouput duration
 {{{
 ffmpeg -i ffmpeg.ts
 ffmpeg version N-66929-gf6bb2cd Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Oct 17 2014 09:36:11 with gcc 4.6 (Ubuntu/Linaro
 4.6.4-3ubuntu1)
   configuration: --enable-libx264 --enable-libfdk-aac --enable-gpl
 --enable-nonfree --enable-shared --enable-avresample --enable-debug=3
 --enable-libfaac --enable-libvo-aacenc --enable-version3
   libavutil      54. 10.100 / 54. 10.100
   libavcodec     56.  8.100 / 56.  8.100
   libavformat    56.  9.100 / 56.  9.100
   libavdevice    56.  1.100 / 56.  1.100
   libavfilter     5.  1.106 /  5.  1.106
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  3.100 / 53.  3.100
 Input #0, mpegts, from 'ffmpeg.ts':
   Duration: 00:00:15.09, start: 1.429089, bitrate: 1056 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
     Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
 yuv420p(tv), 640x360 [SAR 1:1 DAR 16:9], max. 104857 kb/s, 25 fps, 25 tbr,
 90k tbn, 50 tbc
     Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 44100 Hz,
 stereo, s16p, 371 kb/s
 }}}

 The input duration:
 {{{
 ffmpeg -i yeuxa90.ts
 ffmpeg version N-66929-gf6bb2cd Copyright (c) 2000-2014 the FFmpeg
 developers
   built on Oct 17 2014 09:36:11 with gcc 4.6 (Ubuntu/Linaro
 4.6.4-3ubuntu1)
   configuration: --enable-libx264 --enable-libfdk-aac --enable-gpl
 --enable-nonfree --enable-shared --enable-avresample --enable-debug=3
 --enable-libfaac --enable-libvo-aacenc --enable-version3
   libavutil      54. 10.100 / 54. 10.100
   libavcodec     56.  8.100 / 56.  8.100
   libavformat    56.  9.100 / 56.  9.100
   libavdevice    56.  1.100 / 56.  1.100
   libavfilter     5.  1.106 /  5.  1.106
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  1.100 /  1.  1.100
   libpostproc    53.  3.100 / 53.  3.100
 Input #0, mpegts, from 'yeuxa90.ts':
   Duration: 00:00:15.08, start: 91.000511, bitrate: 1428 kb/s
   Program 1
     Stream #0:0[0x64]: Video: h264 (High) ([27][0][0][0] / 0x001B),
 yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
     Stream #0:1[0x65]: Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz,
 stereo, fltp, 129 kb/s
 }}}


 Even if I try with other built-in codec, output's duration is still
 different from input's duration.

 {{{
 Do you think this is a regression?
 }}}

 I actually don't know.

 --
 Hung

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4037#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list