Wednesday, 21 March 2012

Create a movie for youtube on Ubuntu - tutorial


- You're on Ubuntu or similar linux.
- You need to create a movie (e.g. for youtube) and you have:
-- some avis from your camera, (some should be 90degrees rotated as they have been filmed wrong)
-- jpegs from you computer (or screen captures)
-- a mp3 track to add on some parts of it (slideshow like)

- You need to add subtitles and some fading effects.

How I did it

- I decided to have the resulting film in m-jpeg video codec format and AC3 audio codec. I had 640x480 30fps avis from my camera, audio: mono, 8KHz. Your data might differ, what's important is to have all parts with the same parameteres before joining them together.

- To cut the interesting parts from your .avi you can use Avidemux and in this operation you can convert them to m-jpeg/ac3 format.

- To rotate the movie you can use avidemux -> video filters -> Transform -> Rotate.

- To add some fading effects you can use avidemux -> video filters -> transform filter -> fade in/out. I added 40 frames of fading to black to each avi, after cropping it to the relevant part, at the end of it.

- To make a movie (slideshow like) starting from some static images on your screen and some recorded mp3 track:
-- record your voice if needed, using Voice Recorder. I had troubles with mp3s embeded in the avi so I converted the mp3 to wav, 8KHz, mono, using Sound Converter. Write down how many seconds of audio you have.
-- use Shutter to capture your text/image of interest on screen.
-- use Gimp to adjust it to a 640x480 jpeg (or same as your avi-s). Then open the jpeg in Avidemux, set the movie fps to the same as the real avis (30fps in my case) and this jpeg becomes frame number one.
-- copy paste this frame as much as you want to fill the frames toward the total seconds of your wav. If you need to add more images, split the number of seconds in convenient parts and do copy paste as many times as needed to "cover" only that allocated share of seconds. At a 30 fps you need 1 copy and 30 paste to fill one second. The problem is that avidemux crashes at many copy paste operations, so I did cover only one second, saved it, then reopened the 1 second movie and appended it to itself 10 times for a 10 seconds slideshow of one image.
-- after building the all the static video parts for the slideshow, append them together to form the whole avi that makes the slideshow. It's length should be few miliseconds more than the number of seconds of your audio (you wrote it down earlier).
-- If you want to add a fade effect on the slideshow avi too, do it as described above.
-- save it by converting audio/video to the codecs you want (same as rest of the avis)

- Append all the prepared avi (and the slideshow avi) in the desired order using avidemux. Remember that all parts should have exactly the same characteristics in terms of video codec and audio codec as to have the whole working ok. Check that the movie can be seen and heard properly in VLC media player (for example).

- All you need now is subtitles:
-- Create the subtitle by using Gnome Subtitle, by looking at the movie, pausing it, adding text for a subtitle, again and again. This makes a very rough subtitle file with subtitles inexactly positioned. Ssave it as .srt.
-- After finishing introducing all text, it should be taken again from the beginning and by listening the voice and/or watching the movie, the subtitles time positioning should be established more accurately. For this you can use the 2 small buttons left to the movie window and under "time" and "length" indicators. When a subtitle is selected (and the movie plays) the left button if clicked establishes the beginning of its appearance, and the right one establishes the end of its appearance on the screen.
-- If during play in Gnome Subtitles some subtitles don't seem to diplay, check it is not an overlapping between that one and it's neighbors and redo start/end for each involved in this.
-- Save the subtitle after you're happy with its sync status with the movie/audio.
-- Open avidemux one more time and use Video filters->Subtitlers->Subtitlers to add the .srt. Choose a font too as without it is not doing it and ignores you silently (I choose a ttf found on disc: DejVueCondensedOblique.ttf but you can chooshe whatever).
-- save again the movie and you're done.

Not easy but fun I'd say...

Here is my result:

No comments:

Post a Comment