[MPlayer-users] Recording from tv:// isn't realtime

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Aug 11 21:04:08 CEST 2014


On Tue, Aug 05, 2014 at 10:29:27PM -0700, Marc MERLIN wrote:
> On Tue, Jul 29, 2014 at 08:37:18AM +0200, Reimar Döffinger wrote:
> > On Mon, Jul 28, 2014 at 11:21:01PM -0700, Marc MERLIN wrote:
> > > On Tue, Jul 29, 2014 at 07:59:27AM +0200, Reimar Döffinger wrote:
> > > > > My only 2 concerns left are:
> > > > > 1) sound is being recorded from my laptop's mic and not the tv input
> > > > > (while video is from the tv input)
> > > > 
> > > > Set adevice in the -tv option string.
> > >  
> > > Mmmh, I'm a bit confused about this.
> > > I tried:
> > > legolas:~$ time mencoder tv:// -tv driver=v4l2:norm=PAL:width=720:height=576:outfmt=uyvy:device=/dev/video1:input=0:fps=25:alsa:amode=1:forcechan=2:audiorate=48000:forceaudio:immediatemode=0:adevice=1.0 -ovc x264 -x264encopts threads=8:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid=normal:weight_b -oac mp3lame -lameopts cbr:br=128   -fps 25 -o test.avi
> > 
> > I think you want to check "arecord -l" to get the card/device number.
> > Then I am not sure but I think the syntax is e.g.
> > adevice=hw=1.0
> 
> Ok, sorry that it took me a while to get back to this.
> 
> First, playing the test.avi file as it's being written, just doesn't
> work.
> I got the closest with 
> mplayer  -cache 8192 -cache-min 1 -  < test.avi
> but that doesn't play past wherever the file was when it was opened.

There is no real difference between
mplayer  -cache 8192 -cache-min 1 -  < test.avi
and
mplayer  -cache 8192 -cache-min 1 test.avi
Only
cat test.avi | mplayer  -cache 8192 -cache-min 1 -
is actually different.
Except that you definitely do not want -cache n but -nocache.

> Is there a way to tell mplayer to ignore the time index and play past
> whatever the file size was when it started playing?

That's what it does by default, except for bugs.
And if it hits the end of file while e.g. reading in the cache
it won't retry either - that's why a large cache is a bad idea.
Replacing cat above with something like "tail -n +0 -f" might work
even better, but will make MPlayer not exit even at the real end
of the file.

> As for the sound, the syntax doesn't seem to work.
> legolas:~$ time mencoder tv:// -ovc x264 -x264encopts threads=8:subq=5:8x8dct:frameref=2:bframes=3:b_pyramid=normal:weight_b -oac mp3lame -lameopts cbr:br=128   -fps 25 -o test.avi -tv driver=v4l2:norm=PAL:width=720:height=576:outfmt=uyvy:device=/dev/video1:input=0:fps=25:alsa:amode=1:forcechan=2:audiorate=48000:forceaudio:immediatemode=0:adevice=hw=1.0
> gives
> v4l2: ioctl set format failed: Invalid argument
> Selected input hasn't got a tuner!
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM hw=1:0
> Error opening audio: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM hw=1:0
> Error opening audio: No such file or directory
> ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM hw=1:0
> Error opening audio: No such file or directory
> 
> 1.0 does get turned into 1:0, so that part is good.
> I tried adevice=hw=2.0 which should be my tv device, but any device
> I put gives me unknown PCM xxxx

This one (unfortunately) uses a different escaping from -ao.
I believe you should use
hw.1,0


More information about the MPlayer-users mailing list