[MPlayer-users] record from TV ( v4l ) with sound

Jindrich Makovicka makovick at kmlinux.fjfi.cvut.cz
Tue Oct 22 01:30:02 CEST 2002


Emmanuel Anne wrote:

>[Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
>On Mon, 21 Oct 2002, Jindrich Makovicka wrote:
>
>  
>
>>>mencoder -tv on:driver=v4l:width=480:height=200:input=0:outfmt=i420 -vc
>>>rawi420 -vop yuv2 -oac mp3lame -ovc divx4 -o file.avi
>>>      
>>>
>
>  
>
>>This is rather an issue of the KDE sound server. There's no reason why 
>>mencoder shouldn't work with half duplex cards when there's no other app 
>>holding /dev/dsp. But thanks for info anyway.
>>    
>>
>
>Yes but I have another issue here. I am new to this list so maybe you
>know it...
>
>When I try to cature some tv show with a line like this one in 388x284,
>mencoder writes that it encodes at 25fps. So it's at full speed, no
>problem here. But the problem is that it misses some frames.
>
>I don't really know why, but I could not find any way to preven it from
>loosing these frames. I even try differents video codecs to try to gain
>some speed, but I still misses these frames.
>
>On a side note, I have also the problem of sound in /dev/dsp with such a
>card. When a v4l card says it has no sound capability, mencoder simply
>disables sound, no matter what the options are. But this last problem is
>probably known already (you can work around it by changing the source to
>force it to encode sound, but it's not a perfect way to do it...).
>
>Any help/info is welcome here...
>  
>
The reason is that the timebases of CPU and soundcard are different. It 
means that per one second of CPU time the soundcard doesn't deliver 
44100 samples but some more or less. So after some time, there is a lack 
or excess of samples and mencoder has to deal with this and it does that 
by inserting an empty frame. There's actually no frame lost.

If you want to detect a frame which was really lost, you can use a -v 
option which will warn you any time when the interval of the consecutive 
captured frames differ from the expected value too much. The buffer 
ovderflows due to insufficient performance are also reported separately.

Regarding the sound problem, I could add an option, say, "force-audio" 
which will just force grabbing from the audio source.

I'll try to update the v4l docs, if I'll have some spare time.

Regards,

-- 
Jindrich Makovicka





More information about the MPlayer-users mailing list