A bit of video fun, ffmpeg fractional timestamp and slow-down
So, I've been recording some workouts, and posting them on Instagram; lately I've also experimented with video-altering apps on Android.But, Linux has its own Swiss-army knife for altering videos, called ffmpeg.
I've also been recording myself massaging a punching bag, and was pleased when I saw myself tapping and then stomping the bag, in rapid succession, with great power.
So, I thought I'd see how fast I was actually going, and after some digging around, I found that I could add a fractional timestamp to a video, and slow it down, using these commands:
ffmpeg -i VID_20180803_153745~2.mp4 -vf "drawtext=text='Time\ \ \ \ \ \ ':x=120:y=h-lh-30:fontsize=20:fontcolor=white:shadowcolor=black:shadowx=1:shadowy=1:timecode='00\:00\:00\:00':timecode_rate=25/2" out.mp4
which adds the timestamp, and
ffmpeg -i out.mp4 -filter:v "setpts=8.0*PTS" out2.mp4
which slows down the video 8-fold. Here's the video:
https://www.instagram.com/p/BmEPPJWgQ6b
And here's another, edited using an Android app, to go forwards and backwards, creating something that can be watched over and over again, smoothly:
https://www.instagram.com/p/BmCD4DAFXfZ/
[Added a day later:] I guess I should mention that the commando used to find the timecode_rate was:
ffprobe -v 0 -of csv=p=0 -select_streams 0 -show_entries stream=r_frame_rate VID_20180803_153745~2.mp4
and the output was: 25/2
[Permalink] [By morphex] [ffmpeg (Atom feed)] [04 Aug 20:19 Europe/Oslo]