Changing the Framerate / FPS of an x264 .mp4 movie file without re-encoding

Alain Kelder mentioned this command employing mencoder in his blog post (see resources section):

mencoder -fps 60 -nosound -ovc copy $MOVIE -o $(basename -s .mp4 $MOVIE)_60p_no-re-enc.mp4


Or use MP4Box if it's available for your platform:

MP4Box -add source.mp4#video -raw 1 -new test
# Then save it as an MP4 again:
MP4Box -add test_track1.h264:fps=30 -new dest.mp4). You

(Alternative) Commands that DO re-encoding

If you are OK with re-encoding, however, you can also use ffmpeg:

ffmpeg -i $(basename -s .h264 $MOVIE).mp4 -r 60 -filter:v "setpts=(1/20)*PTS" $(basename -s .h264 $MOVIE)_60p_re-enc.mp4

assuming the input file has a framerate of 3 fps and the one to write should have 60 fps (thus speedup = 60/3 = 20).