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

Miroslav Rovis m.rovis at inet.hr
Sat Nov 7 12:19:49 CET 2009


>>>>> mencoder -fps 25 -ofps 25 -noskip -mc 0 -vf harddup,softskip 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 -lavcopts vcodec=mpeg4:autoaspect:vbitrate=8000 -oac mp3lame
>>>>> -srate 48000 -lameopts cbr:preset=standard -endpos 100  -o VHS155_`date
>>>>> +%H%M%S`.avi      
>>>>>           
>>>> While I do not know if it can even work without, -fps 25 tells
>>>> MPlayer/mencoder to assume that there are always exactly 25 frames per
>>>> second. If the capture card loses sync during the bad sections and does
>>>> not produce any frames that is of course not going to work out at all.
>>>>         
>>> Thanks for trying to help. 25 frames ...
>>> is...  by the book and by the google...
>>>       
>> No, you misunderstand: -fps 25 tells MPlayer to assume the input to be
>> _exactly_ 25 fps no matter what, ignoring completely when the data arrives
>> from the capture card.
>> If you have a broken part in the video, it will not be able to capture _any_
>> frames, so during that time it is actually 0 fps, and with -fps 25 you explicitly
>> _forbid_ MPlayer to correct this.
>> There is also a fps option for -tv which is something else and which is supposed
>> to work in a saner way.
>> Still, to handle it properly you'd need support for variable frame-rate in-/output
>> which MPlayer does not have.  
>>     
> I see now. Thanks for bearing up with me so nicely...
> ...thanks to your patient explanation. Trials follow... Aaarrghhh!
>   
Ermmmhh... No variable frame-rate support...
What I can say is. this command gives such quality which I don't get
anywhere near with on Windoze:

mybox # mencoder -ofps 25 -noskip -mc 0 -vf softskip,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=36000:tsaf -lavcopts
vcodec=mpeg4:autoaspect:vbitrate=8000:turbo -oac mp3lame -lameopts
cbr:preset=standard -endpos 14880 -o hvk307_`date +%H%M%S`.mpg

Really so, only just... that unkind variable frame-rate support which is
missing... makes me have to forget about this snippet "-endpos 14880"
(4*60=240 minutes*60 to get seconds and *25 frames/sec as PAL is 25 fps
=14880 for a 4h VHS cassette + margin, that is one whole long cassette
in one go) as it all becomes a mess after those exact intervals of the
tape which I described in my first mail at the beginning of this thread...
And this good quality is too good in comparison with variable frame-rate
supporting Hauppauge Windoze program WinTV...
Well, then... then I have to live with it and rewind a few times every
casette.
And since it'll be the last time that I am watching these tapes (and
they contain things important to me), and they're soon going somewhere
similar to /dev/null and that is: miles away in some rubbish dump and I
will never have to handle them anymore...
Since things stand like that... (loud)
Since things stand like that.... (louder)
(Now I'm crying out loud:) Does anybody in the world knows if there are
any tricks of the trade for my plight?
A four hours cassette, and checking it nearly all the time, and
restarting, so far, four times... (I am half way through though...)
Any tricks of the trade for this frames making it impossible to digitize
tapes in one single go? As I have many and this'll kill me!
BTW, for newbies who might need to understand. The latter command is a
fine improvement to the former. It allows some seeking through the
stream being captured. The former doesn't. With the former it is
necessary to  issue something like:
mencoder -forceidx stream.avi -ovc copy -oac copy  -o stream_SEEKABLE.avi
And that is a nuissance when you have a 5GB or 10GB file which you don't
know at which point of the tape it is... Esp. so if you're stuck with
two or so systems with software RAID, yes, but only 1800+ Athlons in
them.... So one system is dedicated to capturing only. And the other may
watch and seek on the file that the first one is capturing...
The latter command allows for some seeking. Sufficient to see where you
are at, at any time, but it's kind of blurred (but I don't care, as it
does the work).
The resulting mpg file, though, can be worked nicely, like folllowing.
This is my script Make_avi.sh (in the /usr/local/bin):
#!/bin/bash
mencoder -ss $3 -frames $4 -ofps 24000/1001 -oac copy -ovc lavc
-lavcopts
vcodec=mpeg4:vbitrate=2400:v4mv:mbd=2:trell:cmp=3:subcmp=3:autoaspect:vpass=1
-vf pullup,softskip,hqdn3d=4:3:6 -of avi -o $1_$2_`date +%H%M`_p1.avi $1.avi
And this is the command:
Make_avi.sh stream T 5 143000
(You have to make:
ln -s stream.mpg stream.avi
a symbolic link)
If course 5 is for 5 sec from start, and 143000 is like the 14880 which
is explained above.
That is of course extremely clumsy, but once things work for me, I get
my mind on other things and don't care.
I hope this help someone.
And, if someone can help me with some tricks that may apply to my buster
frames, I'll be thankful.
I am thankful for the nice MPlayer to fellow Hungarians (I am Croat, and
I like them still so much better than Serbs which Croats have had issues
with in the last hundred or so years --we had issues  with Hungarians
for longer centuries earlier --, but we, the latter and us, did have
some nice workable things together which we can, both of our nations,
the Croatian and the Hungarian, be proud of, still)...
MPlayer is great!
(Out loud once more:) Any tricks of the trade for my plight?
Thanks.



More information about the MPlayer-users mailing list