

# Check ffprobe of each segment is consistentįfmpeg -i test_video.mp4 -acodec copy -f segment -vcodec copy -reset_timestamps 1 -segment_time 5 -map 0 clips/part_%d.mp4 Total_num_frames=$(ffprobe -v quiet -show_entries stream=nb_read_packets -count_packets -select_streams v:0 -print_format json test_video.mp4 | jq '.streams.nb_read_packets' | tr -d '"')įfmpeg -hwaccel cuda -i test_video.mp4 -vsync 2 -f null. Here is an example script I wrote to test this issue : # get total video frame number using ffprobe or ffmpeg

I noted that the first segment is always 3 frame smaller (on ffprobe) than the other ones and it's the only consistent one.


The issue is exactly the same if I split by 10 seconds or any split, I always lose 3 frames. I split the video in 5 sec segments and I get ffprobe giving the expected video length but ffmpeg giving 3 frame less that expected on every segment but the first one. I wrote the following sample script with a test video I have I'm having regularily issue with hvc1 videos getting an inconsistent number of frames between ffprobe info and ffmpeg info, and I would like to know what could be the reason of this issue and how if it's possible to solve it without re-encoding the video.
