ffprobe -loglevel 0 -print_format json -show_format -show_streams YOURFILE
for file in *; do FPS=$(ffprobe -v error -select_streams v:0 -show_entries stream=avg_frame_rate -of default=noprint_wrappers=1:nokey=1 "${file}"); FRAME_DURATION=$(echo "scale=10; 1 / ($FPS)" | bc); echo "$FPS $FRAME_DURATION $file"; done
Output :
# Frame rate | Duration of a frame | File name
120000/1001 .0083416666 C0999.MP4
120000/1001 .0083416666 C0999.MP4-noflicker.mp4
120000/1001 .0083416666 C1001.MP4
120000/1001 .0083416666 C1001.MP4-noflicker.mp4
120000/1001 .0083416666 C1008.MP4
ffmpeg -fflags +genpts -i YOUR_FILE -fflags +genpts -i YOUR_FILE -filter_complex "[0:v]setpts=PTS-STARTPTS[top]; [1:v]setpts=PTS-STARTPTS+.033/TB, format=yuva420p, colorchannelmixer=aa=0.5[bottom]; [top][bottom]overlay=shortest=1" -c:v libx264 -crf 26 -an NOFLICKER.mp4
ffmpeg -fflags +genpts -i YOUR_FILE -fflags +genpts -i YOUR_FILE -filter_complex "[0:v]setpts=PTS-STARTPTS[top]; [1:v]setpts=PTS-STARTPTS+.033/TB, format=yuva420p, colorchannelmixer=aa=0.5[bottom]; [top][bottom]overlay=shortest=1" -c:v libx264 -crf 4 -qp 0 -an lossless.mp4