[FFmpeg-trac] #360(avformat:open): Video packet timestamps broken for Panasonic Lumix GH2 AVCHD files

FFmpeg trac at avcodec.org
Wed Aug 17 10:25:15 CEST 2011


#360: Video packet timestamps broken for Panasonic Lumix GH2 AVCHD files
------------------------+-----------------------
Reporter:  rmk          |       Owner:
    Type:  defect       |      Status:  open
Priority:  normal       |   Component:  avformat
 Version:  unspecified  |  Resolution:
Keywords:               |  Blocked By:
Blocking:               |  Reproduced:  0
Analyzed:  0            |
------------------------+-----------------------

Comment (by rmk):

 The place where the timestamps essentially get erased (before that they
 are correct AFAICS) is this block in libavformat/utils.c in
 compute_pkt_fields:

     // some mpeg2 in mpeg-ps lack dts (issue171 / input_file.mpg)
     // we take the conservative approach and discard both
     // Note, if this is misbehaving for a H.264 file then possibly
 presentation_delayed is not set correctly.
     if(delay==1 && pkt->dts == pkt->pts && pkt->dts != AV_NOPTS_VALUE &&
 presentation_delayed){
         av_log(s, AV_LOG_DEBUG, "invalid dts/pts combination\n");
         pkt->dts= pkt->pts= AV_NOPTS_VALUE;
     }

 If I remove this, the file is decoded as I would expect it. As the comment
 suggests, it is indeed the case that presentation_delayed is set to 1
 because st->codec->has_b_frames is 1, which I don't understand since the
 h.264 stream only contains I- and P-slices as far as I could see by adding
 debug output in h264.c. I hope this helps in finding a proper fix. Until
 it has been fixed a workaround for GH1/GH2 owners is to restrict this
 check to non-H.264 codecs.

-- 
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/360#comment:7>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list