The script will produce a frame check, based on libx264 video frame analysis.
It will check all files of a directory.
Its clear, the "grep" output will only be seen, if only one file will be checked, and the script will be called in an open terminal.
The script :
#!/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)
#dos2unix -c mac "${TxtFileName}"
#grep -C 5 -i -n 'error\|duplicate\|failure' "${TxtFileName}"
grep -i -n 'error\|duplicate\|failure\|missing' "${TxtFileName}"
echo "Ready"
read pause
#############
Example of output :
frame=192290 fps=107 q=53.0 size= 156266kB time=01:04:06.00 bitrate= 332.8kbits/s speed=2.14x
frame=192342 fps=107 q=53.0 size= 156266kB time=01:04:07.01 bitrate= 332.8kbits/s speed=2.14x
frame=192398 fps=107 q=52.0 size= 156266kB time=01:04:08.16 bitrate= 332.7kbits/s speed=2.14x
[h264 @ 0x560981921880] co located POCs unavailable
frame=192457 fps=107 q=54.0 size= 156266kB time=01:04:09.34 bitrate= 332.6kbits/s dup=3 drop=0 speed=2.14x
[h264 @ 0x5609818dd580] concealing 3317 DC, 3317 AC, 3317 MV errors in P frame
./Scotland Yard jagt Dr.Mabuse.ts: corrupt decoded frame in stream 0
frame=192510 fps=107 q=52.0 size= 156266kB time=01:04:10.39 bitrate= 332.5kbits/s dup=3 drop=0 speed=2.14x
frame=192570 fps=107 q=53.0 size= 156463kB time=01:04:11.59 bitrate= 332.8kbits/s dup=3 drop=0 speed=2.14x
frame=192627 fps=107 q=50.0 size= 156463kB time=01:04:12.74 bitrate= 332.7kbits/s dup=3 drop=0 speed=2.14x
+ Reply to Thread
Results 1 to 2 of 2
-
-
Why re-encode and not just decode only and dump file output to /dev/null?
users currently on my ignore list: deadrats, Stears555, marcorocchini
Similar Threads
-
[LINUX] can ffmpeg (or any othe linux command) genere an ANIMATED waveform
By Jintor_Universe in forum ProgrammingReplies: 5Last Post: 28th Oct 2021, 19:29 -
ffmpeg "Missing key frame while searching for timestamp" message
By the_steve_randolph in forum Newbie / General discussionsReplies: 0Last Post: 19th Aug 2021, 14:38 -
Using FFMPEG to check integrity of video files
By gmc9960 in forum Video ConversionReplies: 5Last Post: 2nd May 2020, 07:27 -
FFmpeg is changing the frame rate to Variable when copying video?
By kkiller23 in forum Newbie / General discussionsReplies: 5Last Post: 1st Dec 2019, 13:14 -
screen capture video and audio through headphones with ffmpeg on Linux
By xyzo in forum LinuxReplies: 2Last Post: 24th May 2019, 13:33