[FFmpeg-trac] #2938(FFmpeg:new): Incorrect start time and duration when transcoding audio-only (-vn) from A/V files.

FFmpeg trac at avcodec.org
Thu Sep 5 23:37:45 CEST 2013


#2938: Incorrect start time and duration when transcoding audio-only (-vn) from
A/V files.
----------------------------------+--------------------------------------
             Reporter:  rlabonte  |                     Type:  defect
               Status:  new       |                 Priority:  normal
            Component:  FFmpeg    |                  Version:  git-master
             Keywords:            |               Blocked By:
             Blocking:            |  Reproduced by developer:  0
Analyzed by developer:  0         |
----------------------------------+--------------------------------------
 Summary of the bug: When extracting audio only from a a/v file the
 duration gets extended.  When muxed to mov/mp4 container ffprobe reports
 start time as 0.021333 in top level output, but -0.021333 in -show_streams
 output.  I work on video and audio separately and align the video and
 audio to start at 0.00.  This bug has made it impossible to continue to do
 this.  Using audio filter '-af 'aresample=first_pts=0' results in the same
 wrong start time and audio duration.  I have observed this behavior with
 the built-in AAC encoder, libfdk_aac, and libfaac.  Muxing to matroska or
 raw AAC results in a 0.00 start time, but the duration is still off by
 40ms.  I get the same result on all video files that I have tested this
 problem with, I have not been able to get a start time of 0.00 when muxing
 to MOV container.


 How to reproduce:
 {{{
 % ffmpeg -i big_buck_bunny_480p_h264.mov -vn -c:a aac -strict -2
 offset.mov
 ffmpeg version N-56052-g59b9ecc Copyright (c) 2000-2013 the FFmpeg
 developers
   built on Sep  5 2013 14:16:47 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
   configuration: --enable-nonfree --enable-gpl --enable-version3 --enable-
 libvpx --enable-libtheora --enable-libvorbis --enable-libfaac --enable-
 libfdk_aac --enable-libx264 --enable-libfreetype
   libavutil      52. 43.100 / 52. 43.100
   libavcodec     55. 31.101 / 55. 31.101
   libavformat    55. 16.101 / 55. 16.101
   libavdevice    55.  3.100 / 55.  3.100
   libavfilter     3. 83.102 /  3. 83.102
   libswscale      2.  5.100 /  2.  5.100
   libswresample   0. 17.103 /  0. 17.103
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'big_buck_bunny_480p_h264.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 537199360
     compatible_brands: qt
     creation_time   : 2008-05-27 18:32:32
     timecode        : 00:00:00:00
   Duration: 00:09:56.46, start: 0.000000, bitrate: 3342 kb/s
     Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv,
 bt709), 854x480, 2899 kb/s, 24 fps, 24 tbr, 2400 tbn, 4800 tbc (default)
     Metadata:
       creation_time   : 2008-05-27 18:32:32
       handler_name    : Apple Alias Data Handler
     Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
     Metadata:
       creation_time   : 2008-05-27 18:32:32
       handler_name    : Apple Alias Data Handler
       timecode        : 00:00:00:00
     Stream #0:2(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp,
 437 kb/s (default)
     Metadata:
       creation_time   : 2008-05-27 18:32:32
       handler_name    : Apple Alias Data Handler
 Output #0, mov, to 'offset.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 537199360
     compatible_brands: qt
     timecode        : 00:00:00:00
     encoder         : Lavf55.16.101
     Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp,
 128 kb/s (default)
     Metadata:
       creation_time   : 2008-05-27 18:32:32
       handler_name    : Apple Alias Data Handler
 Stream mapping:
   Stream #0:2 -> #0:0 (aac -> aac)
 Press [q] to stop, [?] for help
 size=    9445kB time=00:09:56.48 bitrate= 129.7kbits/s
 video:0kB audio:9335kB subtitle:0 global headers:0kB muxing overhead
 1.179736%

 }}}

 FFprobe of original file:
 {{{
 % ffprobe big_buck_bunny_480p_h264.mov -show_streams -select_streams a
 ffprobe version N-56052-g59b9ecc Copyright (c) 2007-2013 the FFmpeg
 developers
   built on Sep  5 2013 14:16:47 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
   configuration: --enable-nonfree --enable-gpl --enable-version3 --enable-
 libvpx --enable-libtheora --enable-libvorbis --enable-libfaac --enable-
 libfdk_aac --enable-libx264 --enable-libfreetype
   libavutil      52. 43.100 / 52. 43.100
   libavcodec     55. 31.101 / 55. 31.101
   libavformat    55. 16.101 / 55. 16.101
   libavdevice    55.  3.100 / 55.  3.100
   libavfilter     3. 83.102 /  3. 83.102
   libswscale      2.  5.100 /  2.  5.100
   libswresample   0. 17.103 /  0. 17.103
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'big_buck_bunny_480p_h264.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 537199360
     compatible_brands: qt
     creation_time   : 2008-05-27 18:32:32
     timecode        : 00:00:00:00
   Duration: 00:09:56.46, start: 0.000000, bitrate: 3342 kb/s
     Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv,
 bt709), 854x480, 2899 kb/s, 24 fps, 24 tbr, 2400 tbn, 4800 tbc (default)
     Metadata:
       creation_time   : 2008-05-27 18:32:32
       handler_name    : Apple Alias Data Handler
     Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
     Metadata:
       creation_time   : 2008-05-27 18:32:32
       handler_name    : Apple Alias Data Handler
       timecode        : 00:00:00:00
     Stream #0:2(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp,
 437 kb/s (default)
     Metadata:
       creation_time   : 2008-05-27 18:32:32
       handler_name    : Apple Alias Data Handler
 Unsupported codec with id 0 for input stream 1
 [STREAM]
 index=2
 codec_name=aac
 codec_long_name=AAC (Advanced Audio Coding)
 profile=unknown
 codec_type=audio
 codec_time_base=1/48000
 codec_tag_string=mp4a
 codec_tag=0x6134706d
 sample_fmt=fltp
 sample_rate=48000
 channels=6
 bits_per_sample=0
 id=N/A
 r_frame_rate=0/0
 avg_frame_rate=0/0
 time_base=1/48000
 start_pts=0
 start_time=0.000000
 duration_ts=28631040
 duration=596.480000
 bit_rate=437605
 nb_frames=27960
 nb_read_frames=N/A
 nb_read_packets=N/A
 DISPOSITION:default=1
 DISPOSITION:dub=0
 DISPOSITION:original=0
 DISPOSITION:comment=0
 DISPOSITION:lyrics=0
 DISPOSITION:karaoke=0
 DISPOSITION:forced=0
 DISPOSITION:hearing_impaired=0
 DISPOSITION:visual_impaired=0
 DISPOSITION:clean_effects=0
 DISPOSITION:attached_pic=0
 TAG:creation_time=2008-05-27 18:32:32
 TAG:language=eng
 TAG:handler_name=Apple Alias Data Handler
 [/STREAM]
 }}}

 FFprobe output of output file:
 {{{
 % ffprobe offset.mov -show_streams
 ffprobe version N-56052-g59b9ecc Copyright (c) 2007-2013 the FFmpeg
 developers
   built on Sep  5 2013 14:16:47 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
   configuration: --enable-nonfree --enable-gpl --enable-version3 --enable-
 libvpx --enable-libtheora --enable-libvorbis --enable-libfaac --enable-
 libfdk_aac --enable-libx264 --enable-libfreetype
   libavutil      52. 43.100 / 52. 43.100
   libavcodec     55. 31.101 / 55. 31.101
   libavformat    55. 16.101 / 55. 16.101
   libavdevice    55.  3.100 / 55.  3.100
   libavfilter     3. 83.102 /  3. 83.102
   libswscale      2.  5.100 /  2.  5.100
   libswresample   0. 17.103 /  0. 17.103
   libpostproc    52.  3.100 / 52.  3.100
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'offset.mov':
   Metadata:
     major_brand     : qt
     minor_version   : 512
     compatible_brands: qt
     encoder         : Lavf55.16.101
   Duration: 00:09:56.50, start: 0.021333, bitrate: 129 kb/s
     Stream #0:0(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp,
 128 kb/s (default)
     Metadata:
       handler_name    : DataHandler
 [STREAM]
 index=0
 codec_name=aac
 codec_long_name=AAC (Advanced Audio Coding)
 profile=unknown
 codec_type=audio
 codec_time_base=1/48000
 codec_tag_string=mp4a
 codec_tag=0x6134706d
 sample_fmt=fltp
 sample_rate=48000
 channels=6
 bits_per_sample=0
 id=N/A
 r_frame_rate=0/0
 avg_frame_rate=0/0
 time_base=1/48000
 start_pts=-1024
 start_time=-0.021333
 duration_ts=28632064
 duration=596.501333
 bit_rate=128196
 nb_frames=27961
 nb_read_frames=N/A
 nb_read_packets=N/A
 DISPOSITION:default=1
 DISPOSITION:dub=0
 DISPOSITION:original=0
 DISPOSITION:comment=0
 DISPOSITION:lyrics=0
 DISPOSITION:karaoke=0
 DISPOSITION:forced=0
 DISPOSITION:hearing_impaired=0
 DISPOSITION:visual_impaired=0
 DISPOSITION:clean_effects=0
 DISPOSITION:attached_pic=0
 TAG:language=eng
 TAG:handler_name=DataHandler
 [/STREAM]
 }}}

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/2938>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list