Recently my students commented on the fact that no one really listens to podcasts anymore BUT that everyone has access to YT. Consequently, I was persuaded to posting my lectures online through YT (yikes!).


How Did I Convert Audio to Video for YouTube?

Originally, I used the audio and created a title page in Kdenlive. The problem is that, since “Kdenlive lies at the intersection of ffmpeg and the mlt package”, efficiency isn’t always key. In fact, an hour was often expended to convert audio to video. That seemed kind of long to me.

At, I found a wonderful link. Nestled in the page, through several other pieces of advice was the command

ffmpeg -loop 1 -r ntsc -i image.jpg -i song.mp3 -c:a copy -c:v libx264 -preset fast -threads 0 -shortest

This did not immediately work for me. I had to change the command “ffmpeg” to “avconv” (I’m running Ubuntu Linux which has gone with the avconv project). The results are

avconv -i
avconv version 0.8.5-6:0.8.5-0ubuntu0.12.10.1, Copyright (c) 2000-2012 the Libav developers
built on Jan 24 2013 14:49:20 with gcc 4.7.2
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '':
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf53.21.1
Duration: 00:48:11.08, start: 0.000000, bitrate: 41 kb/s
Stream #0.0(eng): Video: h264 (Main), yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 23 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc
Stream #0.1(eng): Audio: wmav2, 22050 Hz, 1 channels, s16, 16 kb/s

Well, it worked! So, I nestled that chunk of code into a BASH shell script and now use it quite a bit. I might add, however, that anyone using the HTML5 trial of YouTube may have trouble with this technique (in Firefox). I did not have any troubles in Chrome.

Updates [ 3/7/2013]: Some useful links include



Note that I also ended up changing both the audio codec to libvorbis and the video codec to libvpx in order to render the file to .webm. I did this because the videos I had produced using the techniques described above did not pass the audio through to the video. Some tinkering with codecs got this working solution.

Convert Audio to Video for YouTube
Tagged on: