I know this is an old question but none of the current answers are the recommended way anymore.
Lossless (video) remuxing
As noted in the comments there is a way to do this where the video does not
have to be re-encoded. It requires remuxing the file to a different containter format MKV and then remuxing it back into an MP4. Here is an example that changes a video to 12 frames/second:
mkvmerge --default-duration 0:12fps --fix-bitstream-timing-information 0 original-video.mp4 -o temp-video.mkv
ffmpeg -i temp-video.mkv -c:v copy slow-video.mp4
If the video contains audio you can also slow that down without changing the pitch, but it is not a lossless conversion. The example below assumes the source video was 24 frames/second so that audio needed to be slowed to half (0.5) speed using ffmpeg's atempo filter.
mkvmerge --default-duration 0:12fps --fix-bitstream-timing-information 0 original-video.mp4 -o temp-video.mkv
ffmpeg -i temp-video.mkv -c:v copy -c:a aac -filter:a "atempo=0.5" slow-video-with-audio.mp4
FFMPEG Wiki Guidance
This is the guidance from the ffmpeg wiki. Note that all of these options do require re-encoding the video.
Speeding up/slowing down video
You can change the speed of a video stream using the setpts video filter. Note that in the following examples, the audio stream is not changed, so it should ideally be disabled with -an.
To double the speed of the video, you can use:
ffmpeg -i input.mkv -filter:v "setpts=0.5*PTS" output.mkv
The filter works by changing the presentation timestamp (PTS) of each video frame. For example, if there are two succesive frames shown at timestamps 1 and 2, and you want to speed up the video, those timestamps need to become 0.5 and 1, respectively. Thus, we have to multiply them by 0.5.
Note that this method will drop frames to achieve the desired speed. You can avoid dropped frames by specifying a higher output frame rate than the input. For example, to go from an input of 4 FPS to one that is sped up to 4x that (16 FPS):
ffmpeg -i input.mkv -r 16 -filter:v "setpts=0.25*PTS" output.mkv
To slow down your video, you have to use a multiplier greater than 1:
ffmpeg -i input.mkv -filter:v "setpts=2.0*PTS" output.mkv
Smooth
You can smooth out slow/fast video with the minterpolate video filter. This is also known as "motion interpolation" or "optical flow".
ffmpeg -i input.mkv -filter "minterpolate='mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=120'" output.mkv
Other options include slowmoVideo and Butterflow.
Speeding up/slowing down audio
You can speed up or slow down audio with the atempo audio filter. To double the speed of audio:
ffmpeg -i input.mkv -filter:a "atempo=2.0" -vn output.mkv
The atempo filter is limited to using values between 0.5 and 2.0 (so it can slow it down to no less than half the original speed, and speed up to no more than double the input). If you need to, you can get around this limitation by stringing multiple atempo filters together. The following with quadruple the audio speed:
ffmpeg -i input.mkv -filter:a "atempo=2.0,atempo=2.0" -vn output.mkv
Using a complex filtergraph, you can speed up video and audio at the same time:
ffmpeg -i input.mkv -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mkv
This is indeed due to the H264 PTS generation bug. My suggestion in the comment works for me. But so does the method at the end of the post.
Command for initial file:
ffmpeg -framerate 5 -start_number 1 -t 1 -i "f%d.png" -c:v libx264 -pix_fmt yuv420p -r 5 -bf 0 initial.mp4
Command for individual frames:
ffmpeg -framerate 5 -i "f6.png" -c:v libx264 -pix_fmt yuv420p -bf 0 -r 5 next1.mp4
...
ffmpeg -framerate 5 -i "f10.png" -c:v libx264 -pix_fmt yuv420p -bf 0 -r 5 next5.mp4
A single join:
list.txt:
file initial.mp4
file next1.mp4
and
ffmpeg -f concat -i list.txt -auto_convert 1 -c copy with6.mp4
with6.mp4:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'with6.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.2.100
Duration: 00:00:01.20, start: 0.000000, bitrate: 129 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 124 kb/s, 5 fps, 5 tbr, 10240 tbn, 10 tbc (default)
Metadata:
handler_name : VideoHandler
Join the rest at once:
file with6.mp4
file next2.mp4
file next3.mp4
file next4.mp4
file next5.mp4
and
ffmpeg -f concat -i list.txt -auto_convert 1 -c copy with6.mp4
with10.mp4:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'with10.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.2.100
Duration: 00:00:02.00, start: 0.000000, bitrate: 168 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 165 kb/s, 5 fps, 5 tbr, 10240 tbn, 10 tbc (default)
Metadata:
handler_name : VideoHandler
The other method is to keep your commands as-is but mux to MKV first, and then remux to MP4 i.e.
ffmpeg -f concat -i concat.txt -c copy new_output.mkv
ffmpeg -i new_output.mkv -c copy new_output.mp4
Best Answer
VLC has a problem with playing low framerate videos. Use
The images will still turnover at 1 Hz but there will be 9 duplicates frames per second. x264 is efficient at coding duplicate frames so size won't increase 10 fold.