I have an avi video which is 50fps, but the camera was capturing at 25fps. Therefore, every second frame is empty. In fact, time to time the camera does not provide a frame and there are even more empty frames.
I want to remove all empty frames using ffmpeg and set fps to 25. The best I found so far is this command:
-i video.avi -c mpeg4 -qscale:v 8 -vf fps=25 -vsync drop output.avi
This would work in the ideal case when only every second frame is empty. These frames would be dropped, fps set to 25, and the video duration would remain the same without duplicite frames. But if there are more empty frames, ffmpeg makes duplicite frames to keep the duration. I need to process the video somehow and any empty or duplicite frames are unacceptable. On the other hand, I dont mind if the video will be shorter.