[MPlayer-users] Encoding movie results in 'jerky' .avi

Beau E. Cox beaucox at hawaii.rr.com
Sun Feb 26 23:19:12 CET 2006


On Saturday 25 February 2006 23:39, Guillaume POIRIER wrote:
> Hi,
>
> On 2/26/06, Beau E. Cox <beaucox at hawaii.rr.com> wrote:
> > Hi -
[[snip]]
> > I am trying to encode a dvd movie (which plays perfectly
> > from the dvd using mplayer) -> .avi. I followed
> > the instructions in the encoding example:
> > http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html#menc-feat-dvd-mp
> >eg4-example
> >
> > My movie is NTSC progressive with the same crop size
> > as in the example, so I used the example parameters
> > _exactly_. During encoding I got many, many
>
> Damn! The example is completely bogus! There's no inverse telecine
> filter in the example when the text says that it's telecined.
>
> I just fixed the doc, but the revised version won't show up online
> before 12-24h.
> So here is the good example:
>
> pass1:
> mencoder dvd://1 -ofps 24000/1001 -oac copy -vf
> pullup,softskip,crop=720:352:0:62,hqdn3d=2:1:2 -ovc lavc -lavcopts
> vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:mbcmp=3:autoaspe
>ct:vpass=1 -o Harry_Potter_2.avi
>
> pass2:
> mencoder dvd://1 -ofps 24000/1001 -oac copy -vf
> pullup,softskip,crop=720:352:0:62,hqdn3d=2:1:2 -ovc lavc -lavcopts
> vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:mbcmp=3:autoaspe
>ct:vpass=2 -o Harry_Potter_2.avi
>
> Guillaume
> --
> Reinventing the wheel certainly is annoying, but as long as all other
> wheels are square...
>
> Reimar Döffinger

Hi Reimar - thanks for the reply.

Alas, I got the same results with your parameters; here is the
script (dvd2avi) I used to encode:

#!/bin/sh

encode()
{
    mencoder \
	${vin} \
	-ofps 24000/1001 -oac copy -vf \
	pullup,softskip,crop=720:352:0:62,hqdn3d=2:1:2 -ovc lavc -lavcopts \
	
vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:mbcmp=3:autoaspect:vpass=${1} 
\
	-o ${vout}
}

name=tdat
vin=${name}.vob
vout=${name}.avi

encode 1      &&
encode 2      &&
ls -l ${vout} &&
echo Success.

Still lots of skipped/dumplicate frames and 'jerky' playback.
Here is the top of the mplayer playback from the source -
which plays perfectly:

$ mplayer tdat.vob
MPlayer 1.0pre7try2-3.4.4 (C) 2000-2005 MPlayer Team
CPU: Intel  (Family: 8, Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

Playing tdat.vob.
MPEG-PS file format detected.
VIDEO:  MPEG2  720x480  (aspect 3)  29.970 fps  9800.0 kbps (1225.0 kbyte/s)
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Stream with high frequencies VQ coding
AUDIO: 48000 Hz, 2 ch, s16le, 768.0 kbit/50.00% (ratio: 96000->192000)
Selected audio codec: [ffdts] afm:ffmpeg (DTS)
==========================================================================
vo: X11 running at 1024x768 with depth 24 and 32 bpp (":1.0" => local display)
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 480 (preferred csp: 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.
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))
==========================================================================
Checking audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...
AF_pre: 48000Hz/2ch/s16le
alsa-init: 1 soundcard found, using: default
alsa: 48000 Hz/2 channels/4 bpf/65536 bytes buffer/Signed 16 bit Little Endian
AO: [alsa] 48000Hz 2ch s16le (2 bps)
Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le...
Starting playback...
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [xv] 720x480 => 854x480 Planar YV12 
A:   0.6 V:   0.0 A-V:  0.522 ct:  0.000   1/  1 ??% ??% ??,?% 1 0
[[snip]]
demux_mpg: 24000/1001fps progressive NTSC content detected, switching 
framerate.
[[snip]]
...

Here is the top of the encoding using my script:

$ ./dvd2avi
MEncoder 1.0pre7try2-3.4.4 (C) 2000-2005 MPlayer Team
CPU: Intel  (Family: 8, Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

File not found: 'frameno.avi'
Failed to open frameno.avi
success: format: 0  data: 0x0 - 0x5f5e100
MPEG-PS file format detected.
VIDEO:  MPEG2  720x480  (aspect 3)  29.970 fps  9800.0 kbps (1225.0 kbyte/s)
[V] filefmt:2  fourcc:0x10000002  size:720x480  fps:29.97  ftime:=0.0334
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
Stream with high frequencies VQ coding
AUDIO: 48000 Hz, 2 ch, s16le, 768.0 kbit/50.00% (ratio: 96000->192000)
Selected audio codec: [ffdts] afm:ffmpeg (DTS)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [hqdn3d=2:1:2]
Opening video filter: [crop w=720 h=352 x=0 y=62]
Crop: 720 x 352, 0 ; 62
Opening video filter: [softskip]
Opening video filter: [pullup]
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 480 (preferred csp: 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.
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))
==========================================================================
audiocodec: framecopy (format=2001 chans=2 rate=48000 bits=16 bps=96000 
sample-1)
Writing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp 
header.
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
videocodec: libavcodec (720x352 fourcc=34504d46 [FMP4])
High quality encoding selected (non real time)!
Pos:   0.0s      1f ( 0%)   0fps Trem:   0min  25mb  A-V:0.000 [0:0]
1 duplicate frame(s)!
[[snip]]
Pos:  27.5s    674f (26%)  18fps Trem:   1min  24mb  A-V:0.031 [1192:768]
1 duplicate frame(s)!
[[snip]]
...

I guess I'll start trying to understand dvds and mplayer - rather
that just copy examples; meanwhile, your tips are welcome :)

-- 
Aloha => Beau;





More information about the MPlayer-users mailing list