<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    I can understand its all extremely confusing .... i have also been
    to this stuff it took me  5 moths just to understand how everything
    worked ..... <br>
    <br>
    my advice to you you is that you should atlest read about how mpeg 2
    compression works .... mpeg4 , h264 and other compression are quiet
    complex but at their core they work pretty much like mpeg 2
    compression <br>
    <br>
    atlest concern mpeg2 part in this book its bit out dated but you
    would understand that how everything works<br>
    <br>
<a class="moz-txt-link-freetext" href="https://dl.dropboxusercontent.com/u/15671916/video%20compression/DigitalVideoAndHDTVAlgorithmsAndInterfaces.pdf">https://dl.dropboxusercontent.com/u/15671916/video%20compression/DigitalVideoAndHDTVAlgorithmsAndInterfaces.pdf</a><br>
    <br>
    you dont need to have to go too deep to understand video
    decoding/encoding ... ffmpeg library will do much for you ... just
    get some of how mpeg 2 codec works <br>
    <br>
    <div class="moz-cite-prefix">On 12/10/2013 12:14 PM, YIRAN LI wrote:<br>
    </div>
    <blockquote
cite="mid:CAN16yyPpznRGtxdr4rAgHOjvjBkOeu+Vwj6q7epSSdtOapw0jw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi friends, 
        <div><br>
        </div>
        <div><br>
        </div>
        <div>I'm now checking a duration issue of a video file.</div>
        <div>Here is some trace print out when file is opened, so we can
          know the dts of last AVPacket is 167542, and the last frame
           time stamp = 167376, and coded_picture_num = 4013</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>
          <div>  <span style="white-space:pre">Line 100: 00:00:33.384
              MAIN rhbc73 process packet, Packet.dts = 0, Packet.pts =
              -9223372036854775808 Line 101: 00:00:33.384 MAIN rhbc73
              process packet, Packet.dts = 42, Packet.pts =
              -9223372036854775808 Line 102: 00:00:33.400 MAIN rhbc73
              process packet, Packet.dts = 83, Packet.pts =
              -9223372036854775808 Line 103: 00:00:33.400 MAIN rhbc73
              process packet, Packet.dts = 125, Packet.pts =
              -9223372036854775808 Line 104: 00:00:33.400 MAIN rhbc73
              process packet, Packet.dts = 167, Packet.pts =
              -9223372036854775808 Line 105: 00:00:33.400 MAIN rhbc73 --
              get a full frame, pFrame->pkt_dts = 0,
              pFrame->pkt_pts = -9223372036854775808,
              BestEffortTimeStamp = 0, pFrame->coded_picture_number =
              0 Line 107: 00:00:33.400 MAIN rhbc73 process packet,
              Packet.dts = 209, Packet.pts = -9223372036854775808 Line
              108: 00:00:33.400 MAIN rhbc73 -- get a full frame,
              pFrame->pkt_dts = 42, pFrame->pkt_pts =
              -9223372036854775808, BestEffortTimeStamp = 42,
              pFrame->coded_picture_number = 1 Line 110: 00:00:33.400
              MAIN rhbc73 process packet, Packet.dts = 250, Packet.pts =
              -9223372036854775808 Line 111: 00:00:33.416 MAIN rhbc73 --
              get a full frame, pFrame->pkt_dts = 83,
              pFrame->pkt_pts = -9223372036854775808,
              BestEffortTimeStamp = 83, pFrame->coded_picture_number
              = 2 Line 113: 00:00:33.416 MAIN rhbc73 process packet,
              Packet.dts = 292, Packet.pts = -9223372036854775808 Line
              114: 00:00:33.416 MAIN rhbc73 -- get a full frame,
              pFrame->pkt_dts = 125, pFrame->pkt_pts =
              -9223372036854775808, BestEffortTimeStamp = 125,
              pFrame->coded_picture_number = 3 Line 116: 00:00:33.416
              MAIN rhbc73 process packet, Packet.dts = 334, Packet.pts =
              -9223372036854775808 Line 117: 00:00:33.416 MAIN rhbc73 --
              get a full frame, pFrame->pkt_dts = 167,
              pFrame->pkt_pts = -9223372036854775808,
              BestEffortTimeStamp = 167, pFrame->coded_picture_number
              = 4 Line 119: 00:00:33.416 MAIN rhbc73 process packet,
              Packet.dts = 375, Packet.pts = -9223372036854775808 Line
              120: 00:00:33.416 MAIN rhbc73 -- get a full frame,
              pFrame->pkt_dts = 209, pFrame->pkt_pts =
              -9223372036854775808, BestEffortTimeStamp = 209,
              pFrame->coded_picture_number = 5 Line 122: 00:00:33.416
              MAIN rhbc73 process packet, Packet.dts = 417, Packet.pts =
              -9223372036854775808 Line 123: 00:00:33.416 MAIN rhbc73 --
              get a full frame, pFrame->pkt_dts = 250,
              pFrame->pkt_pts = -9223372036854775808,
              BestEffortTimeStamp = 250, pFrame->coded_picture_number
              = 6 Line 125: 00:00:33.416 MAIN rhbc73 process packet,
              Packet.dts = 459, Packet.pts = -9223372036854775808 Line
              126: 00:00:33.416 MAIN rhbc73 -- get a full frame,
              pFrame->pkt_dts = 292, pFrame->pkt_pts =
              -9223372036854775808, BestEffortTimeStamp = 292,
              pFrame->coded_picture_number = 7 Line 128: 00:00:33.416
              MAIN rhbc73 process packet, Packet.dts = 501, Packet.pts =
              -9223372036854775808 Line 129: 00:00:33.416 MAIN rhbc73 --
              get a full frame, pFrame->pkt_dts = 334,
              pFrame->pkt_pts = -9223372036854775808,
              BestEffortTimeStamp = 334, pFrame->coded_picture_number
              = 8 Line 131: 00:00:33.416 MAIN rhbc73 process packet,
              Packet.dts = 542, Packet.pts = -9223372036854775808 Line
              132: 00:00:33.416 MAIN rhbc73 -- get a full frame,
              pFrame->pkt_dts = 375, pFrame->pkt_pts =
              -9223372036854775808, BestEffortTimeStamp = 375,
              pFrame->coded_picture_number = 9 Line 12134:
              00:00:51.168 MAIN rhbc73 process packet, Packet.dts =
              167417, Packet.pts = -9223372036854775808 Line 12135:
              00:00:51.168 MAIN rhbc73 -- get a full frame,
              pFrame->pkt_dts = 167250, pFrame->pkt_pts =
              -9223372036854775808, BestEffortTimeStamp = 167250,
              pFrame->coded_picture_number = 4010 Line 12137:
              00:00:51.168 MAIN rhbc73 process packet, Packet.dts =
              167459, Packet.pts = -9223372036854775808 Line 12138:
              00:00:51.168 MAIN rhbc73 -- get a full frame,
              pFrame->pkt_dts = 167292, pFrame->pkt_pts =
              -9223372036854775808, BestEffortTimeStamp = 167292,
              pFrame->coded_picture_number = 4011 Line 12140:
              00:00:51.168 MAIN rhbc73 process packet, Packet.dts =
              167501, Packet.pts = -9223372036854775808 Line 12141:
              00:00:51.168 MAIN rhbc73 -- get a full frame,
              pFrame->pkt_dts = 167334, pFrame->pkt_pts =
              -9223372036854775808, BestEffortTimeStamp = 167334,
              pFrame->coded_picture_number = 4012 Line 12143:
              00:00:51.184 MAIN rhbc73 process packet, Packet.dts =
              167542, Packet.pts = -9223372036854775808 Line 12144:
              00:00:51.184 MAIN rhbc73 -- get a full frame,
              pFrame->pkt_dts = 167376, pFrame->pkt_pts =
              -9223372036854775808, BestEffortTimeStamp = 167376,
              pFrame->coded_picture_number = 4013</span><br>
          </div>
          <div><span style="white-space:pre"><br>
            </span></div>
          <div>But when I check the file using ffprobe -show_frames
            -select_streams v input I could see<span
              style="white-space:pre"><br>
            </span></div>
          <div><br>
          </div>
          <div>
            <div>
              [FRAME]</div>
            <div>media_type=video</div>
            <div>key_frame=0</div>
            <div>pkt_pts=N/A</div>
            <div>pkt_pts_time=N/A</div>
            <div>pkt_dts=167501</div>
            <div>pkt_dts_time=167.501000</div>
            <div>pkt_duration=N/A</div>
            <div>pkt_duration_time=N/A</div>
            <div>pkt_pos=103794518</div>
            <div>pkt_size=74</div>
            <div>width=1920</div>
            <div>height=1080</div>
            <div>pix_fmt=yuv420p</div>
            <div>sample_aspect_ratio=1:1</div>
            <div>pict_type=P</div>
            <div>coded_picture_number=4016</div>
            <div>display_picture_number=0</div>
            <div>interlaced_frame=0</div>
            <div>top_field_first=0</div>
            <div>repeat_pict=0</div>
            <div>[/FRAME]</div>
            <div>[FRAME]</div>
            <div>media_type=video</div>
            <div>key_frame=0</div>
            <div>pkt_pts=N/A</div>
            <div>pkt_pts_time=N/A</div>
            <div>
              pkt_dts=167542</div>
            <div>pkt_dts_time=167.542000</div>
            <div>pkt_duration=N/A</div>
            <div>pkt_duration_time=N/A</div>
            <div>pkt_pos=103794920</div>
            <div>pkt_size=74</div>
            <div>width=1920</div>
            <div>height=1080</div>
            <div>pix_fmt=yuv420p</div>
            <div>sample_aspect_ratio=1:1</div>
            <div>pict_type=P</div>
            <div>coded_picture_number=4017</div>
            <div>display_picture_number=0</div>
            <div>interlaced_frame=0</div>
            <div>top_field_first=0</div>
            <div>repeat_pict=0</div>
            <div>[/FRAME]</div>
          </div>
          <div><br>
          </div>
          <div>the ffprobe and ffmpeg libs were built from same latest
            source, so I'd like to know why ffprobe could dump a last
            frame of timestamp 167542 but av_read_frame +
            avcodec_decode_video2</div>
          <div>
            couldn't</div>
          <div><br>
          </div>
          <div><br>
          </div>
          <div>Thanks</div>
          <div><span class="" style="white-space:pre"> </span></div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Libav-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a>
<a class="moz-txt-link-freetext" href="http://ffmpeg.org/mailman/listinfo/libav-user">http://ffmpeg.org/mailman/listinfo/libav-user</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>