[FFmpeg-trac] #1801(undetermined:new): muxing.c example code fails for most formats

FFmpeg trac at avcodec.org
Wed Oct 10 13:31:55 CEST 2012


#1801: muxing.c example code fails for most formats
-------------------------------------+-------------------------------------
             Reporter:  AztecC       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:  muxing.c     |               Blocked By:
  pts dts                            |  Reproduced by developer:  0
             Blocking:               |
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug: The muxing.c example in doc/examples only seems to
 work for a few formats like .avi. Some formats seem to work like .flv, but
 it produces way too many frames. Anything involving H264 generates a
 pts(0) < dts(0) error. The fix is fairly simple. Add:

     if (pkt.pts != AV_NOPTS_VALUE)
         pkt.pts = av_rescale_q( pkt.pts, c->time_base, st->time_base );
     if (pkt.dts != AV_NOPTS_VALUE)
         pkt.dts = av_rescale_q( pkt.dts, c->time_base, st->time_base );

 after the call to avcodec_encode_video2 inside the test for 'got_output'.
 It can also be added after the call to avcodec_encode_audio2 as well for
 completeness.

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


More information about the FFmpeg-trac mailing list