Youtube, I’m sending you another “full album”.
The following parameters will use “still_image.png” and merge it with “audio.wav” into the video “audio_and_image-output.mp4”:
$ ffmpeg -loop 1 -framerate 2 -i still_image.png -i audio.wav \ -c:v libx264 -tune stillimage -crf 18 -c:a aac \ -ab 320k -strict -2 -shortest -pix_fmt yuv420p audio_and_image-output.mp4
- “-loop 1”, infinite loop of the image.
- “-framerate 2”, just two FPS (some players may complain and you might need to go higher).
- “-c:v libx264”, convert video to x264.
- “-tune stillimage”, tune the process for a still image.
- “-crf 18”, value for Constant Rate Factor.
- “-c:a aac”, convert audio to AAC.
- “-ab 320k”, use 320Kbps audio.
- “-strict -2”, to allow some of the non standard things we are doing here.
- “-shortest”, finish encoding when the shortest input stream ends.
- “-pix_fmt yuv420p”, use YUV planar color space with 4:2:0 chroma subsampling (needed by some older players)
This requires a single audio file as the source, so if you want to use many audio files (as songs from an album) you will need to concatenate them first - its super easy.
The input audio was a 24/44 WAV and the input PNG had 1080p resolution. These parameters created a video that complied with Youtube’s best practices and was uploaded to that service. Tune the parameters to match your needs.