[MEncoder-users] How to encode a DVD

Jorge Peixoto de Morais Neto please.no.spam.here at gmail.com
Thu Jun 7 00:17:14 CEST 2007


> > > than next time my girlfriend asks me to make her a movie I will
> > > make a SVCD.
> > 
> > With SVCD, you're limited to a lower resolution, and CDs have a much
> > smaller capacity, requiring you either use rather low quality, or
> > split across multiple discs.
> Provided the image isn't too ugly, she will not mind. The
> only way I will ever know if the image is ugly is if I test it.
I have encoded the movie to SVCD, with the line 

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts
format=xsvcd:tele_src=24000/1001:tele_dest=30000/1001 -vf
scale=480:336,expand=480:480,harddup -srate 44100 -af
lavcresample=44100 -lavcopts
vcodec=mpeg2video:keyint=18:vrc_buf_size=917:vbitrate=950:vrc_maxrate=2500:acodec=mp2:abitrate=128:dia=4:predia=4:trell:mbd=2:precmp=2:cmp=2:subcmp=2:vpass=1
-o opaios.mpg opaio.avi

then 


mencoder -oac lavc -ovc lavc -of mpeg -mpegopts
format=xsvcd:tele_src=24000/1001:tele_dest=30000/1001 -vf
scale=480:336,expand=480:480,harddup -srate 44100 -af
lavcresample=44100 -lavcopts
vcodec=mpeg2video:keyint=18:vrc_buf_size=917:vbitrate=985:vrc_maxrate=2500:acodec=mp2:abitrate=128:dia=4:predia=4:trell:mbd=2:precmp=2:cmp=2:subcmp=2:vpass=2
-o opaios2.mpg opaio.avi

In the second pass I used the same options except for vpass and for
the vbitrate. I was calculating bitrate for 700 MB but then I learned
that a SVCD can hold 800 MB. 

The image quality is borderline acceptable. 

But there is an audio delay on mplayer; ffplay plays the movie fine

1) How can I solve this?
2) When doing multipass encoding, is it a problem to change options
(like the slight change in bitrate I did)?
3) What is recommended for having a good quality sound encoding with
mp2 codec? The mplayer web page says that libavcodec's mp2 is no match
for twolame. But I don't see an option in twolame to resample to 44100
Hz. If I output PCM, resample with sox, than compress with twolame,
will I get good quality?

4)When I tried to use vcdimager, I got this:

++ WARN: initializing libvcd 0.7.23 [linux-gnu/i686]
++ WARN:  
++ WARN:  this is the Beta development branch!
++ WARN:  use only if you know what you are doing
++ WARN:  see http://www.hvrlab.org/~hvr/vcdimager/ for more information
++ WARN:  
++ WARN: mpeg stream contained no scan information (user) data
++ WARN: generated image (358883 sectors [79:45:08]) may not fit on
74min CDRs (333000 sectors) finished ok, image created with 358883
sectors [79:45:08] (844092816 bytes)

The resulting bin file was 805 MB.
I have diminished the bitrate a little bit and I'm encoding again. 
What concerns me is this:
"++ WARN: mpeg stream contained no scan information (user) data"


Some more information: when I try to play opaios2.mpg in mplayer, I get
an audio delay and mplayer outputs this:

MPlayer dev-SVN-r22984 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) XP 2600+ (Family: 6, Model: 8, Stepping: 1)
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE
112 audio & 233 video codecs

Playing opaios2.mpg.
MPEG-PS file format detected.
VIDEO:  MPEG2  480x480  (aspect 1)  29.970 fps  2500.0 kbps (312.5
kbyte/s)
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo
config request - 480 x 480 (preferred colorspace: Mpeg PES) Could not
find matching colorspace - retrying with -vf scale... Opening video
filter: [scale] The selected video_out device is incompatible with this
codec. Try appending the scale filter to your filter list,
e.g. -vf spp,scale instead of -vf spp.
VDecoder init failed :(
Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder
libmpeg2-v0.4.0b Selected video codec: [mpeg12] vfm: libmpeg2 (MPEG-1
or 2 (libmpeg2))
==========================================================================
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 44100 Hz,
2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400) Selected audio
codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample) Starting playback...
VDec: vo config request - 480 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.00:1 - prescaling to correct movie aspect.
VO: [xv] 480x480 => 480x480 Planar YV12 
A:   0.3 V:   0.3 A-V:  0.058 ct:  0.003   3/  2 ??% ??% ??,?% 0 0 
demux_mpg: 24000/1001fps progressive NTSC content detected, switching
framerate. A:   0.5 V:   0.4 A-V:  0.135 ct:  0.019   9/
6 ??% ??% ??,?% 0 0 demux_mpg: 30000/1001fps NTSC content detected,
switching framerate. Warning! FPS changed 23.976 -> 29.970  (-5.994005)
[4]   ??,?% 0 0 A:   3.9 V:   3.1 A-V:  0.781 ct:  0.224 115/ 67  3%
1%  1.3% 0 0 Exiting... (Quit)

-- 
Software is like sex: it is better when it is free. --Linus Torvalds



More information about the MEncoder-users mailing list