Convert to webm
- Install the main tool by
$ sudo apt install ffmpeg
- Create new file by
$ touch encode_to_webm.sh
with the content below:
#!/bin/bash
if [ $# -eq 3 ]
then
ffmpeg -y -i $1 -c:v libvpx-vp9 -pass 1 -b:v $3 -threads 1 -speed 4 -g 9999 -aq-mode 0 -an -f webm /dev/null && \
ffmpeg -i $1 -c:v libvpx-vp9 -pass 2 -b:v $3 -threads 1 -speed 0 -auto-alt-ref 1 -lag-in-frames 25 -g 9999 -aq-mode 0 -an -f webm $2
else
echo "Используйте три аргумента:"
echo $0 "<файл_источник>" "<выходной файл>" "<битрейт>"
echo
echo "Пример:"
echo $0 "file.mp4" "file.webm" "500K"
fi
- So, you can use this file like this:
bash ./encode_to_webm.sh [input file name] [output file name] [bitrate]
For example:
bash ./encode_to_webm.sh file.mp4 file.webm 500K
And also try this if necessary:
chmod +x encode_to_webm.sh
Other formats
For everything else there is a HandBrake.