[FFmpeg-user] Find errors in frames

Richard Bartczak richard.bartczak at gmx.de
Wed May 29 14:58:44 EEST 2024


Hello,

the following script will be used :

#!/bin/bash

while IFS= read -r -d $'\0' video
do
     filename=$(basename -- "$video")
     filename="${filename%.*}"

     ffmpeg -y -i "$video" -vcodec libx264 -crf 51 -preset ultrafast
-acodec copy -f mp4 -movflags frag_keyframe+empty_moov+delay_moov pipe:1
 >/dev/null 2>"${filename}.txt" </dev/null
     TxtFileName="${filename}.txt"


done < <(find -iregex ".*\.\(mp4\|mkv\|m2ts\|ts\)" -print0)
grep -i -n 'error\|duplicate\|failure\|missing\|POCs\|corrupt'
"${TxtFileName}"
echo "Ready"
read pause

Output :

...

   Stream #0:0: Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt470bg,
top coded first (swapped)), 720x576 [SAR 64:45 DAR 16:9], q=2-31, 25
fps, 12800 tbn
     Metadata:
       encoder         : Lavc58.134.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
   Stream #0:1(deu): Audio: mp2 (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 192 kb/s
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.07 bitrate=  
0.0kbits/s speed=9.37x
frame=   76 fps=0.0 q=48.0 size=       0kB time=00:00:03.10 bitrate=  
0.0kbits/s speed=6.03x
frame=  159 fps=156 q=49.0 size=       0kB time=00:00:06.43 bitrate=  
0.0kbits/s speed=6.33x
frame=  234 fps=154 q=51.0 size=       0kB time=00:00:09.43 bitrate=  
0.0kbits/s speed=6.21x
frame=  312 fps=154 q=50.0 size=     254kB time=00:00:12.55 bitrate=
166.0kbits/s speed=6.21x
frame=  411 fps=163 q=51.0 size=     254kB time=00:00:16.51 bitrate=
126.2kbits/s speed=6.55x
... until the end

frame=164713 fps=159 q=52.0 size=  223893kB time=01:49:48.59 bitrate=
278.4kbits/s dup=3 drop=0 speed=6.35x
frame=164783 fps=159 q=52.0 size=  224201kB time=01:49:51.38 bitrate=
278.6kbits/s dup=3 drop=0 speed=6.35x
frame=164852 fps=159 q=52.0 size=  224201kB time=01:49:54.14 bitrate=
278.5kbits/s dup=3 drop=0 speed=6.35x
frame=164933 fps=159 q=52.0 size=  224201kB time=01:49:57.38 bitrate=
278.4kbits/s dup=3 drop=0 speed=6.35x
frame=164999 fps=159 q=-1.0 Lsize=  224544kB time=01:49:59.94 bitrate=
278.7kbits/s dup=3 drop=0 speed=6.35x
video:69022kB audio:154668kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.381712%
[libx264 @ 0x56b702a980c0] frame I:660   Avg QP:48.95  size:  2988
[libx264 @ 0x56b702a980c0] frame P:164339 Avg QP:50.53  size: 418
[libx264 @ 0x56b702a980c0] mb I  I16..4: 100.0%  0.0%  0.0%
[libx264 @ 0x56b702a980c0] mb P  I16..4:  5.0%  0.0%  0.0% P16..4: 
4.4%  0.0%  0.0%  0.0%  0.0%    skip:90.6%
[libx264 @ 0x56b702a980c0] coded y,uvDC,uvAC intra: 3.7% 29.9% 1.0%
inter: 0.3% 0.8% 0.0%
[libx264 @ 0x56b702a980c0] i16 v,h,dc,p: 52% 24% 15%  9%
[libx264 @ 0x56b702a980c0] i8c dc,h,v,p: 87%  5%  8%  0%
[libx264 @ 0x56b702a980c0] kb/s:85.67

My question, are there more then the given error list :

grep -i -n 'error\|duplicate\|failure\|missing\|POCs\|corrupt'
"${TxtFileName}"

to find corrupted frames ?

Or is it possible, that I will miss some error indications ?

Regards

Gloster






More information about the ffmpeg-user mailing list