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

Marc MERLIN marc_mplayer at merlins.org
Tue Jul 29 08:21:01 CEST 2014


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
MPlayer SVN-r36533 (C) 2000-2012 MPlayer Team
success: format: 9  data: 0x0 - 0x0
TV file format detected.
Selected driver: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski at zpr.uni-koeln.de>
 comment: first try, more to come ;-)
Selected device: Geniatech OTG102
 Capabilities:  video capture  VBI capture device  read/write  streaming
 supported norms: 0 = NTSC; 1 = NTSC-M; 2 = NTSC-M-JP; 3 = NTSC-M-KR; 4 = NTSC-443; 5 = PAL; 6 = PAL-BG; 7 = PAL-H; 8 = PAL-I; 9 = PAL-DK; 10 = PAL-M; 11 = PAL-N; 12 = PAL-Nc; 13 = PAL-60; 14 = SECAM; 15 = SECAM-B; 16 = SECAM-G; 17 = SECAM-H; 18 = SECAM-DK; 19 = SECAM-L; 20 = SECAM-Lc;
 inputs: 0 = Composite1; 1 = S-Video;
 Current input: 0
 Current format: YUYV
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 1:0
Error opening audio: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM 1:0
Error opening audio: No such file or directory
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM 1:0
Error opening audio: No such file or directory
v4l2: 0 frames successfully processed, 0 frames dropped.

adevice=2.0 does not work any better.

legolas:~# cat /proc/asound/devices 
  1:        : sequencer
  2: [29]   : control
  3: [ 0]   : control
  4: [ 0- 3]: digital audio playback
  5: [ 0- 7]: digital audio playback
  6: [ 0- 8]: digital audio playback
  7: [ 0- 0]: hardware dependent
  8: [ 1]   : control
  9: [ 1- 0]: digital audio playback
 10: [ 1- 0]: digital audio capture
 11: [ 1- 0]: hardware dependent
 12: [ 2]   : control
 13: [ 2- 0]: digital audio capture <<<  this is my capture card
 33:        : timer

What am I doing wrong?

> > 2) I would love to be able to play this output file in near realtime
> > while it's being recorded, but mplayer will only play the amount of file
> > that was saved at the moment I started mplayer
> 
> As far as I know this is a bug in old MPlayer versions only, SVN probably is not affected.
> Though you probably can work around it even there with e.g.
> tail -f video.avi | mplayer -
> or such.

I should have recent-ish svn. somehow plahing from - gives me a ludicrous kbps rate
and only plays 1 out of 2 second no matter how big my file actually is.

Is it a problem because h264 is not streamable?

legolas:~$ tail -n 10000 -f test.avi | mplayer -
MPlayer SVN-r36545 (C) 2000-2013 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing -.
Reading from stdin...

libavformat version 55.37.100 (internal)
AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1

Badly interleaved AVI file detected - switching to -ni mode...
VIDEO:  [h264]  720x576  24bpp  25.000 fps  16842864.0 kbps (2056013.6 kbyte/s)
Clip info:
 Software: MEncoder SVN-r36533
Load subtitles in ./
[VO_XV] Could not grab port 96.
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 55.58.103 (internal)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Forced audio codec: mad
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 48000 Hz, 2 ch, s16le, 128.0 kbit/8.33% (ratio: 16000->192000)
Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3)
==========================================================================
AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is 1.25:1 - prescaling to correct movie aspect.
VO: [xv] 720x576 => 720x576 Planar YV12  [zoom]
Cannot seek backward in linear streams!
Seek failed

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