VLC has jittery playback when playing low framerate MP4 files.
VLC has jittery playback when playing low framerate MP4 files.
To produce a sample file from ffmpeg,
ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=10 -pix_fmt yuv420p 10fps.mp4
Play back the file, notice how frames are being dropped, with longer than normal intervals between the frames. Interestingly, this doesn't seem to be an issue with MKV files. I.E
ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=10 -pix_fmt yuv420p 10fps.mkv
The effect is quite subtle, but it is very noticeable in a video with movement. For best effect, play the MP4 and MKV files side by side, or compare with the same command in ffplay.
Furthermore, the issue seems linked to the actual playback speed, not just the framerate of the input file. For instance, if you take a 25FPS MP4 and play it back at 0.4x playback speed (10FPS), it shows the same jitery behavior. Test file:
ffmpeg -f lavfi -i testsrc=duration=10:size=1280x720:rate=25 -pix_fmt yuv420p 25fps.mp4
And compare this with 10fps.mkv
I stumbled across this issue when transcoding a low FPS MJPEG stream to H264 MP4. I'm currently running 3.0.6 on MacOS Mojave 10.14.1, and have confirmed the issue is present on 3.0.4 on Windows 10. I thought it may have been linked to a decoding bug, I've tried the usual assortment of resetting preferences, turning off HW decoding, playing with the FFMPEG codec settings, nothing seemed to help.
The only working solution I've found is to use MKV instead of MP4, or transcode to a fixed higher framerate MP4.
Possibly related to older bugs regarding freezing streams with low framerate MP4s, see:
https://stackoverflow.com/questions/19267443/vlc-freezes-for-low-1-fps-video-created-from-images-with-ffmpeg https://trac.videolan.org/vlc/ticket/214 https://trac.videolan.org/vlc/ticket/3625