Basic useful commands and scripts

ffmpeg Commands

Clip Command: Useful for chopping up a video into small segments for things like Q&A sessions etc.

 ffmpeg -i test.dv -vcodec copy -acodec copy -ss 00:53:00 -t 01:15:00 TestQuestion1.mp4 

Aspect Ratio: This command converts a video from one ratio into another

 -aspect 16:9 

Quality: I needed a simple way to maintain quality of a video while being processed. The lower the number the better.

 -qscale 0 

Speed Up: This command speeds up a movie. Checking out it's usefulness for doing timelapse. The "setpts=0.5*PTS" is the key part of the command here. 1 is normal speed. 2 is double. 0.5 is half etc.

ffmpeg -i time-lapse-test-org.avi -qscale 0 -filter:v "setpts=0.5*PTS" time-lapse-test-1.avi

Very Simple Convert Command: This very simple ffmpeg command can be used to convert between one video file and another.

ffmpeg -i foo.avi -qscale 0 -aspect 16:9 -acodec:a libmp3lame foo.mp4

Melt Commands

Join Files: This very simple command joins files. I find it easier to convert to .mp4 and then convert the same file into the other formats. I'm sure that's the wrong thing to do but it works for me.

melt TestQuestion1.mp4 TestAnswer1.mp4 -consumer avformat:Q1andA1.mp4 f=mp4 vcodec=libx264 

PyConAu/AV/CommandsandScripts (last edited 2014-04-19 04:52:42 by MatthewFranklin)