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

Marc MERLIN marc_mplayer at merlins.org
Wed Aug 6 07:29:27 CEST 2014


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.

Is there a way to tell mplayer to ignore the time index and play past
whatever the file size was when it started playing?
Or should I use some other format than h264?

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

I think the problem is that I'm requesting the wrong audio format?
legolas:~$ arecord -D hw:2,0
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
arecord: set_params:1081: Sample format non available
Available formats:
- S16_LE

Any suggestions?

I have:
legolas:~$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: ALC3232 Analog [ALC3232 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Cx231xxAudio [Cx231xx Audio], device 0: Cx231xx Audio [Conexant cx231xx Capture]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/                         | PGP 1024R/763BE901


More information about the MPlayer-users mailing list