VideoHelp Forum




+ Reply to Thread
Results 1 to 2 of 2
  1. Member
    Join Date
    Aug 2023
    Location
    Germany
    Search PM
    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
    Quote Quote  
  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
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!