[MEncoder-users] composite input a/v sync issue

Miroslav Rovis m.rovis at inet.hr
Tue Nov 10 01:07:03 CET 2009


>> So you now leave out the -fps, does that change anything with respect
>> to the A-V sync issues?
>>     
> No. No change. Delays just as previously I described.  
But, hey! Things started to get in sync only after I removed not just
the -fps 25 but also the -ofps 25.
I went to sleep after programming a three hours cassette for encoding,
and this command:
mencoder -vf harddup  tv:// -tv
input=1:driver=v4l2:device=/dev/video0:normid=3:input=1:alsa:adevice=hw.0:audiorate=48000:amode=1:width=768:height=576
-ovc lavc -of mpeg  -mpegopts muxrate=40000:tsaf -lavcopts
vcodec=mpeg4:autoaspect:vbitrate=8000:mbd=2:turbo -oac mp3lame -lameopts
cbr:preset=standard -endpos 11400 -o VHS_noXXX_`date +%H%M%S`.mpg
gave synced stream, but very jerky, lots of frames skipped... esp. where
lots of movements. Unusable, but synced, hey!
BTW, -forceidx on an avi, I think I tried it earlier on, and, if you
take a look, I wrote, that's not seeking on the file itself, but copying
over and only then searching though a copy of it. So "-o mpeg" is
necessary for seekable file on the fly.
>> I guess you'll have to remove
>> -noskip -mc 0 though, possibly even use -mc 100
...
>> Also if you do not care much about size and have a slow PC, you should
>> remove bitrate from lavcopts and instead add vqscale=2:mbd=0    
And you seem to have recommended right. And guessed right. Or was it
understanding rather than guessing?
So, I have captured amazing 40 minutes, or more, by the time I send
this, from another tape with:
mencoder -vf harddup tv:// -tv
input=1:driver=v4l2:device=/dev/video0:normid=3:input=1:alsa:adevice=hw.0:audiorate=48000:amode=1:width=768:height=576
-ovc lavc -of mpeg -mpegopts muxrate=50000:tsaf -lavcopts
vpass=1:vcodec=mpeg4:autoaspect:vqscale=2:mbd=0:turbo -oac mp3lame
-lameopts cbr:preset=standard -vf softskip -endpos 11400 -o
VHS_numberXXX_`date +%H%M%S`.mpg

Along with omitting "-noskip -mc" and "vbitrate=8000", what is changed
from previous line is
"vqscale=2:mbd=0".

It seems that all was due to exegesis of the MPlayer biblical reading :-)
In lay terms, it's in the book, and there's no way around reading it
...Over and over if you don't get it in the first few reads... :-(
Like me. (Oh, it's a ginormous book, if you set out on reading it, you
do need days... I didn't ever read for days, I just browsed here and there.)
Also, I believe it was important putting: -vf softskip later in the
processing chain (I finally  understood that the book says so).
That bit of instruction is what makes my badly desired sync to reappear!
Yes, reappear, as those ugly spots, intervals that I spent a few lines
of prose to desccribe in my first post, I think, still cause problems,
but, But!
It's all back in sync after a second or two, which is nearly what I can
leave with, giving the absolutely incomparable quality which I get with
my Gentoo Linux with nicely compiled recent MPlayer...
In comparison with the Windoze programs I mean.
I've been waiting for years to get to use my Linuces like this!
There seem to be someone messing up my tutorial that I put on Suse two
and a half years ago.
And they had given it a prominent place (originally I had put it in a
modest place where any articles of any level of quality are put into):
http://en.opensuse.org/Backup_Windows_installed_on_BIOS_RAID_with_SUSE
I reverted it to earlier version, but it's not safe from more messing,
and if you don't find words:
Hauppauge HVR
than search for my version in history. Years I have waited to use
Hauppage cards on Linux! I'm almost happy! (I am still checking if all
works well...)
Note also in the command that I put: "vpass=1" in there. That is beacuse
the size that I got so far (and it is nearly two (2) hours now, is 16GB.
Of course I have to further work on it.
I really don't know yet, but on earlier versions I was able to get good
results with:

#!/bin/bash
# This is my script Make_avi_h264_00.sh
mencoder $1.avi -o $1_p1_`date +%H%M%S`.avi -ss 0 -ovc x264 \
-x264encopts pass=1:turbo:bitrate=900:bframes=1:\
me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300
\
-vf harddup \
-oac faac -faacopts br=192:mpeg=4:object=2 -channels 2 -srate 48000 \
-ofps 24000/1001
mencoder $1.avi -o $1_p2_`date +%H%M%S`.avi -ss 0 -ovc x264 \
-x264encopts pass=2:turbo:bitrate=900:frameref=5:bframes=1:\
me=umh:partitions=all:trellis=1:qp_step=4:qcomp=0.7:direct_pred=auto:keyint=300
\
-vf harddup \
-oac faac -faacopts br=192:mpeg=4:object=2 -channels 2 -srate 48000 \
-ofps 24000/1001

mybox # Make_avi_h264_00.sh hvk305_000615 0

I hope this helps some newbies as well.
Thanks again, Reimar. Your suggestions were fundamental to this,
possibly, solved composite input a/v sync issue.
Miro
I'll try and let you know later if h264 encoding gave happy results to me.



More information about the MEncoder-users mailing list