Log in

View Full Version : mencoder error AE_FAAC


zackiv31
28th January 2009, 17:31
I'm running mencoder with some basic commands on a particular file, but for some reason its hiccuping. I've thrown tons of files into this same script, but this is the only one that seems to abort. It seems to have PCM audio and MJPEG video. Any help appreciated as I'm clueless :-/


[me@me ~]$ mencoder 3615993.avi -o /dev/null -passlogfile 1526_9989252_h264.log -oac faac -ovc x264
MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ (Family: 15, Model: 75, Stepping: 2)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0 data: 0x0 - 0xa0cd58
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO: [MJPG] 320x240 24bpp 30.000 fps 3024.2 kbps (369.2 kbyte/s)
[V] filefmt:3 fourcc:0x47504A4D size:320x240 fps:30.00 ftime:=0.0333
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 8000 Hz, 1 ch, u8, 64.0 kbit/100.00% (ratio: 8000->8000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG decoder)
==========================================================================
AE_FAAC, counldn't set specified parameters, exiting

Exiting...

microchip8
28th January 2009, 19:08
FAAC does not support 8000 Hz (8 kHz) audio
use a resampling filter, something like: -af resample=44100 -srate 44100

zackiv31
28th January 2009, 20:11
Great start froggy, now I'm getting another error, maybe its the video filter now? Thanks so far, didn't know that tidbit.


me@me:~$ mencoder 3615993.avi -o /dev/null -passlogfile 1526_9989252_h264.log -oac faac -ovc x264 -af resample=44100 -srate 44100
MEncoder 2:1.0~rc2-0ubuntu17 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ (Family: 15, Model: 75, Stepping: 2)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 0 data: 0x0 - 0xa0cd58
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1
VIDEO: [MJPG] 320x240 24bpp 30.000 fps 3024.2 kbps (369.2 kbyte/s)
[V] filefmt:3 fourcc:0x47504A4D size:320x240 fps:30.00 ftime:=0.0333
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 8000 Hz, 1 ch, u8, 64.0 kbit/100.00% (ratio: 8000->8000)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG decoder)
==========================================================================
VDec: vo config request - 320 x 240 (preferred colorspace: Planar 422P)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using Planar 422P as output csp (no 1)
Movie-Aspect is undefined - no prescaling applied.
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 4
SwScaler: reducing / aligning filtersize 1 -> 1
SwScaler: reducing / aligning filtersize 9 -> 8
[swscaler @ 0xe1f8d0]SwScaler: BICUBIC scaler, from yuv422p to yuv420p using MMX2
[swscaler @ 0xe1f8d0]SwScaler: using 4-tap MMX scaler for horizontal luminance scaling
[swscaler @ 0xe1f8d0]SwScaler: using 4-tap MMX scaler for horizontal chrominance scaling
[swscaler @ 0xe1f8d0]SwScaler: using 1-tap MMX "scaler" for vertical scaling (YV12 like)
[swscaler @ 0xe1f8d0]SwScaler: 320x240 -> 320x240
x264 [error]: no ratecontrol method specified
x264_encoder_open failed.
FATAL: Cannot initialize video driver.
VDec: vo config request - 320 x 240 (preferred colorspace: Planar 422P)
VDec: using Planar 422P as output csp (no 1)
Movie-Aspect is undefined - no prescaling applied.
x264 [error]: no ratecontrol method specified
x264_encoder_open failed.
FATAL: Cannot initialize video driver.

Exiting...

microchip8
28th January 2009, 20:13
it is very clear, just read the error... "no ratecontrol method specified"

you need to add bitrate= or crf= to x264encopts

-ovc x264 -x264encopts bitrate=900

or

-ovc x264 -x264encopts crf=23

also -passlogfile is only used if you do 2pass encoding

zackiv31
28th January 2009, 20:23
Genious! Sorry, I read the FATAL line about the video driver, and didn't look up.

Is there any downside to resampling all files I'm passing through my routine with this resampling? I'm guessing quality loss if they are actually 44100hz? Trying to set a standard good practices for all files, but if you think I should check for these rates beforehand and encode accordingly, I'll do it that way.

Also, I've been using the mencoder document to look up its uses, is there something specific you'd recommend to read (a doc even) about the x264 codec and x264encopts options?

microchip8
28th January 2009, 20:36
you won't gain any improvement by upsampling 8 kHz to 44.1 kHz though it'll increase compatibility a bit and of course if you want AAC audio, you must resample to something that FAAC supports
for x264 option explanation read this http://ffmpeg.x264.googlepages.com/mapping (the bold ones are for ffmpeg so if you don't use it, ignore them)

zackiv31
28th January 2009, 21:22
I'm creating mp4's with aac as they're the best quality, so I will likely need to check my input files.

Is it only 8k audio that is the problem? Or is 16k a problem as well? Thanks for your help!


EDIT: After reading the wikipedia on AAC, http://en.wikipedia.org/wiki/Advanced_Audio_Coding, it says it supports 8->96k ? hmmm

zackiv31
28th January 2009, 23:28
After doing some testing of my own, I've found that the minimum requirements for AAC are 16k with 2 channel audio (anything less then this needs resampling).

I've just gone to resampling all my audio to 44100k, and it seems to be working well for anything i can throw at it, although I'm still unsure if I'm losing quality anywhere...

nm
28th January 2009, 23:44
I've just gone to resampling all my audio to 44100k, and it seems to be working well for anything i can throw at it, although I'm still unsure if I'm losing quality anywhere...
You lose much more quality because of AAC encoding than resampling from 8 kHz to 44.1 kHz. Even if you don't resample before encoding, the audio will get resampled anyway on playback (to 44.1 or 48 kHz).

microchip8
29th January 2009, 01:58
EDIT: After reading the wikipedia on AAC, http://en.wikipedia.org/wiki/Advanced_Audio_Coding, it says it supports 8->96k ? hmmm

yes, AAC supports 8 kHz but that does not mean that every single AAC encoder implements/supports it. In the case of FAAC, it doesn't