| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
|
By JoeDuncan at 2004-09-04 17:56
|
|
First of all you will need the following tools:
avidemux http://fixounet.free.fr/avidemux/ which is the VirtualDub equivalent in Linux
mjpegtools http://mjpeg.sourceforge.net/ which will actually split the files for you (it splits mpegs... but I'm getting ahead of myself...)
vcdimager http://www.gnu.org/software/vcdimager/vcdimager.html which will prepare the VCD/SVCD images for you and last but not least:
cdrdao http://cdrdao.sourceforge.net/ which will actually burn the CDs.
I have used this setup for awhile and it works beautifully for me. All of these pieces of software should be available as a binary package for your distribution.
Ok, the first thing you have to know is that (S)VCDs are MPEGs, not AVIs, so you have to convert from AVI to MPEG. This is where Avidemux comes in. You use it to save the audio and video into different streams (demultiplex) of the proper format to merge (multiplex) back in to an MPEG.
So, open Avidemux (I use version 2.0.24 so yours may be a bit different) and load your avi file (File->Open or the "Open" button on the toolbar).
Then click on the "Video Filter" button on the left.
In the "Video Filters" box, select either "SVCD res" or "VCD res" depending on which one you are going to make (I have found that a 700 mb avi splits almost evenly across 2 SVCDs).
Then click close.
Now click on the "Video Codex" button on the left toolbar. Select either "SVCD" or "VCD" for your codec and click "OK"
Then click on the "Video Process" button, this will tell Avidemux to only process the video.
Now click on "File->Save->Save Video" and enter "filename.m1v" for the file name to save as. Now sit back and wait, as this usually takes 2-3 hours on my P3 1.4 GHz machine (your mileage may vary - I usually do this part overnight)...
Ok, that takes care of splitting off (demultiplexing) the video. Now for the audio...
The first thing you want to do is to click on the "Info" button on the toolbar and then select the "audio" tab in the info box. If it says "variable" or "VBR" in there anywhere, then your AVI file is using variable bit rate audio, and you will need to build a timemap or you will have audio sync problems.. but don't worry, building a time map is easy, just select "Audio->Build VBR Time map". That will usually take about 10 minutes... Also take a note of the frequency of the audio.
Next, click on "Audio Filter" in the left toolbar. Select "Normalize" (to adjust the volume to a standard level) and then either no resampling, "44.1 to 48 kHz resampling" (usually this one as most AVIs are in 48000 hz frequency, or if your audio is already in 44100 or 48000hz frequency, enter "44100" in the "Resample to hz" box. Then click OK.
Ok, now click on "Audio Codec" on the left toolbar.
Select "FFmpeg mpeg audio" as your codec and then click "Configure"
Select a bit rate of 224kbits/second and stereo sound and click OK twice.
Now, click "Audio Process" on the left toolbar (to tell Avidemux to only process audio).
Then select "Audio->Save Audio" and enter "filename.mp2" as your audio stream file name and click ok. This will approx 30 minutes (again on my P3 1.4 GHz...)
Ok, now we have split our file we need to recreate the video as an mpeg. Close Avidemux and open up a console.
In the console (make sure you are in the right directory) type this:
mplex -S 790 -f 4 -o filename.mpg filename.m1v filename.mp2
What this says is to remultiplex your two streams into filetype 4 (-f 4) which is SVCD, with output file (-o) called "filename.mpg". The "-S 790" tells it to split the created MPEG into files that will each fit on a CD. (-S means size, although I'm not sure what the units are, it's not megabytes, but 790 fits perfectly onto one standard blank CD). IIRC it adds a "1" or "2" or "3" after the filename if it has to split them...
(-f 1 will tell it to make VCDs)
This should only take about 5 minutes.
Now, once you have your completed MPEGs, test them with your favorite video viewer. All should be well. If the audio is slightly out of sync, this can be corrected by deleting the audio track and recreating it with Avidemux, but using the "Time shift" filter option to shift the audio X milliseconds, then remultiplexing.
Ok, now you have your MPEG videos, you need to burn them to CD. So create the (S)VCD image like so (you will have to do them one at a time if your file has been split):
vcdimager -t svcd filename.mpg
This will create a file called "videocd.cue" which is the (S)VCD image. (Use "-t vcd20" to create VCDs).
Then you can burn your image like so:
cdrdao write --device /dev/scd0 videocd.cue
Now your SCSI dev file for your burner may be different, just sub yours in. Also, you may need to make your regular user part of your distros "CDRW" (or equivalent) user group in order to access the writer properly.
That should do it. Also, note that Avidemux can be called entirely from the command line (see their website for the appropriate switches for all the functions mentioned above) which should allow you to create a completely automated script to do all of this for you.
Avidemux is an awesome tool, it will also let you edit the AVIs themselves (remove bad frames, append videos etc...)
Good luck!
|
|
|
|
All times are GMT -5. The time now is 03:01 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|
Does any other tool work at all for making vcds? I've been lookingon freshmeat and searching here. Nothing seems to work properly.
But i would definetly upgrade mjpegtools in my distro before going any further if i were you.
The linux "split" command can split mpegs retaining all ability to play the files and seek in the file. Inspite of this, I must warn you that it may not work.
Lets assume you have a movie that is divided into the following files:
1) part1.mpg size: 800MB
2) part2.mpg size: 200MB
Now you wish to burn these on 700MB CDs.
Use the following command:
After executing this command, you will find two files named xaa and xab. Rename these to your choice, say part1-1.mpg and part1-2.mpg. Test them out and see if they work.
You can burn the first CD of 690MB with ease using vcdimager. The second CD, however must be burnt with two files, namely part1-2.mpg and part2.mpg. I have never been able to do this in linux. I burn the CDs with more than one video files in windoze using nero.
You can wine nero, or if anyone know a method of burning these in linux, then please post it here.
Maybe you can use k3b, but I have never been able to use k3b for burning VCDs
To add many MPEG files on the same Video CD, just have to add them on the command line:
% vcdimager -t vcd2 -c image.cue -b image.bin file1.mpg file2.mpg file3.mpg
http://www.bsdnews.org/01/vcd.php
Then just burn image.bin with k3b or whatever else.
But i doubt that the split command splits the mpegs properly though...you would better be off using this tool for svcd's:
http://mpgtx.sourceforge.net/
Please fix this to help save hair.
as in:
cat firstfile.mpg secondfile.mpg > totalfile.mpg
This command merges the files again and it hasn given me any problem yet and it impssible to se where the vido was split before
Hope this helps