[FFmpeg-user] I found the bugs

Mark Filipak markfilipak.imdb at gmail.com
Mon Jun 17 03:53:10 EEST 2024


I had a brainwave...

The 4 second video is in DTS-order. That's unusual, but that's what Criterion gave us.
What if I could rearrange the packets to PTS-order?
If showinfo and show_frames then agreed with framecrc, that would tell the whole story, wouldn't it?
Is that possible? Is it possible to change the physical order in the packet stream?

--Mark.

Below is what I actually filed at trac.ffmpeg

Summary of the bug:

I made a 4 second clip having 99 actual frames. Physical order is DTS.
VLC and PowerDVD play the clip perfectly.
'-f framecrc' & packet analyzer agree: 99 frames, same DTSes & PTSes.
'-vf showinfo' disagree: 53 frames, gap & duplicates.
'-show_frames' disagree: 54 frames, gap & duplicates.
'-vf showinfo' & '-show_frames' disagree substantially.
Other effects:
MPV exhibits a 2 second glitch that matches the gap.
'-ss' and '-to' exhibit the same sorts of problems.

__packet analyzer__  _____framecrc______  ___showinfo___  ______show_frames_______
___DTS___ ___PTS___  ___DTS___ ___PTS___   N ___PTS___     N ___DTS___ ___PTS___
504126135 504137396  504126135 504137396   0 504137396 I   0 504148657 504137396 I
           504129888  504129888 504129888
           504133642  504133642 504133642
504137396 504148657  504137396 504148657   3 504148657 P   3 504159918 504148657 P
           504141150  504141150 504141150   1 504141150 B   1 504152411 504141150 B
           504144903  504144903 504144903   2 504144903 B   2 504156165 504144903 B
504148657 504156165  504148657 504156165   5 504156165 P   5 504167426 504156165 P
           504152411  504152411 504152411   4 504152411 B   4 504163672 504152411 B
504156165 504167426  504156165 504167426   8 504167426 P   8 504178687 504167426 P
           504159918  504159918 504159918   6 504159918 B   6 504171180 504159918 B
           504163672  504163672 504163672   7 504163672 B   7 504174933 504163672 B
504167426 504174933  504167426 504174933  10 504174933 P  10 504186195 504174933 P
           504171180  504171180 504171180   9 504171180 B   9 504182441 504171180 B
504174933 504186195  504174933 504186195  13 504186195 P  13 504197456 504186195 P
           504178687  504178687 504178687  11 504178687 B  11 504189948 504178687 B
           504182441  504182441 504182441  12 504182441 B  12 504193702 504182441 B
504186195 504197456  504186195 504197456  16 504197456 P  16 504208717 504197456 P
           504189948  504189948 504189948  14 504189948 B  14 504201210 504189948 B
           504193702  504193702 504193702  15 504193702 B  15 504204963 504193702 B
504197456 504204963  504197456 504204963  18 504204963 P  18 504216225 504204963 P
           504201210  504201210 504201210  17 504201210 B
504204963 504216225  504204963 504216225                  22 504396404 504216225 P
           504208717  504208717 504208717  19 504208717 B  19 504219978 504208717 B
           504212471  504212471 504212471  20 504212471 B  20 504385143 504212471 B
504216225 504223732  504216225 504223732                  26 504411419 504223732 I
           504219978  504219978 504219978                  24 504403911 504219978 B
===================== SPLICE HERE ======================
504223731 504227485  504223731 504227485
504227485 504234993  504227485 504234993
           504231239  504231239 504231239
504234993 504246254  504234993 504246254
           504238746  504238746 504238746
           504242500  504242500 504242500
504246254 504257515  504246254 504257515
           504250008  504250008 504250008
           504253761  504253761 504253761
504257515 504265023  504257515 504265023
           504261269  504261269 504261269
504265023 504276284  504265023 504276284
           504268776  504268776 504268776
           504272530  504272530 504272530
504276284 504287545  504276284 504287545
           504280038  504280038 504280038
           504283791  504283791 504283791
504287545 504295053  504287545 504295053
           504291299  504291299 504291299
504295053 504306314  504295053 504306314
           504298806  504298806 504298806
           504302560  504302560 504302560
504306314 504317575  504306314 504317575
           504310068  504310068 504310068
           504313821  504313821 504313821
504317575 504325083  504317575 504325083
           504321329  504321329 504321329
504325083 504332590  504325083 504332590
           504328836  504328836 504328836
504332590 504340098  504332590 504340098
           504336344  504336344 504336344
504340098 504347605  504340098 504347605
           504343851  504343851 504343851
504347605 504355113  504347605 504355113
           504351359  504351359 504351359
504355113 504362620  504355113 504362620
           504358866  504358866 504358866
504362620 504370128  504362620 504370128
           504366374  504366374 504366374
504370128 504377635  504370128 504377635
           504373881  504373881 504373881
504377635 504385143  504377635 504385143
           504381389  504381389 504381389
504385143 504396404  504385143 504396404  22 504396404 P  23 504400158 504396404 P
           504388896  504388896 504388896
           504392650  504392650 504392650  21 504392650 B  21 504392650 504392650 B
504396404 504407665  504396404 504407665  25 504407665 B  28 504418926 504407665 I
           504400158  504400158 504400158  23 504400158 P  25 504407665 504400158 B
           504403911  504403911 504403911  24 504403911 B  27 504415173 504403911 B
504407665 504418926  504407665 504418926  28 504418926 I  31 504430188 504418926 P
           504411419  504411419 504411419  26 504411419 I  29 504422680 504411419 B
           504415173  504415173 504415173  27 504415173 B  30 504426434 504415173 B
504418926 504426434  504418926 504426434  30 504426434 B  33 504437695 504426434 P
           504422680  504422680 504422680  29 504422680 B  32 504433941 504422680 B
504426434 504433941  504426434 504433941  32 504433941 B  35 504445203 504433941 P
           504430188  504430188 504430188  31 504430188 P  34 504441449 504430188 B
504433941 504445203  504433941 504445203  35 504445203 P  38 504456464 504445203 P
           504437695  504437695 504437695  33 504437695 P  36 504448956 504437695 B
           504441449  504441449 504441449  34 504441449 B  37 504452710 504441449 B
504445203 504456464  504445203 504456464  38 504456464 P  41 504467725 504456464 P
           504448956  504448956 504448956  36 504448956 B  39 504460218 504448956 B
           504452710  504452710 504452710  37 504452710 B  40 504463971 504452710 B
504456464 504467725  504456464 504467725  41 504467725 P  44 504478986 504467725 P
           504460218  504460218 504460218  39 504460218 B  42 504471479 504460218 B
           504463971  504463971 504463971  40 504463971 B  43 504475233 504463971 B
504467725 504475233  504467725 504475233  43 504475233 B  46 504486494 504475233 P
           504471479  504471479 504471479  42 504471479 B  45 504482740 504471479 B
504475233 504486494  504475233 504486494  46 504486494 P
           504478986  504478986 504478986  44 504478986 P  47 504490248 504478986 B
           504482740  504482740 504482740  45 504482740 B  48 504494001 504482740 B
504486494 504497755  504486494 504497755  52 504497755 I  52 "N/A"     504497755 I
           504490248  504490248 504490248  47 504490248 B  50 "N/A"     504490248 B
           504494001  504494001 504494001  48 504494001 B  51 "N/A"     504494001 B
                                           49 504486494 P  49 "N/A"     504486494 P
                                           50 504490248 B
                                           51 504494001 B

How to reproduce:

@ECHO OFF
ECHO Tip: Use "Save As" to save this list.>"%TEMP%\%~nx1_framecrc.txt"
ECHO.>>"%TEMP%\%~nx1_framecrc.txt"
ffmpeg -i %1 -map 0 -copyts -c copy -an -dn -sn -f framecrc ->>"%TEMP%\%~nx1_framecrc.txt"
"%TEMP%\%~nx1_framecrc.txt"
PAUSE
DEL /Q "%TEMP%\%~nx1_framecrc.txt"

@ECHO OFF
ECHO Tip: Use "Save As" to save this list.>"%TEMP%\%~nx1_showinfo.txt"
ECHO.>>"%TEMP%\%~nx1_showinfo.txt"
ffmpeg -copyts -analyzeduration 240000000 -probesize 1000000000 -i %1 -map 0:v -copyts -vf showinfo 
-c:v rawvideo -f null -muxdelay 0 - 2>>"%TEMP%\%~nx1_showinfo.txt"
"%TEMP%\%~nx1_showinfo.txt"
PAUSE
DEL /Q "%TEMP%\%~nx1_showinfo.txt"

@ECHO OFF
ECHO Tip: Use "Save As" to save this list.>"%TEMP%\%~nx1_show_frames.txt"
ECHO.>>"%TEMP%\%~nx1_show_frames.txt"
ECHO %1>>"%TEMP%\%~nx1_show_frames.txt"
ECHO.>>"%TEMP%\%~nx1_show_frames.txt"
ffprobe -sexagesimal -select_streams v -i %1 2>>"%TEMP%\%~nx1_show_frames.txt"
ffprobe -sexagesimal -analyzeduration 240000000 -probesize 1000000000 -select_streams v -show_frames 
-of flat -i %1 | FINDSTR /L "key_frame=1 pts= dts= best_effort_timestamp= pict_type= 
interlaced_frame= top_field_first= repeat_pict=">>"%TEMP%\%~nx1_show_frames.txt"
"%TEMP%\%~nx1_show_frames.txt"
PAUSE
DEL /Q "%TEMP%\%~nx1_show_frames.txt"

ffmpeg version 2024-05-20-git-127ded5078-full_build-www.gyan.dev


More information about the ffmpeg-user mailing list