2

I need a video editor to slow down some videos and overlap a time scale (millisecond) with the video. Can you recommend me any software that has these functions? Slowing down the videos is not as important as the time subtitle. I recorded all the clips using a GoPro Hero4 camera using optimum settings (roughly 60fps?).

I am trying to measure the time required for a wave front to travel a known distance for some school project experiments.

Zanna
  • 72,312
ASim128
  • 21

2 Answers2

2

In order to accomplish everything we want to do here we will have to do 2 things in order.

1. overlay accurate timestamps on the video

2. slow the video whie retaining the original timestamps

ffmpeg can provide a time overlay via the drawtext filter

Step 1

ffmpeg -i input.mp4 -s 1920x1080 -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:expansion=normal: text='frame %{n}\\: pts=%{pts \\: hms}': fontcolor=white:fontsize=48: x=7: y=7" -vcodec libx264 -vb 2000k -strict -2 -preset ultrafast -f mp4 output.mp4

You can adjust the location of the timecode by adjusting the x= and y= parameters after the fontsize parameter. ffmpeg is a tremendously powerful video processing program and I won't pretend to know all the different options by heart, but I have yet to discover much I needed to do with media files that I couldn't accomplish with it and it's included ffplay media player other than perhaps this

FFMpeg pre-built binaries and documentation can be found here I used ffmpeg version 2.8.10-0ubuntu0.16.04.1

Step 2

Slowing down the video can be accomplished using the setpts filter video filter. This filter works by changing the presentation timestamp of each frame so you'll want to do this second in order to retain the accurate pts for the time overlay discussed above. we will begin by copying our original output file to a new input file with the command cp output.mp4 i2.mp4

We need to use a factor greater than 1 to slow down the video. Note that this filter will not effect the audio so I've added the -an switch to strip it in the following command:

ffmpeg -i i2.mp4 -an -vf "setpts=2.0*PTS" output.mp4

This results in a video that runs at 1/2 speed (takes twice as long to play) of the original.

If anything is unclear about this answer, please drop me a comment and I'll do my best to clarify.

Sources

Elder Geek
  • 36,752
0

If you are looking for an editor that has the ability to do this stuff as well as be a full suite editor then I'd suggest looking at Kdenlive.

Timecode Overlay with Kdenlive

Slow Down Video with Kdenlive

Otherwise, if you are looking for a solution to this and only this then this answer from Elder Geek might be what you want. Those commands could be tweaked and used again in the future even in script form as long as the source camera is consistent.