Get the reported and actual number of frames in a video.
Note: I recently found a video that reported having 2985 frames, but actually only had 29 frames, which were all keyframes.
ffprobe -v error -select_streams v:0 -show_entries stream=nb_frames -of default=nokey=1:noprint_wrappers=1 <input-video>
ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 <input-video>
ffprobe -v error -skip_frame nokey -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 <input-video>
ffmpeg -i <input-video> -c:v libx264 -preset slow -crf 23 -c:a copy <output-video>
Trim out two portions of the video. Keep 8s to 49s and 64s to end:
ffmpeg -i input.mp4 -filter_complex \
"[0:v]trim=start=8:end=49,setpts=PTS-STARTPTS[b]; \
[0:v]trim=start=64,setpts=PTS-STARTPTS[d]; \
[b][d]concat[out1]" -map '[out1]' output.mp4
where to install ffprobe?