Nice (jankish) way of converting Audio + Image -> Video for youtube

TL;DR: use the script

Manual way

You will need: ffmpeg, mkvtoolnix (gui)

make the cover image into a video stream with ffmpeg -i cover.jpg cover.h264
import both into mkvtoolnix

get the length of the audio in seconds somehow, and put it into the "Default duration/FPS" field of the video

run the mux

this will give you a video file where the video stream is one frame running at like 0.002FPS (or whatever makes it match the duration of the audio), which your video player might not be very pleased with
BUT that doesn't matter because youtube will upconvert it to something more sensible during processing
so just upload the file as normal and there you have it

this method is quite nice because you dont need a video editor or some demanding export process, and the filesize is just the audio + like 500kb for the video frame

Note: you might want to change the cover.jpg ffmpeg command to have better encoding settings, the defaults are a bit rubbish

Automated way

This is the same method as above^, but scripted. It only takes like 2 seconds to run :)

You will need: ffmpeg, ffprobe, mkvmerge (all command line)

this specific script will only work on linux, mac, etc but should be pretty easy to adapt to powershell etc on windows
use like ./ytvid.sh audio.flac cover.jpg

#!/bin/sh
# convert audio + image to a video file for posting on youtube etc
# usage: ./ytvid.sh audio.flac cover.jpg
# requires: ffmpeg, ffprobe, mkvmerge
# this way is quite nice because you dont need some demanding video rendering process
# and the filesize is just the audio + like 500kb for the video frame

audio=$1
image=$2

audio_duration=$(ffprobe -v error\
	-show_entries format=duration\
	-of default=noprint_wrappers=1:nokey=1\
	"${audio}")

ffmpeg -i "${image}" "${image}.h264" -y

mkvmerge --default-duration 0:"${audio_duration}s" "${image}.h264" "${audio}" --output "${audio}.mkv"

You could probably make this handle missing arguments better than just, ploughing along anyway
but it works :)

-garret1317, June 2025