Log in

View Full Version : I think I have problems with mencoder -vf scale


panfist
24th February 2008, 00:48
I am trying to transcode an mpg to x264 format and I can't figure out how to get passed this error. Here is my mencoder command:

mencoder -v\
"/media/sdb1/backups/120/Documents and Settings/Sandy/My Documents/My Videos/wedding video.mpg"\
-alang en\
-vf crop=704:464:0:,spp,scale=720:423,hqdn3d,pp=fd\
-ovc x264 -x264encopts subq=1:b-rdo:bime:bframes=4:b-pyramid:bitrate=1500:pass=1:weight_b=8\
-oac copy\
-o "/media/sda2/Movies/wedding.mkv"

Here is all of the output I get. Any help would be appreciated.

lapenta@tivo:/media/sdb1$ mencoder -v\
> "/media/sdb1/backups/120/Documents and Settings/Sandy/My Documents/My Videos/wedding video.mpg"\
> -alang en\
> -vf crop=704:464:0:,spp,scale=720:423,hqdn3d,pp=fd\
> -ovc x264 -x264encopts subq=1:b-rdo:bime:bframes=4:b-pyramid:bitrate=1500:pass=1:weight_b=8\
> -oac copy\
> -o "/media/sda2/Movies/wedding.mkv"
MEncoder 2:1.0~rc1-0ubuntu13.1 (C) 2000-2006 MPlayer Team
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (Family: 15, Model: 2, Stepping: 7)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
Option x264encopts: Bad argument weight_b=8

WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.
init_freetype
get_path('font/font.desc') -> '/home/lapenta/.mplayer/font/font.desc'
font: can't open file: /home/lapenta/.mplayer/font/font.desc
font: can't open file: /usr/share/mplayer/font/font.desc
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
[file] File size is 8894676992 bytes
STREAM: [file] /media/sdb1/backups/120/Documents and Settings/Sandy/My Documents/My Videos/wedding video.mpg
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
success: format: 0 data: 0x0 - 0x122a0000
Checking for YUV4MPEG2
ASF_check: not ASF guid!
Checking for NuppelVideo
Checking for REAL
Checking for SMJPEG
Searching demuxer type for filename /media/sdb1/backups/120/Documents and Settings/Sandy/My Documents/My Videos/wedding video.mpg ext: .mpg
Checking for Nullsoft Streaming Video
Checking for MOV
Checking for VIVO
header block 1 size: 0
AVS: avs_check_file - attempting to open file /media/sdb1/backups/120/Documents and Settings/Sandy/My Documents/My Videos/wedding video.mpg
AVS: File is too big, aborting...
Checking for PVA
Checking for MPEG-TS...
TRIED UP TO POSITION 67668, FOUND 47, packet_size= 0, SEEMS A TS? 0
Checking for LMLM4 Stream Format
Invalid packet in LMLM4 stream: ch=0 size=1140851704
LMLM4 Stream Format not found
system stream synced at 0xD (13)!
==> Found video stream: 0
==> Found audio stream: 0
MPEG Stream reached EOF
ds_fill_buffer: EOF reached (stream: video)
MPEG-PS file format detected.
Searching for sequence header... OK!
VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 7000.0 kbps (875.0 kbyte/s)
[V] filefmt:2 fourcc:0x10000002 size:720x480 fps:29.97 ftime:=0.0334
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
dec_audio: Allocating 4608 + 65536 = 70144 bytes for output buffer.
mp3lib: made decode tables with MMX optimization
mp3lib: using SSE optimized decore!
MP3lib: init layer2&3 finished, tables done
MPEG 1.0, Layer II, 48000 Hz 224 kbit Stereo, BPF: 672
Channels: 2, copyright: No, original: No, CRC: No, emphasis: 0
AUDIO: 48000 Hz, 2 ch, s16le, 224.0 kbit/14.58% (ratio: 28000->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: [pp=fd]
[expand] query(Planar YV12) -> 0
[expand] query(Planar I420) -> 3
Opening video filter: [hqdn3d]
Opening video filter: [scale w=720 h=423]
SwScale params: 720 x 423 (-1=no scaling)
Opening video filter: [spp]
Opening video filter: [crop w=704 h=464 x=0]
Crop: 704 x 464, 0 ; -1
==========================================================================
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough
VDec: vo config request - 720 x 480 (preferred colorspace: Mpeg PES)
[PP] Using external postprocessing filter, max q = 6.
Trying filter chain: crop spp scale hqdn3d pp expand x264
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
SwScale params: -1 x -1 (-1=no scaling)
Trying filter chain: scale crop spp scale hqdn3d pp expand x264
The selected video_out device is incompatible with this codec.
Try adding the scale filter, 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))
==========================================================================
Building audio filter chain for 48000Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy
[dummy] Was reinitialized: 48000Hz/2ch/s16le
[dummy] Was reinitialized: 48000Hz/2ch/s16le
audiocodec: framecopy (format=50 chans=2 rate=48000 bits=16 B/s=28000 sample-1)
VDec: vo config request - 720 x 480 (preferred colorspace: Planar YV12)
[PP] Using external postprocessing filter, max q = 6.
Trying filter chain: crop spp scale hqdn3d pp expand x264
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO Config (720x480->720x540,flags=0,'MPlayer',0x32315659)
REQ: flags=0xC01 req=0x400
REQ: flags=0xC01 req=0x0
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 5 -> 4
SwScaler: reducing / aligning filtersize 6 -> 5
SwScaler: reducing / aligning filtersize 6 -> 5

SwScaler: BICUBIC scaler, from yuv420p to yuv420p using MMX2
SwScaler: using 4-tap MMX scaler for horizontal luminance scaling
SwScaler: using 4-tap MMX scaler for horizontal chrominance scaling
SwScaler: using n-tap MMX scaler for vertical scaling (YV12 like)
SwScaler: 704x464 -> 720x424
REQ: flags=0xC03 req=0x0
REQ: flags=0xC03 req=0x0
REQ: flags=0x403 req=0x0
REQ: flags=0x3 req=0x0
FATAL: Cannot initialize video driver.

Exiting...

nm
24th February 2008, 01:47
Here's your problem:
Option x264encopts: Bad argument weight_b=8
Remove "=8" from that x264 option and it should work fine.

Other suggestions:
Put the deinterlacing filter at the beginning of the filter chain, not the end. Otherwise it won't work correctly. And use yadif instead of pp=fd.
MEncoder can't output directly to Matroska container, and even if it could, it would use AVI by default. As your log says: "WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help".
When encoding with x264, you should use raw H.264 stream output (-of rawvideo -o file.264) and mux the resulting file and the audio track from the original file with mkvmerge.
Use CRF instead of 2-pass encoding. It's easier and faster if you don't have a specific target bitrate. If you must use 2-pass, take a look at the turbo presets for the first pass.
Compile x264 and MEncoder from SVN to get the latest and greatest.

microchip8
24th February 2008, 07:57
Here's your problem:

MEncoder can't output directly to Matroska container, and even if it could, it would use AVI by default. As your log says: "WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help".


that's not really true, with -of lavf -lavfopts format=mkv MEncoder can output to matroska but will generate broken files in the presence of b-frames