Log in

View Full Version : yet another SVCD Script


7bit
16th January 2008, 18:16
After searching for an easy way to produce SVCD on Linux and trying out a few of the available scripts based on transcode or mencoder I finally ended up writing my own automated svcd encoding script, because none of the existing ones fitted exactly my needs, and I am willing to share it with the community.

Current Version:
http://prof7test.googlecode.com/svn/trunk/mpeg/svcd.py

This script will take as input everything mplayer can play, calculate the bitrate to fit it exactly on an 80-Minute CD-R (can of course be configured for other sizes), scale and expand to letterboxed SVCD and will do a 2-pass encode with mencoder/lavc/twolame, optimized for maximum quality. (Letterboxed because I only have an old 4:3 CRT TV set)

The script is originally intended to be used in PAL-Land. If material with 24fps is detected it does a PAL-speedup (but it does not try to do a pullup from NTSC to PAL. If it is fed with 30000/1001 material it will encode it as it is and switch resolution to 480x480)

If you are on windows, you can install mplayer/mencoder for windows (in your path) and python 2.5 and the script should run on windows just as good as it does on linux.

Just call the script with the filename of the movie as argument and it will encode it and put the mpeg in the same directory.

Blue_MiSfit
17th January 2008, 01:55
Good deal! But who really uses SVCDs anymore?

I don't want to be a killjoy or anything - it's always great to have more up-to-date software, but the insanely low price of DVD burners and blank DVDs makes SVCDs redundant - at least here in the U.S.

The situation may be different elsewhere?

~MiSfit

7bit
17th January 2008, 14:39
Good deal! But who really uses SVCDs anymore?

I'm sure there are still some people besides me who still use SVCD. The main reason I wrote the script is: I needed it and this really seems to be the first and only SVCD-script for Linux that actually *works*. (at least for me, because I'm a perfectionist)

;-)

Bernd

Blue_MiSfit
17th January 2008, 17:48
Cool! Well done!

Darksoul71
18th January 2008, 06:52
@7bit:
Cool, thanks for sharing this !
I´m currently not at linux but this little python gem allows
me to do quick adaptions to produce kDVDs under Linux :)

@MiSfit:
If you take a closer look to the script and have some
coding knowledge you´ll find out that it´s pretty easy to
adopt it for your needs (e.g. producing Half D1 kDVDs).

Best regards,
D$

Darksoul71
19th January 2008, 10:14
@7Bit:
From what I´ve seen the script doesn´t take the pixel aspect ration of the source into account when calculating the movie aspect ratio, right ?

Do you only use square pixel sources ?

The results though are really nice. I did two one movie KSVCDs (one CD movies) and found the results at leat on par with QuEnc.

7bit
19th January 2008, 23:05
@7Bit:
From what I´ve seen the script doesn´t take the pixel aspect ration of the source into account when calculating the movie aspect ratio, right ?

Do you only use square pixel sources ?


First it tries to use the output of mplayer -identify to determine the value if ID_VIDEO_ASPECT. I think this should be the overall aspect ratio of the movie. If mplayer says: ID_VIDEO_ASPECT=0 the script will calculate it based on the assumption of square pixels.


os.system ('mplayer %s -vo null -ao null -frames 0 -identify "%s" > movie.info' % (dvd_device, filename))
info = open("movie.info").read().split("\n")

#[...]

for line in info:
try:
a,b = line.split("=")

#[...]

if a == "ID_VIDEO_ASPECT":
movie_aspect = float(b)

#[...]

try:
if movie_aspect == 0:
movie_aspect = float(movie_width) / movie_height


Bernd