Audio / Video *nix Command Line Tricks

root's picture

How to create fast forward (timelapse) video from normal one with ffmpeg without audio:


# ffmpeg -i crap.mov -an -vf setpts=0.20*PTS crap-fast.mov
NOTE: If you want to create the video with sound (remove the -an option), and the encoder is "aac", you must add the options "-strict -2".

How to create a slow motion video from normal one with ffmpeg without audio:


# ffmpeg -i crap.mov -an -vf setpts=2*PTS crap-slow.mov
NOTE: If you want to create the video with sound (remove the -an option), and the encoder is "aac", you must add the options "-strict -2".

More to read about slowing down or speeding up the video, here.

How to join multiple videos together:


1. Create a text file with all their path in it:
$ for vid in $(ls *.MOV); do echo "file '$vid'"; done >vids.txt
$ tail vids.txt 
file '01170531_2651.MOV'
file '01170532_2652.MOV'
file '01170532_2653.MOV'
file '01170532_2654.MOV'
file '01170532_2655.MOV'
file '01170533_2656.MOV'
file '01170533_2657.MOV'
file '01170533_2658.MOV'
file '01170534_2659.MOV'
file '01170534_2660.MOV'

2. Execute ffmpeg as follows:
$ ffmpeg -f concat -i vids.txt -c copy video_draft.mov

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself!
Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.