title: Video with a static image.

h3. A simple video script

The other day, I wanted to prepare some videos of my favorite reggae and soul 
tunes for uploading them to YouTube.
My goal was very simple: prepare a video with the music,
and a static image.

After briefly digging for a simple software to do that,
which I could not find, I said "hey, why not doing it with liquidsoap"?
Well, that is fairly easy!

All you have to do is to prepare a PPN version of the picture, using 
%%
convert /path/to/image.jpeg /path/to/image.ppn 
%%
and have the mp3 or ogg file in an other place...

We also disable synchronization (<code>clock(sync=false,..)</code> 
operator) so that liquidsoap runs as fast as possible,
instead of decoding the music at a normal rate.

Here is the code:

%%(video_static.liq)
 # Log to stdout
 set("log.file",false)
 set("log.stdout",true)
 set("log.level",5)
 # Enable video
 set("frame.video.width",320)
 set("frame.video.height",240)

 audio_file = "/tmp/bla.mp3"
 video_file = "/tmp/bla.ppm"

 # The audio song.
 audio = once(single(audio_file))

 # Create a video source with the image for video track
 video = single(video_file)
 # Disable real-time processing, to process with the maximun speed
 clock(sync=false,video)

 # Mux audio and video
 source = mux_audio(audio=audio,video)

 # Output to a theora file, shutdown on stop
 output.file(%ogg(%vorbis,%theora),
             id="youtube",fallible=true,
             on_stop=shutdown,
             "/tmp/$(title).ogv",
             source)
%%

This should produce on file named @<title>.ogv@ where @<title>@ is the title
metadata of your song.

Inspired from "blog.rastageeks.org":http://blog.rastageeks.org/spip.php?article27.
