Because I want to upload audio files to YouTube.
To do that, I must first convert audio files into a format that will work on YouTube, and I want to do that through the GNU/Linux command-line.
This bash shell wrapper script will take an audio file as input and output a video file ready for upload to YouTube (e.g. via the command-line script youtube-upload).
The audio quality remains mostly unchanged; therefore, the output file will be slightly bigger than the input file.
Example commands listed below are based on the latest Ubuntu LTS version.
sudo apt-get update && sudo apt-get install sed imagemagick ffmpegwget -qO- "https://github.com/izkreny/EncodeForYouTube/archive/refs/heads/master.tar.gz" | tar -xz -C ~/.local/optCreate a symbolic link to encode4yt.sh in a directory that is already in your PATH, e.g.:
ln -s ~/.local/opt/EncodeForYouTube-master/encode4yt.sh ~/.local/bin/encode4ytencode4yt INPUT [IMAGE]The output file will be written in the same directory where the INPUT file is located and will have an identical name, just with an mov extension.
You can provide the path to an IMAGE as a second argument, which will be used as the video background. The default IMAGE size is 3840x2160 pixels (4K).
This script is based on various sources from the internet, mostly from: