I've got a video that's 30 minutes long. I want to make a speeded up version that's (say) 15 minutes long. I could do this by dropping every 2nd frame. How can I do this on linux?
I'm playing with gstreamer and it looks cool. Is there a way to do this with gstreamer? What would be the gst-launch
command line to do it?
My source video is in Motion JPEG, so I do have the frames to drop. Even if it was using keyframes, there still should be a way to 'double speed' the film?
I'd like a command line way to do this since I want to automate it.
Thus, the greater the frame rate, the more realistic and smooth a video will appear. However, when slowing down film, shooting slow-motion, or filming rapid movements, the higher frame rates become truly noteworthy in that you can see far more detail with minimal skips or motion jerk.
"Dropped frames" means that your connection to remote server isn't stable or you can't keep up with your set bitrate. Because of this, the program was forced to drop some of the video frames in order to compensate. If you drop too many frames, you may be disconnected from the streaming server.
Step 1: Add clip speed Clip speed allows you to play a video clip faster or slower than its original speed. To apply the clip speed effect, click and drag it from the tools panel to a clip on the timeline. Open the effects tray and drag the clip speed handles to adjust the speed of a clip.
I looked around for a while recently on the best way to do this. I experimented with mencoder -speed and also libavfilter's setpts option. The best way I found was to output individual frames and then re-encode those frames into a single video. This example assumes a 30fps input video for best results and drops every other frame.
# Output the video at 15fps as jpegs
ffmpeg -i input.m4v -r 15 -f image2 /tmp/output-%06d.jpg
# Re-encode the frames at 30fps as h264
ffmpeg -r 30 -i "/tmp/output-%06d.jpg" -vcodec libx264 -threads 0 -an output.m4v
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With