Tag: add
How to add sound/audio to a video on Linux
by Lennart on Jun.20, 2009, under *NIX
I am planning to create a ScopePort screencast soon. I had no experience with screencasts when I started to work on that topic. This is why I encountered two main problems:
- How do I create the video?
- How do I add sound to that video?
The first problem was solved easily. I tried a few screen recorders and decided to use recordmydesktop. The main advantage of recordmydesktop is that it captures everything in a raw mode and encodes it when you stop recording. That makes it possible to record your screen without bigger speed problems. Everything looks pretty smooth and is usable for a screencast.
The second problem cost me a lot of Google searching. How can I add sound to that video? Here is the way I finally used:
First step: Capture the video
No Problem. I started recordmydesktop with the following parameters to capture only the first screen, with a fake cursor (the original one from KDE4 caused some problems) and with no sound. The sleep 3 before the execution of recordmydesktop gives me some time to close the shell and get ready to record.
sleep 3 && recordmydesktop -width 1680 -height 1050 -dummy-cursor black --no-sound
Second step: Convert the captured video to AVI
The file recordmydesktop creates is in a OGG format. That is usually fine but we require an AVI file to add the sound. I converted the OGG file to AVI with mencoder (Usually available in your favorite repository):
mencoder -idx screencast.ogg -ovc lavc -oac mp3lame -o screencast.avi
Third and last step: Add the audio
Now we can edit the video file with avidemux (also usually available in your repositories). Select “Audio” -> “Main Track”.
Now select a AC3, MP3 or WAV file that should be added as the main audio track. Press okay, select “File” -> “Save” -> “Save video” and you are done. That’s it.
How to add a value to a select field in Ruby On Rails
by Lennart on Nov.15, 2008, under Ruby On Rails
I’ll just leave this here: When you fill a select box directly from a array returned by .find(:all) you can add more values tothe select box this way:
Controller:
@hosts = Host.find(:all).collect {|p| [p.name, p.id] }
@hosts << ["None", nil]
View:
<dd>
<%= f.select :linkedhost, @hosts %>
<%= error_message_on(:service, :linkedhost) %>
</dd>


