Help - Search - Members - Calendar
Full Version: Video Encoder Settings
OESF Forums > Distros, Development, and Model Specific Forums > Distro Support and Discussion > pdaXrom
JerryAttrix
I've been experimenting with various mencoder options (on my SuSE 9.3 PC) to get something that works optimally on the Z. A typical command is

mencoder $1 -o $2.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:vqmin=2:vqmax=20:vmax_b_frames=2:vbitrate=192:vqcomp=0.6:vpass=
-vf scale=320:240,eq=6 -oac mp3lame -lameopts abr:br=64:aq=1 -srate 24000

but XMMS plays the result with the sound leading the video by a second or more. Also I'd like to run full-screen but the results are always jerky. On Cacko using kino I had some success by rotating the video and sizing to 480x640, but everything I encoded recently played with no video at all, which was the main reason I moved to pdaXrom.

Does anyone have a recommendation?
urielka
run it by using mplayer -vo bvdd -vm name.avi
by command line it should run the best.
i use this:
CODE
mencoder $1 -srate 24000 -vop scale=320:240 -o z.$1 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=320:vhq:acodec=mp3:abitrate=64  -sws 2 -oac lavc

the diffrence is that i use 320 for video bitrate and u use 192 does 192 is good quality?
Meanie
QUOTE(urielka @ Dec 24 2005, 10:35 PM)
run it by using mplayer -vo bvdd -vm name.avi
by command line it should run the best.
i use this:
CODE
mencoder $1 -srate 24000 -vop scale=320:240 -o z.$1 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=320:vhq:acodec=mp3:abitrate=64  -sws 2 -oac lavc

the diffrence is that i use 320 for video bitrate and u use 192 does 192 is good quality?
*


if you want better quality then you can use 2 phase encoding with the following options:

1st phase -

mencoder $1 -o $2 -oac copy -vf scale=320:240,eq2=1.0:1.0:0.03:1.0 -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=248:vpass=1 -ffourcc DX50

2nd phase -

mencoder $1 -o $2 -srate 22050 -oac mp3lame -lameopts mode=3:cbr:br=24 -vf scale=320:240,eq2=1.0:1.0:0.03:1.0 -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=248:vpass=2 -ffourcc DX50
urielka
will it be as good as 320 kbit rate?
JerryAttrix
QUOTE(urielka @ Dec 24 2005, 12:35 PM)
run it by using mplayer -vo bvdd -vm name.avi
the diffrence is that i use 320 for video bitrate and u use 192 does 192 is good quality?

Nope; it's pretty poor. I only did it to pack as much as possible in (though looking at 2-phase results I see I wasn't saving anything). But I don't worry about the picture too much; I use it mainly for foreign language videos where the sound is the key.

I did the 2-phase encoding as recommended and the results are exceptional. However, XMMS still plays the sound faster than the video. Going to the console results in the following:

# mplayer -vo bvdd -vm /mnt/card/bg01.avi
Failed to open /dev/rtc: Device or resource busy (it should be readable by the user.)
Playing /mnt/card/bg01.avi
Cache fill: 0.00% (0 bytes) AVI file format detected.
VIDEO: [FMP4] 320x240 24bpp 25.000 fps 193.2 kbps (23.6 kbyte/s)
Clip info:
Software: MEncoder SuSE Linux 9.3 (i686)-Packman-3.3.5
=======================================
Requested audio codec family [mp3] (afm=mp3lib) not available.
Enable it at compilation.
Opening audio decoder: [libmad] libmad audio decoder
AUDIO: 24000 Hz, 2 ch, s161e, 8.0 kbit/1.04% (ratio: 1000->96000)
Selected audio codec: [mad] (libMAD MPEG layer 1-2-3)
=======================================
Error opening/initializing the selected video_out (-vo) device.
Exiting...

I can't find bvdd listed; what is it?
pgas
I'm not a specialist but I think that with a 860 you should use -vo w100 and not -vo bvdd, also add -nortc to the list of options.

bvdd is for C1000/3000/3100
grog
QUOTE(Meanie @ Dec 24 2005, 07:21 AM)
if you want better quality then you can use 2 phase encoding with the following options:

1st phase -

mencoder $1 -o $2 -oac copy -vf scale=320:240,eq2=1.0:1.0:0.03:1.0 -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=248:vpass=1 -ffourcc DX50

2nd phase -

mencoder $1 -o $2 -srate 22050 -oac mp3lame -lameopts mode=3:cbr:br=24 -vf scale=320:240,eq2=1.0:1.0:0.03:1.0 -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=248:vpass=2 -ffourcc DX50
*

Hey Meanie. I'm trying your tip on my poodle, and while the video is a lot better than this one phase command that I tried:

CODE
mencoder %1 -srate 24000 -ofps 15 -sws 2 -ovc lavc -vf scale=320:240,eq2=1.0:0.6:0.1:0.7 -lavcopts vcodec=mpeg4:vhq:vbitrate=150 -lameopts cbr:br=64:mode=3 -vop scale=320:240 -oac mp3lame -ffourcc XVID -o %2

I'm having the same problem as JerryAttrix that the audio is out of phase. Any suggestions? thks
adf
try divx 5, like meanie did, or try ffmpeg.

Have you tried avidemux2? I find it really handy.
grog
QUOTE(adf @ Feb 6 2006, 06:57 PM)
try divx 5, like meanie did, or try ffmpeg

I'm trying some videos, using fourcc XVID. Is this what you mean?

QUOTE
Have you tried avidemux2?  I find it really handy.
*

As opposed to mencoder you mean? No, but I'll check it out.

Another thing I tried was playing the videos with opie-mediaplayer2/xine. No luck yet; gave the error there was no demuxer available. I'm trying the above XVID in hopes that'll fix that.
dbowden
QUOTE(grog @ Feb 6 2006, 06:49 AM)
I'm having the same problem as JerryAttrix that the audio is out of phase. Any suggestions? thks


It does seem to be an encoding issue.

I noticed the same thing myself, but only on one video I encoded using the instructions at: http://www.cs.unc.edu/~hensley/zaurus/encode.html.

Videos I downloaded from the web seem to work OK, as did another video I encoded using the exact same method (2nd track on the DVD worked OK, 1st track was off).

I fixed it by adjusting the audio delay by about 2.2 seconds. The command line option is "-delay -2.2", so for that video, I use:
mplayer -vo bvdd -vm -delay -2.2 videoname.avi

I used the commands + and - during playback to find out the correct setting. It may vary for you.

Hope this helps,

David
datajerk
I no longer have problems with 320x240, 512bit, 30 frames/sec and Kino/Cacko 1.23 on my c860 using:

CODE
mencoder $1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320x240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=1 -oac copy -sws 2 -o output.avi

mencoder $1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320x240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=2 -oac copy -sws 2 -o output.avi

I have not had the time to find the best options for highest quality output, but the above did fix all my audio sync problems with TiVo content. It's spot on and looks great. A similar setup also worked for my kids video iPod, i.e. no audio sync issues.

For DVDs an -ofps of 24000/1001 may solve the problem. I have not tried DVDs yet. Other settings for -ofps, using -noskip, and 3 pass encoding (don't ask me to recall all combinations) created the audio sync issues.

I don't know about newer units (c1000, c3xxx), but the c860 performs much better with prerotation.

On playback I did have to add to Kino General/Advanced options/Options for mplayer '-fs' to get full screen. Under Video, uncheck all tabs, except Drop frames and Disable aspect ratio correction. And, overclock on playback.

The actual playback options are:
CODE
-slave -nortc -quict -ac -mp3 -noaspect -vo w100 -nodouble -dr -framedrop -nocache -fs file...

I hope this helps. I have been fighting audio sync problems for months.

Lastly I read that 640x480 is possible with good performance with c[13]??? models. I plan to upgrade when the next releases. Does any know if you have to prerotate to get good performance with c[13]??? models?
grog
QUOTE(datajerk @ Feb 26 2006, 10:11 AM)
I no longer have problems with 320x240, 512bit, 30 frames/sec and Kino/Cacko 1.23 on my c860 using:

CODE
mencoder $1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320x240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=1 -oac copy -sws 2 -o output.avi

mencoder $1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320x240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=2 -oac copy -sws 2 -o output.avi
*

I've modified the lines so that they'll (almost) run on my 'doze box:

CODE
c:\progra~1\mplayer\mencoder %1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320:240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=1 -oac copy -sws 2 -o %2

c:\progra~1\mplayer\mencoder %1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320:240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=2 -oac copy -sws 2 -o %2

But I can't get past this error:

CODE
F:\zvids>encode-movie infile.avi avi outfile.avi
MEncoder 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Northwood (Family: 8, Stepping: 4)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
File not found: 'frameno.avi'
Failed to open frameno.avi
Option lavcopts: Unknown suboption -ofps

Exiting... (error parsing cmdline)

I don't see 'frameno.avi' anywhere on the command line, and I've used the '-ofps' options in other attempts. Any ideas anyone? thks
adf
hmmm. Maybe a codec issue?

Which reminds me... I had less luck with Xvid than I did with ffmpeg. Xvid, imho looks better on a large screen, &tc... playback on a z with ffmpeg encoding and mplayer has been better in my experience.

I recommend avidemux2 as it is a handy gui based app --easier to tinker on if you encode intermmitently and have that "wtf did i do to make this work just so last time?" experience, like I do.

I also have done better with ogg audio and a .ogm wrapper. at the very least you can get away with compressing the audio a bit further and shunting the little extra bit of space you saved to the video stream.
datajerk
My bad. I C&P the command wrong. Switch -ofps 30000/1001 with the vcodec=... line.

Command should be:
CODE
c:\progra~1\mplayer\mencoder %1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320:240,rotate=1 -ovc lavc -lavcopts  vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=2 -ofps 30000/1001 -oac copy -sws 2 -o %2
grog
QUOTE(datajerk @ Mar 2 2006, 10:27 PM)
My bad
*

Thanks for the update. I've been playing & tweaking & reading man pages & docs over the last week & finally came up with this. I's the same as yours except that my 5600 didn't seem to like mencoder doing the pre-rotate, so I took that out & I removed the extra '-oac copy' option, which I wasn't sure why you had it in there although it doesn't seem to break anything.

CODE
c:\progra~1\mplayer\mencoder %1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320:240 -ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=1 -ofps 30000/1001 -sws 2 -o %2

c:\progra~1\mplayer\mencoder %1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320:240 -ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=2 -ofps 30000/1001 -sws 2 -o %2

And here's the mplayer options I use to play. The mad audio codec seems to works better for me & my mplayer doesn't have w100 so I swtiched to fbdev. Ihe input is so that my key settings for playing mp3's don't effect movie playback. I'll even 'chvt 1' & play them in a separate virtual terminal 'cause there's some minor artifacts on the screen when I play in a gui terminal.

CODE
mplayer -nortc -quiet -ac mad -noaspect -vo fbdev -nodouble -dr -framedrop -nocache -fs -brightness 20 -input conf=/dev/null $@

Thanks again
rsay
I have been using ffmpeg with good results. I got the recipe from the ubuntu forums:

ffmpeg -i input_file.avi -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -acodec aac -ab 192 -s 320x240 -aspect 4:3 output_file.mov

I playback on my 3100 with:

mplayer -vm -ao oss -vo bvdd:rotate=-1 output_file.mov

There is also a gui for ffmpeg specifically for this purpose called VIVE available on sourceforge.

Here is the link to the forum discussion: Video encoding for ipod

Here is the link to the vive project on sourceforge:VIVE
ostense
QUOTE(grog @ Mar 2 2006, 05:34 PM)
QUOTE(datajerk @ Feb 26 2006, 10:11 AM)
I no longer have problems with 320x240, 512bit, 30 frames/sec and Kino/Cacko 1.23 on my c860 using:

CODE
mencoder $1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320x240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=1 -oac copy -sws 2 -o output.avi

mencoder $1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320x240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=2 -oac copy -sws 2 -o output.avi
*

I've modified the lines so that they'll (almost) run on my 'doze box:

CODE
c:\progra~1\mplayer\mencoder %1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320:240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=1 -oac copy -sws 2 -o %2

c:\progra~1\mplayer\mencoder %1 -oac mp3lame -lameopts cbr:br=128:mode=0 -vf pp=lb,scale=320:240,rotate=1 -ovc lavc -lavcopts -ofps 30000/1001 vcodec=mpeg4:vhq:v4mv:vbitrate=512:vpass=2 -oac copy -sws 2 -o %2

But I can't get past this error:

CODE
F:\zvids>encode-movie infile.avi avi outfile.avi
MEncoder 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Northwood (Family: 8, Stepping: 4)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 0 SSE2: 0
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
File not found: 'frameno.avi'
Failed to open frameno.avi
Option lavcopts: Unknown suboption -ofps

Exiting... (error parsing cmdline)

I don't see 'frameno.avi' anywhere on the command line, and I've used the '-ofps' options in other attempts. Any ideas anyone? thks
*



Hi !
frameno.avi is made automatic by the pass 1 and automatic taken as input to the pass 2 run so if the pass 2 do not find it something went wrong in the pass 1.
datajerk
QUOTE
Thanks for the update. I've been playing & tweaking & reading man pages & docs over the last week & finally came up with this. I's the same as yours except that my 5600 didn't seem to like mencoder doing the pre-rotate, so I took that out & I removed the extra '-oac copy' option, which I wasn't sure why you had it in there although it doesn't seem to break anything.

...

Is your audio sync issue solved?
grog
QUOTE(datajerk @ Mar 14 2006, 10:14 AM)
QUOTE
Thanks for the update. I've been playing & tweaking & reading man pages & docs over the last week & finally came up with this. I's the same as yours except that my 5600 didn't seem to like mencoder doing the pre-rotate, so I took that out & I removed the extra '-oac copy' option, which I wasn't sure why you had it in there although it doesn't seem to break anything.
Is your audio sync issue solved?
*
It seems to be (with the above changes). As well, don't try yo encode more than one video at a time (at least not under windows). You'll eventually get an error about not being able to open the video driver. As long as you encode one at a time, all goes ok.

I'm also eventually going to try ffmpeg as suggested earlier to see if that's any easier/reliable. As time permits, of course.

Thanks all for the help.
DaddyGeek
One option I don't see people mentioning is the "-framedrop" for mplayer.

I find I add this to any video playback for my C3000 OR 5500 with mplayer and I tend to get quite decent results and no drastically noticeable disruption of viewability.

This seems to help the audio which seems to be the dog in most of the different formats I have tried.

I have to admit I use Windows (shhhh) to do the encoding, but I run DivX (or xVid) with a rate of 256 or 512 for the encoding with MP3 audio at approx 192 kbps and the playback seems quite good.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.