PDA

View Full Version : mencoder has a problem with -af resample filter or mp3lame engine


DarkZell666
11th October 2006, 13:51
On one of my systems (Intel P4 2Ghz, WinXP pro XP1), mencoder will stall under certain conditions.

Let's say srate is the value of the -srate parameter, and afsrate the srate value for the resample audio filter (-af resample:afsrate:sloppy>:type)

If input samplerate is 48000hz, and afsrate=44100 and type!=0, the mencoder window will look like this :

MEncoder dev-SVN-r19668-4.0.3 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (Family: 15, Model: 2, Stepping: 9)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2
93 audio & 211 video codecs
Setting process priority: belownormal
success: format: 0 data: 0x0 - 0xb806800
AVI file format detected.
VIDEO: [XVID] 640x480 24bpp 30.000 fps 892.8 kbps (109.0 kbyte/s)
[V] filefmt:3 fourcc:0x44495658 size:640x480 fps:30.00 ftime:=0.0333
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [scale]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm: ffmpeg (FFmpeg MPEG-4)
==========================================================================

and stay like this for eternity =)


Here is the complete command-line which doesn't work on the mentionned system :
"D:\Progz\mencoder264\MEncoder.exe" -sws 9 -vf scale -srate 44100 -af resample=44100:1:2 -ovc x264 -x264encopts frameref=6:bframes=3:me=3:subq=7:brdo:deblock:deblockalpha=0:deblockbeta=0:bime:b_adapt:cabac:b_pyramid:weight_b:mixed_refs:chroma_me:trellis=1:i4x4:i8x8:8x8mv:b8x8mv:4x4mv:8x8dct:nopsnr:crf=18 -oac mp3lame -lameopts cbr:br=96:aq=0 -noskip -priority belownormal -of avi -o "D:\bleachopening.x264.avi" "D:\bleachopening.avi"

A couple of different settings that work are :
- changing afsrate to 48000hz, or 32000hz (and below, 'coz 44100 won't work)
- changing type to 0 (since 1 and 2 won't work with 44100hz)
- encoding a file that has <48000hz samplerate (which doesn't interest me much, I want to encode this one precisely :p)

The problem occurs with all the DVD's i've tried, and this particular avi file also has 48000hz audio (another one with 44100hz audio works).

Here is what comes right after the previous mencoder window log, once I've changed one of the settings :
MP3 audio selected.
VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
VDec: using Planar I420 as output csp (no 1)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
SwScaler: using unscaled 0x32315659 (21VY) -> 0x32315659 (21VY) special converter
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
New_Face failed. Maybe the font path is wrong.n 0mb A-V:0.000 [0:0]
Please supply the text font file (~/.mplayer/subfont.ttf).
subtitle font: load_sub_face failed.
Writing header...4f ( 0%) 0.00fps Trem: 6min 0mb A-V:0.010 [0:0]
ODML: vprp aspect is 4:3.
Setting audio delay to 0.036s.
Writing header...
ODML: vprp aspect is 4:3.
Setting audio delay to 0.036s.
Pos: 0.2s 9f ( 0%) 2.54fps Trem: 13min 15mb A-V:0.027 [0:0]

Which makes me think either:
- That the resample audio filter does something wierd on my system when type is 1 or 2.
- That the mp3lame engine doesn't handle what comes out of mencoder's audio filtering chain (since in fact mencoder seems to wait indefinitely for mp3lame to initialize ...)

My real questions are : has anybody else had this problem ? and can anybody else reproduce it ?

This problem doesn't occur on another system of mine (which is an AMD Mobile Sempron laptop with XP pro SP2).

Any thoughts on the matter are welcome, before I try reporting this to mplayer dev's.

laura_lee
12th October 2006, 11:23
From your case ,I learn one thing.Update your OS in time.XP sp2 is better than sp1.

DarkZell666
12th October 2006, 14:50
@laura_lee : I do agree with that, but it's an institutional restriction ^^ I'm not gonna bash my sysadmin just for that :p

Can someone actually reproduce the problem ? On whatever the system ? I notice that types 1 and 2 (from mplayer manual) are polyphase bank (integer & floating point). This is obviously something "specific" that linear interpolation mode (mode=0) doesn't trigger.

Pookie
13th October 2006, 08:07
I have the same workstation configuration and yes, having tried out the syntax as posted above, the "-srate 44100" crashed mencoder.exe. You can run Filemon.exe form sysinternals.com to watch mencoder go kaput. "-srate 48000" worked properly.

The mencoder version I was using was dated 07.30.06

MEncoder dev-SVN-r19260-4.0.3 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (Family: 15, Model: 2, Stepping: 9)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

DarkZell666
13th October 2006, 09:39
Nice to hear I'm not the only one having problems :)

Nice tool too :p I knew sysinternals provided a bunch of cool apps like this but never really felt the need to try any of them =)

Question: does your crash also happen when type is 1 or 2 ? when you set it to 0 does is solve the problem? or only does changing the -srate solve the problem ?

In my case (to clear things up), it's a -af resample=xxxxx:1:x combination where xxxxxx=44100 and x=1 or 2, AND the input audio samplerate is 48000. -srate doesn't come into account in my problem, but it seems kinda related.

Pookie
13th October 2006, 10:54
In my case (to clear things up), it's a -af resample=xxxxx:1:x combination where xxxxxx=44100 and x=1 or 2, AND the input audio samplerate is 48000. -srate doesn't come into account in my problem, but it seems kinda related.

Yes, you're right. I was lazy when I looked back at the command line syntax :o

As far as type 1 vs type 2 - I can't tell you for a while. I have a transcoding batch file running at the moment. Perhaps your issue is fixed with a more recent version of Mencoder?