FFMS / ffms2

An FFmpeg based source library and Avisynth/VapourSynth plugin for easy frame accurate access
Other
582 stars 105 forks source link

commit 13d9f01f is breaking accuracy FFMS_GetFrame() #318

Closed lotharkript closed 6 years ago

lotharkript commented 6 years ago

I have a file with 84 video frames. The file has only 1 Key frame, which is at the beginning.

Here are the last 7 frames outputted by ffprobe -show_packets

pts=76076|dts=75075
pts=78078|dts=76076
pts=79079|dts=77077
pts=80080|dts=78078
pts=83083|dts=79079
pts=82082|dts=80080
pts=81081|dts=81081   

Here are the frame type as show from ffprobe -show_frames

pkt_pts=75075|pict_type=B
pkt_pts=76076|pict_type=B
pkt_pts=77077|pict_type=P
pkt_pts=78078|pict_type=P
pkt_pts=79079|pict_type=P
pkt_pts=80080|pict_type=P
pkt_pts=81081|pict_type=B
pkt_pts=82082|pict_type=B
pkt_pts=83083|pict_type=P    <-- FFMS_GetFrame(83) 

After indexing the file, we are calling FFMS_GetFrame(83) and it will return the P frame with PTS=83083, which is correct. but before the commit 13d9f01f, if we were to call FFMS_GetFrame(82), we were getting the B frame with PTS=82082. But after the commit, we are getting the P again (the P frame at PTS=83083)

Trying to call also FFFMS_GetFrame(81) and still return the same P frame (not the B frame we were expected)

I bisect the code using the sample code in your documentation and just call FFMS_GetFrame(82) (instead of FFMS_GetFrame(0) ) and printed the FFMS_Frame.PictType and check the YUV data as well.

dwbuiten commented 6 years ago

Is this with all types, or just one specific type (H.264 progressive)?

I'll check this ASAP.

dwbuiten commented 6 years ago

Created a sample an reproduced with at test program. Attaching the sample.

test.mp4.gz