disposition:s:0 default means set the first subtitles track as default. See also Set a subtitle language using ffmpeg on Stackoverflow. The first s: is to access all streams, the second s: is to access all subtitles streams (and then obviously 0 is the index of the first and only stream in my case). metadata:s:s:0 language=eng means add a metadata that says the first subtitles track (numbered 0) is in English. To read more about changing the number of audio channels, see Manipulating audio channels with ffmpeg on the FFmpeg wiki I use this to get a smaller audio compression, obviously you don’t have to if you want to keep 5.1 or something. To read more about scaling, see Scaling (resizing) with ffmpeg on the FFmpeg wiki. I picked those values for the example, you’ll probably want to set yours quite higher, except for testing where a tiny resolution with an ultrafast preset helps save time. You can also set only the height or the width, and set the other one to “-1” so that FFmpeg will set it to the proper value to keep the original ratio. vf scale=400:300 means rescale the video to 400 px width x 300 px height. i "inputvideo.avi" is our input file… not much to say about this. Here is what the command looks like without the bash loop, with this time an AVI video as input:įfmpeg -i "inputvideo.avi" -vf scale=400:300 -ac 2 -metadata:s:s:0 language=eng -disposition:s:0 default -codec:a libopus -b:a 48k -vbr on -compression_level 10 -frame_duration 60 -application audio -codec:v libx265 -preset veryfast -x265-params crf=23 -codec:s copy "outputvideo.mkv" do part and the %%A thing are for Windows bash: I look for all files in the current folder named (something).mkv, I process them and I put the output file into an “out” subfolder, keeping the filename intact. Without further ado, here is the command I now use (detailed explanations follow):įor %%A in (*.mkv) do ffmpeg -i "%%A" -vf scale=400:300 -ac 2 -metadata:s:s:0 language=eng -disposition:s:0 default -codec:a libopus -b:a 48k -vbr on -compression_level 10 -frame_duration 60 -application audio -codec:v libx265 -preset veryfast -x265-params crf=23 -codec:s copy "out/%%A" That steep learning curve is what prevented me from using it until now, but I eventually went ahead and took the time to figure out all I needed to. Its only but big weakness is that it doesn’t have a GUI and I find the documentation a bit lacking. So I looked for another solution, and eventually settled for FFmpeg.įFmpeg is a well-known media encoding software, with support for more than 100 codecs, which are very regularly updated to their current version. However, they lack Opus support and tend to be slow to upgrade the included x265 library, even in their nightly builds. So far, I’ve mainly used handbrake to encode into x265 (that’s more or less the same thing as HEVC, more specifically HEVC or H.265 is the current kickass video standard, and x265 is one of the main – and best – HEVC encoders), because I don’t encode much and their GUI is comfortable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |