[pvrusb2] Video & Audio out of sync when using mencoder?

Roger rogerx.oss at gmail.com
Sat Nov 19 13:31:34 CST 2011


> On Sat, Nov 19, 2011 at 11:28:20AM -0600, Mike Isely wrote:
>
>Roger:
>
>Audio and video are muxed together by the capture device itself not by 
>anything about the host.  There's basically NOTHING that any outside 
>software can do to interfere with that process.
>
>Now, with that said, it's possible that the de-muxing might get screwed 
>up.  If you're using mencoder to "record" I presume you're doing this in 
>order to transcode the stream to a different format, right?  That means 
>that mencoder is going to de-mux the incoming stream and re-mux the 
>re-encoded results to your desired output format.
>
>I have seen cases where mplayer will lose audio / video sync because 
>it's not getting the incoming stream data at a consistent rate - which 
>can happen if the capture device is having reception problems.  A 
>drop-dead absolute method to determine if this is the case is to instead 
>of running mplayer directly on the stream that you instead cat the 
>device's output to file and THEN run mplayer on the file.  If you do 
>this and all sync issues go away then it's mplayer doing something 
>strange - because when you're feeding it a ready-made file rather than a 
>live stream then there are no gaps / breaks.
>
>Now you said you're using mencoder not mplayer.  However they share the 
>same codebase and if mencoder is really de-muxing / re-muxing the stream 
>then I could see a similar problem happening.  Try sending the capture 
>device output to a file for 5-10 minutes, then run that file through 
>mencoder and see if you're still having sync issues.
>
>The last paragraph at the following URL talks about audio/video sync 
>issues with mplayer:
>
>http://www.isely.net/pvrusb2/usage.html#mplayer

Yea. I grepped all that early this morning. :-/

However, you did mention the hvr-1950 device already feeds mencoder (or 
mplayer, or whatever application) an already completely muxed stream.

Which did spark an idea as to then, "Why am I using the following incantation 
of mencoder?"

mencoder 'dvb://KTVF DT:545028615:8VSB:65:68:4' -really-quiet -of avi \
  -ovc copy -oac copy -o /stored/tv/blah.mpg

I thought I was already merrily copying the stream as is (to save CPU cycles)?  
Should I use a different incantation?

Also, analog TV is pretty much gone here, if not totally gone.  So using cat 
/dev/video0 without an analog signal isn't really possible unless I feed 
something through the composite port.  Is there a way to simply 'cat' the DVB 
side?  (I thought I was using 'cat' at one time on the DVB side somehow?)

Anyways, I tried one of my old 2.6 kernels, a year old mplayer/mencoder version 
and nothing is in sync yet.  I'm starting to wonder if it is bad reception too 
at this point.  As sometimes stuff is in sync, then all of a sudden video 
unnoticibly slows, while audio advances.

I'll probably start Googling in another hour or so on the data I now have.

Cheers!

-- 
Roger
http://rogerx.freeshell.org/


More information about the pvrusb2 mailing list