Gentoo Wiki


This article is still a Stub. You can help Gentoo-Wiki by expanding it.

This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc


Create a VCD

ffmpeg -i <movie.avi> -target pal-vcd <filename.mpg>

(Note: the -target command requires at least version 0.4.9 of ffmpeg)

Create an SVCD

ffmpeg -i <movie.avi> -target pal-svcd <filename.mpg>

(Note: the -target command requires at least version 0.4.9 of ffmpeg)

Burn CD

Once finished, burn them with K3B which will create the other files necessary:

File > New Project > New Video CD project

Or, instead of using K3B, burn the file to disc as follows -

for SVCD:

vcdimager -t svcd -l "Movie Title" -c <filename>.cue -b <filename>.bin <filename>.mpg
cdrdao write --device <device> <filename>.cue

for VCD:

vcdimager -t vcd2 -l "Movie Title" -c <filename>.cue -b <filename>.bin <filename>.mpg
cdrdao write --device <device> <filename>.cue

Note: Based on your version of ffmpeg, you may need to prepend pal or ntsc to the target argument.

ffmpeg -i <movie.avi> -target ntsc-vcd <filename.mpg>

PROBLEM: How do I split up a big AVI to fit many SVCDs?

Determine the duration of the movie and use the "-ss" start switch and the "-t" time duration switch to chop the source video into portions.

The following splits up a big (2h15 here) avi into three different SVCDs.

ffmpeg -hq -ss 00:00:00 -t 00:45:00 -i <movie.avi> -target svcd ./m1.mpg
ffmpeg -hq -ss 00:45:00 -t 00:45:00 -i <movie.avi> -target svcd ./m2.mpg
ffmpeg -hq -ss 01:30:00 -t 00:45:00 -i <movie.avi> -target svcd ./m3.mpg

Note: the switch -hq might not be working in later builds of ffmpeg (i.e. SVN-r7319)


ffmpeg -i <movie.avi> -target ntsc-vcd <filename.mpg>

the following outputs m1.mpg, m2.mpg and m3.mpg

mpgtx -3 <filename.mpg> -b m

Alternatively, you can use the package avisplit. The command:

avisplit -s 700 -i <file.avi>

Will presplit your avi files into sub-files of 700 megabytes each. The problem with this is that although your split AVIs will each fit on a CD, the output from ffmpeg will likely be much larger and not fit on an 80 minute CD-R. Split the files smaller with avisplit or use the time start/duration time splitting method built into ffmpeg. With this above method (avisplit), you can test the avi files to see if the sound is out of sync. If it is, read the following:

PROBLEM: how do I make a single CD out of multiple AVI files?

While avi files can be concatenated, this is generally not recommended unless they have been produced by splitting a single original avi file. A better option is to generate a multi-track video CD. The procedure is as above, but multiple mpeg files are passed to vcdimager.

For example, to make a video CD out of two files 1.avi and 2.avi, the procedure is:

ffmpeg -i 1.avi -target pal-vcd 1.mpg
ffmpeg -i 2.avi -target pal-vcd 2.mpg

vcdimager -t vcd2 -l "Title" \
-c vcd.cue -b vcd.bin 1.mpg 2.mpg

cdrdao write --device <device> vcd.cue

The device argument is the same as above, that is, that reported by cdrecord -scanbus. The advantage of producing a single multitrack video CD over joining all avi files in a single track is the possibility of easily selecting a track to play.

PROBLEM: How do I keep the sound from being out of sync when splitting into more than one SVCD?

This is due to a differing number of audio and video chunks in the avi file. If you encounter a problem with the audio synching, use:

tcprobe -i <file.avi>

This will show you the number of audio and video packets in the file. Also, it will tell the format of the Audio chunks in the avi file. Look on the third line of the output of tcprobe for format=0xAA, and remember this number.

Once you have that, you can reencode the file using chunks all of the same size to fix the problem. Use:

transcode -i <in.avi> -P1 -N 0xAA -y raw -o <out.avi>

Here, 0xAA is, of course, the number you just found with tcprobe. This conversion will take a little while. Once it is done, you can now use the file out.avi, splitting it up as you wish for your video CD.

PROBLEM: No sound (or just some noise)

The VCD specification requires audio to be stereo. VCDs generated from mono files are played correctly by mplayer, but audio may not work on settopboxes. To solve this problem, ffmpeg converts mono files into stereo files when given the option "-ac 2", which produces an output with two audio channels.

ffmpeg -i <movie>.flv -ac 2 -target pal-vcd <movie>.mpg

This problem is typical of converting flv files to mpg or trying to repair a corrupt mpg file. It may also help to use -ab "audio bitrate".

PROBLEM: How do I retain the letterbox aspect ratio (black bars above and below the frame?)

The recipe above worked beautifully for me, but the original DivX/AVI file was in a widescreen format, and ffmpeg -> SVCD created a disk which filled my TV, meaning it was horizontally squeezed. There must be a setting to ffmpeg to solve this.

Using ffmpeg you can type this command to make VCDs.

ffmpeg -i <file.avi> -target ntsc-vcd -s 352x176 -padtop 32 -padbottom 32 <file.mpg>

This command will pad the top and bottom of a 16:9 AVI and output it to file.mpg

-target "ntsc-vcd", "pal-vcd", "ntsc-svcd", "pal-svcd". This sets other options (e.g. bitrates, codecs) for your chosen output type automatically.
-s, -padtop and -padbottom set the size of the video frame and the black padding at the top and bottom.
The width (352) is always the same. The vertical dimension should add up to 240 for ntsc and 288 for pal

e.g. 176 + 32 + 32 = 240 
     192 + 48 + 48 = 288

Figure out the ratios to keep the aspect ratio correct and keep the padding to multiples of 16.

US widescreen TV coming as:

Stream #0.0, 23.98 fps: Video: mpeg4, yuv420p, 624x352

This worked well:

ffmpeg -i /path/file.avi -target pal-vcd -s 352x192 -padtop 32 -padbottom 32 /path/output.mpg

See also

Retrieved from ""

Last modified: Sun, 28 Sep 2008 06:53:00 +0000 Hits: 42,481