Set frame rate of a 60p video to 24p to achieve lossless slow motion playback

Picked up an inexpensive camcorder, Samsung HMX-H300, for $260 at BHPhoto, to replace my ancient Canon Optura 300, which we've been using to film our wakeboarding for training purposes. No more time consuming dv transfer and compression since the HMX-H300 saves footage as H.264 encoded files. It's also much better quality. Not the best, though, as according to reviews, several other consumer grade camcorders produce better looking video (for a couple hundred bucks more). The HMX-H300 also doesn't support lens accessories like filters and telephoto/wideangle adapters and has a terribly narrow field of view. However, it does offer an unusually good optical zoom for its class (30x).

For shooting wakeboarding, which essentially comes down to filming well lit subjects 50-80 ft away, outdoors, it should be just fine. I'm also pleased that it can do 720p60, while some of its more highly reviewed competitors capture only interlaced at 30 fps. The HMX-H300 can do 1080i, 720p and 480p at 60fps. I wanted a minimum of 60 fps since that can be played back at 24 fps for lossless 2.5x slow motion.

There are several tools that allow overriding the frame rate of a 60 fps video to 24 fps to achieve 2.5x slow motion playback. The following example uses mencoder. The command as listed will also drop audio, since I don't want it for my application.

mencoder -fps 24 -nosound -ovc copy in.mp4 -o out.mp4

To process all of Samsung's clips in the current directory (24p versions will be saved using the original file name, but with lower case file extension):

for f in $(ls *.MP4); do
  echo processing $f
  nf=$(echo $f | sed 's/MP4/mp4/')
  mencoder -fps 24 -nosound -ovc copy $f -o $nf

Since the operation involves no re-encoding, it is also very fast (about a 100MB worth of test clips took about a second to process on my system).

Original footage as captured by Samsung HMX-H300 at 720p60.

Original footage as captured by Samsung HMX-H300 at 720p60, but with frame rate changed to 24 to losslessly achieve the 2.5x slow motion effect.

1 Comment

  • 1. Alain Kelder is a Giant D&hellip replies at 18th July 2012, 11:45 am :

    […] some recent update to mencoder version as provided by d-m.o, broke it for one of my applications (setting frame rate of a 60p video to 24p to achieve lossless slow motion playback) — no errors would be returned, but mencoder would get “stuck” at 99%. Also, some […]

Leave a comment

NOTE: Enclose quotes in <blockquote></blockquote>. Enclose code in <pre lang="LANG"></pre> (where LANG is one of these).