Author Topic: Video Encoder Settings  (Read 10117 times)

JerryAttrix

  • Newbie
  • *
  • Posts: 11
    • View Profile
Video Encoder Settings
« on: December 24, 2005, 06:07:25 am »
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?
C860 running pdaXrom RC12
SanDisk 1Gb SD card
Buffalo WiFi

urielka

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Video Encoder Settings
« Reply #1 on: December 24, 2005, 07:35:22 am »
run it by using mplayer -vo bvdd -vm name.avi
by command line it should run the best.
i use this:
Code: [Select]
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 lavcthe diffrence is that i use 320 for video bitrate and u use 192 does 192 is good quality?
« Last Edit: December 24, 2005, 07:37:27 am by urielka »

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Video Encoder Settings
« Reply #2 on: December 24, 2005, 08:21:33 am »
Quote
run it by using mplayer -vo bvdd -vm name.avi
by command line it should run the best.
i use this:
Code: [Select]
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 lavcthe diffrence is that i use 320 for video bitrate and u use 192 does 192 is good quality?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=108357\"][{POST_SNAPBACK}][/a][/div]

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
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

urielka

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Video Encoder Settings
« Reply #3 on: December 24, 2005, 09:44:58 am »
will it be as good as 320 kbit rate?

JerryAttrix

  • Newbie
  • *
  • Posts: 11
    • View Profile
Video Encoder Settings
« Reply #4 on: December 27, 2005, 12:11:32 pm »
Quote
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?
C860 running pdaXrom RC12
SanDisk 1Gb SD card
Buffalo WiFi

pgas

  • Hero Member
  • *****
  • Posts: 1097
    • View Profile
    • http://
Video Encoder Settings
« Reply #5 on: December 27, 2005, 12:35:52 pm »
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
SLC-860 cacko / senao wifi

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Video Encoder Settings
« Reply #6 on: February 06, 2006, 06:49:54 am »
Quote
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[div align=\"right\"][a href=\"index.php?act=findpost&pid=108358\"][{POST_SNAPBACK}][/a][/div]
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: [Select]
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 %2I'm having the same problem as JerryAttrix that the audio is out of phase. Any suggestions? thks
GROG!

adf

  • Hero Member
  • *****
  • Posts: 2807
    • View Profile
    • http://
Video Encoder Settings
« Reply #7 on: February 06, 2006, 07:57:36 pm »
try divx 5, like meanie did, or try ffmpeg.

Have you tried avidemux2?   I find it really handy.
**3100 Zubuntu Jaunty,(working on Cacko dualboot), 16G A-Data internal CF, 4G SD, Ambicom WL-1100C Cf, linksys usb ethernet,  BelkinF8T020 BT card, Belkin F8U1500-E Ir kbd, mini targus usb mouse, rechargeble AC/DC powered USB hub, psp cables and battery extenders.

**6000l  Tetsuized Sharprom, installed on internal flash only 1G sd, 2G cf

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Video Encoder Settings
« Reply #8 on: February 06, 2006, 10:24:03 pm »
Quote
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.[div align=\"right\"][a href=\"index.php?act=findpost&pid=113922\"][{POST_SNAPBACK}][/a][/div]
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.
GROG!

dbowden

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • http://
Video Encoder Settings
« Reply #9 on: February 25, 2006, 11:39:10 pm »
Quote
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
C1000 running Cacko 1.23 (needs new video cable)
1GB SD
4GB microdrive
Modified Creative Zen Remote
C760 running pdaXrom R197

datajerk

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • http://
Video Encoder Settings
« Reply #10 on: February 26, 2006, 11:11:42 am »
I no longer have problems with 320x240, 512bit, 30 frames/sec and Kino/Cacko 1.23 on my c860 using:

Code: [Select]
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: [Select]
-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

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Video Encoder Settings
« Reply #11 on: March 02, 2006, 08:34:56 pm »
Quote
I no longer have problems with 320x240, 512bit, 30 frames/sec and Kino/Cacko 1.23 on my c860 using:

Code: [Select]
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
[div align=\"right\"][a href=\"index.php?act=findpost&pid=116143\"][{POST_SNAPBACK}][/a][/div]
I've modified the lines so that they'll (almost) run on my 'doze box:

Code: [Select]
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: [Select]
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
GROG!

adf

  • Hero Member
  • *****
  • Posts: 2807
    • View Profile
    • http://
Video Encoder Settings
« Reply #12 on: March 02, 2006, 10:24:53 pm »
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.
« Last Edit: March 02, 2006, 10:28:44 pm by adf »
**3100 Zubuntu Jaunty,(working on Cacko dualboot), 16G A-Data internal CF, 4G SD, Ambicom WL-1100C Cf, linksys usb ethernet,  BelkinF8T020 BT card, Belkin F8U1500-E Ir kbd, mini targus usb mouse, rechargeble AC/DC powered USB hub, psp cables and battery extenders.

**6000l  Tetsuized Sharprom, installed on internal flash only 1G sd, 2G cf

datajerk

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • http://
Video Encoder Settings
« Reply #13 on: March 02, 2006, 11:27:48 pm »
My bad.  I C&P the command wrong.  Switch -ofps 30000/1001 with the vcodec=... line.

Command should be:
Code: [Select]
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
« Last Edit: March 02, 2006, 11:28:32 pm by datajerk »

grog

  • Hero Member
  • *****
  • Posts: 692
    • View Profile
    • http://
Video Encoder Settings
« Reply #14 on: March 05, 2006, 12:40:40 pm »
Quote
My bad[div align=\"right\"][a href=\"index.php?act=findpost&pid=116777\"][{POST_SNAPBACK}][/a][/div]
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: [Select]
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: [Select]
mplayer -nortc -quiet -ac mad -noaspect -vo fbdev -nodouble -dr -framedrop -nocache -fs -brightness 20 -input conf=/dev/null $@Thanks again
GROG!