[FFmpeg-trac] #2658(avformat:new): Written mp4 with h264/AAC doesnt use fps as video timebase (discrepancy with libav) (was: Written mp4 with h264/AAC unplayable (discrepancy with libav))

FFmpeg trac at avcodec.org
Fri Jan 31 16:11:15 CET 2014

#2658: Written mp4 with h264/AAC doesnt use fps as video timebase (discrepancy
with libav)
             Reporter:  Lastique    |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avformat
              Version:  1.2.1       |               Resolution:
             Keywords:  mov, libav  |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
Changes (by michael):

 * keywords:  mov => mov, libav


 Replying to [comment:3 Lastique]:
 > Replying to [comment:1 cehoyos]:
 > > Please also test current git head.
 > The latest snapshot behavior is the same.
 > > Is the problem also reproducible with ffmpeg (the application) or only
 if you use library calls from your application?
 > We only use the library API in our application, and I'm not sure how I
 can reproduce the same library setup from ffmpeg command line.
 > Replying to [comment:2 heleppkes]:
 > > Note that it is possible for avformat to change the stream timebase
 from the one you specified when it thinks that another one is more
 appropriate for the format, so you should always rescale your timestamps
 to the stream timebase, or your assumption may go wrong.
 > Yes, this seems to be the problem. libav does not modify time_base we
 set in the context initialization, and ffmpeg sets video time_base to be
 equal to the audio time_base. If we use the time_base set by ffmpeg for
 rescaling then the written file is playable. Thanks for the suggestion.
 > Frankly, this is an odd feature. Why would the library change settings
 requested by the caller?

 To ensure the timebase is precisse enough to allow precissely specifying
 timestamps of frames. Also some containers like mpeg-ps/ts use a fixed
 90khz timebase that cannot be changed.
 Also note, the mov/mp4 muxers have an option to force a specific video
 timebase (video_track_timescale) if you want a specific course grained

Ticket URL: <https://trac.ffmpeg.org/ticket/2658#comment:4>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list