Cinelerra + GoPro: Mixing 1080p 48FPS and 720p 120FPS

I’ve recently been playing with mixing 1080p 48FPS footage with 720p 120FPS footage to get the best of both worlds of smooth slow-motion and beautifully crisp full-speed footage from the GoPro.

Firstly, I record 720p 120FPS for slow motion down to 1/5th speed and 1080p 48FPS for crisp full-speed or half-speed footage. Alternatively you could go with 1080p at 60FPS and output 30FPS with slow motion down to quarter speed. I wanted the option to slow things down that little bit more.

Since 120 is not roundly divisible by 48, working with a 120FPS project would mean losing frames from your 1080p material – so I set my Cinelerra project up for 1920×1080 at 240 FPS.

For simplicity I create two video tracks – one for all the 720p material, and one for the 1080p material. This way the camera Z can be set to 1.5 for the whole 720p track – no messing around scaling back and forth. I add the reframeRT effect to the 1080p track and share the effect to the 720p track. This keeps the two tracks in sync as you play with having sections in slow motion.

See my post on workflow for more tips on setting up the project and working with slow-motion.

Unfortunately, Cinelerra has a meltdown when I render the project using my usual combination of a yuv4mpeg pipe and ffmpeg with the following ffmpeg command:
ffmpeg -threads 0 -f yuv4mpegpipe -i - -vcodec libx264 -crf 26 -f avi -r 48 %
While this works fine on a 720p project, for some reason Cinelerra spits out a yuv4mpeg stream that ffmpeg (and other programs, as far as I could tell) think is 1 FPS. The result is this:

The first workaround I found was to render an ogg/theora file. But there is no way to cut the framerate from the project’s 240FPS, so the resulting output has to be re-processed to bring the framerate down to something sensible … and to crop the extra 8 pixels theora adds at the bottom of frames.

Eventually I found a better way to work around the issue. Simply use the following ffmpeg command for the pipe:
ffmpeg -threads 0 -f yuv4mpegpipe -i - -filter:v "setpts=0.0041667*PTS" -vcodec libx264 -crf 26 -f avi -r 48 %

The difference is the addition of a video filter documented to be used for speeding up or slowing down footage. The value of “setpts” is derived by dividing the incorrect 1FPS framerate by the correct 240FPS rate. Adjust accordingly if you see similar problems at other frame rates.

Here is the result:

About shortfriction

Clinical Psychologist
This entry was posted in Digital video. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s