-
Notifications
You must be signed in to change notification settings - Fork 11
ffmpeg
Tips and tricks for ffmpeg:
Subtitling requires the addition of the libass library
by default ffmpeg doesn't come with this library but if you follow these steps it should work:
In a terminal type the folowing:
brew uninstall ffmpeg
(edited)
this will uninstall your current version of ffmpeg
then re-install it using a special "tap":
brew tap justinmayer/tap
brew tap-pin justinmayer/tap
brew install ffmpeg --with-aom --with-chromaprint --with-fdk-aac --with-libass --with-srt
Once homebrew finishes re-installing ffmpeg, you can test that subtitles work with an srt file. I've had good experience with finding srt files to download here: https://www.podnapisi.net/
podnapisi.net
Podnapisi.NET
Search through our huge collection of subtitles.
and the ffmpeg command is:
ffmpeg -i input.mov -vf subtitles=my_subtitle_fle.srt output_w_titles.mov
podnapisi.net Podnapisi.NET Search through our huge collection of subtitles.
Having trouble getting your video to size properly? Unable to concatenate a bunch of videos together, but can't find the problem? Look no further than the pixel aspect ratio! In digital video, there are frame aspect ratio (commonly 16:9, 4:3, etc.) and pixel aspect ratio (square, or anamorphic pixels). Generally speaking, when using ffmpeg to program video editing, you'll want your pixel shapes to be square, not anamorphic. If you're using older video digitized from Television formatting in the US (NTSC), or UK/Europe (PAL) you'll likely encounter non-square pixels. Here is one ffmpeg filter to force your video to square pixels:
-vf "scale=360*sar:ih,setsar=1,crop=320:240"
We first use the scale filter, then introduce the sar variable. We make sure that our sar (sample aspect ratio) is square. After scaling the video to its square pixel configuration, we then crop off any additional pixels to resize the video frame to exactly 320x240.
Here are some additional scaling, cropping, and aspect ratio resources: