Editing Recordings (on Mac OS)
brew install ffmpeg
pip install ffmpeg
$ man ffmpeg
Example: Extract audio from a video (mp4) quicktime file.
ffmpeg -i input.mp4 output.mp3ffmpeg -i input.m4a output.mp3
Example: Converting and manipulating video formats like mov and mp4
Screen capture using QuickTime and manipulate with Trim (in QuickTime) and ffmpeg (from the command line)ffmpeg -i EpicKartJump.mov EpicKartJump.mp4
ffmpeg -i EpicKartJump.mov -vf "setpts=(PTS-STARTPTS)/10" -crf 18 EpicKartJumpFast.mp4
ffmpeg -i video.mp4 -i audio.mp3 -c:v copy -c:a copy output.mp4
Note: the syntax is -i for input file, -c:v copy; for convert video, in this case 'copy' means no stream format conversion, it just copies; -c:a copy; and to convert audio -c:a aac would convert the audio file to aac format.
Example: To remove audio track from mp4 video file
ffmpeg -i input_file.mp4 -an -vcodec copy output_file.mp4
Example (?): To join multiple files into a single file (can be audio or video)
ffmpeg -i "concat:audio1.mp3|audio2.mp3|audio3.mp3" -c copy output.mp3
or
ffmpeg -f concat -safe 0 -i FileList.txt -c copy mergedVideo.mp4
Where FileList.txt contains paths in the local dir, something like:
file 'FirstFileInSequence.mp4'
file 'SecondFileInSequence.mp4'
Example: To speed/timelapse the video
ffmpeg -i input.mp4 -filter:v "setpts=0.5*PTS" output.mp4Example: To slowmo the video
ffmpeg -i input.mp4 -filter:v "setpts=2*PTS" output.mp4
ffmpeg -i intro.mov -vf "boxblur=5:1" intro-blur.mov
Example: ffmpeg can make mp4 smaller by varying the Constant Rate Factor, using:
ffmpeg -i $infile -vcodec libx264 -crf 23 $outfile
Example (best): fmpeg can make mp4 smaller by changing the video screen-size (for example to half its pixel size), using:
ffmpeg -i $infile -vf "scale=iw/2:ih/2" $outfile