[MPlayer-users] Recording sound from line-in when grabbing tv

JF L. jf.l at netcourrier.com
Tue Sep 9 23:32:58 CEST 2003


Hi,

I have a problem with mencoder and I don't find an answer searching all 
archives... I am able to grabb video from my v4l device (rivatv driver) but I 
can't record sound. The sound comes from line-in, so I tried to use 
"forceaudio" and "adevice" like this:

mencoder tv:// -tv 
driver=v4l:norm=SECAM:input=0:width=352:height=288:adevice=/dev/
dsp:forceaudio -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 -oac mp3lame  -o 
output.avi -v

or

mencoder tv:// -tv 
driver=v4l:norm=SECAM:input=0:width=352:height=288:adevice=hw.0:alsa:forceaudio 
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 -oac mp3lame  -o output.avi -v

because I am using alsa. But, for each case, when playing the movie, mplayer 
says "Audio: no sound". So I think this not a problem from my mixer because 
mplayer does not find the sound information in the movie, no ? I tested the 
configuration of my soundcard with /usr/bin/record and it works. I compiled 
frome source mplayer from MPlayer 1.0pre1-3.3.1. I added the log of what each 
command does. At the end, there is the result of ./configure (maybe some 
option of my compilation are wrong).

Any idea ?

Thanks,

JFL
---
Playing (mplayer says: No sound !):

jf at jf:~/swap> mplayer output.avi
MPlayer 1.0pre1-3.3.1 (C) 2000-2003 MPlayer Team

CPU: Advanced Micro Devices Duron SF Spitfire (Family: 6, Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx

Reading config file /usr/local/etc/mplayer/mplayer.conf
Reading config file /home/jf/.mplayer/config
Reading /home/jf/.mplayer/codecs.conf: Can't open '/home/jf/.mplayer/
codecs.conf': Aucun fichier ou répertoire de ce type
Reading /usr/local/etc/mplayer/codecs.conf: This codecs.conf is too old and 
incompatible with this MPlayer release! at line 6
Using built-in default codecs.conf
font: can't open file: /home/jf/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission non accordée
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system 
startup scripts.
Using usleep() timing
Can't open input config file /home/jf/.mplayer/input.conf: Aucun fichier ou 
répertoire de ce type
Can't open input config file /usr/local/etc/mplayer/input.conf: Aucun fichier 
ou répertoire de ce type
Falling back on default (hardcoded) input config

Playing output.avi
AVI file format detected.
AVI_NI: No audio stream found -> no sound.
AVI: No audio stream found -> no sound.
VIDEO:  [DIVX]  352x288  24bpp  25,000 fps  681,0 kbps (83,1 kbyte/s)
Clip info:
 Software: MEncoder 1.0pre1-3.3.1
vo: X11 running at 1280x1024 with depth 24 and 32 bpp (":0" => local display)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
This file was encoded with libavcodec build 4677
VDec: vo config request - 352 x 288 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1,22:1 - prescaling to correct movie aspect.
VO: [xv] 352x288 => 352x288 Planar YV12
V:   1,2   32  27%  6%  0,0% 0 0 0%
Exiting... (Quit)


---
mencoder tv:// -tv 
driver=v4l:norm=SECAM:input=0:width=352:height=288:adevice=/dev/
dsp:forceaudio -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 -oac mp3lame  -o 
output.avi -v

it gives:

f at jf:~/swap> mencoder tv:// -tv 
driver=v4l:norm=SECAM:input=0:width=352:height=288:adevice=/dev/
dsp:forceaudio -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 -oac mp3lame  -o 
output.avi -v
MEncoder 1.0pre1-3.3.1 (C) 2000-2003 MPlayer Team

CPU: Advanced Micro Devices Duron SF Spitfire (Family: 6, Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx

Reading /home/jf/.mplayer/codecs.conf: Can't open '/home/jf/.mplayer/
codecs.conf': Aucun fichier ou répertoire de ce type
Reading /usr/local/etc/mplayer/codecs.conf: This codecs.conf is too old and 
incompatible with this MPlayer release! at line 6
Using built-in default codecs.conf
AVI file format detected.
AVI_NI: No audio stream found -> no sound.
AVI: No audio stream found -> no sound.
VIDEO:  [FrNo]  352x288  24bpp  25,000 fps    0,8 kbps ( 0,1 kbyte/s)
Using pass3 control file: frameno.avi
Reading config file /home/jf/.mplayer/mencoder: Aucun fichier ou répertoire de 
ce type
get_path('font/font.desc') -> '/home/jf/.mplayer/font/font.desc'
font: can't open file: /home/jf/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
STREAM: [null] tv://
STREAM: Description: Null stream
STREAM: Author: Albeu
STREAM: Comment:
success: format: 9  data: 0x0 - 0x0
TV detected! ;-)
Selected driver: v4l
 name: Video 4 Linux input
 author: Alex Beregszaszi
 comment: under development
Selected device: rivatv video
 Capabilites: capture overlay chromakey
 Device type: 25
 Supported sizes: 64x32 => 704x576
 Inputs: 2
  0: Composite:  (tuner:0, norm:auto)
  1: S-Video:  (tuner:0, norm:auto)
mbuf: size=6635520, frames=4
ioctl dsp getfmt: 0
Supported formats: 1f9
ioctl dsp setfmt: 0
ioctl dsp stereo: 0 (req: 1)
ioctl dsp speed: 0
ioctl dsp trigger: 0
trigger: 1
ioctl dsp trigger: 0
ioctl dsp getblocksize: 0
blocksize: 4096
audio block size too low, setting to 16384!
Audio capture - buffer 256 blocks of 16384 bytes, skew average from 16 meas.
Using input 'Composite'
Selected norm: SECAM
Requested width: 352
Requested height: 288
Selected input hasn't got a tuner!
==> Found video stream: 0
Output format: Planar YV12
Picture values:
 Depth: 12, Palette: yuv420p (Format: Planar YV12)
 Brightness: 32767, Hue: 32767, Colour: 32767, Contrast: 24576
Using a ring buffer for maximum 1301 frames, 188 MB total size.
[V] filefmt:9  fourcc:0x32315659  size:352x288  fps:25,00  ftime:=0,0400
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 352 x 288 (preferred csp: Planar YV12)
Trying filter chain: expand lavc
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (352x288->352x288,flags=0,'MPlayer',0x32315659)
REQ: flags=0x401  req=0x0
videocodec: libavcodec (352x288 fourcc=58564944 [DIVX])
Selected video codec: [rawyv12] vfm:raw (RAW YV12)
==========================================================================
Writing AVI header...
Forcing audio preload to 0, max pts correction to 0
*** [expand] Exporting mp_image_t, 352x288x12bpp YUV planar, 152064 bytes
*** [lavc] Allocating mp_image_t, 352x288x12bpp YUV planar, 152064 bytes
ds_fill_buffer: EOF reached (stream: video)     0mb  A-V:0,000 [681:0] A/Vms 
0/23 D/B/S 5/1/1
Pos:   8,8s    215f ( 0%)  24fps Trem:   0min   0mb  A-V:0,000 [681:0] A/Vms 
0/24 D/B/S 5/1/1
Writing AVI index...
Fixing AVI header...

Video stream:  681,041 kbit/s  (85130 bps)  size: 745740 bytes  8,760 secs  
215 frames
uninit video: raw
DEMUXER: freeing demuxer at 0x848ee78
Waiting for threads to finish...   MJP: returning!
done
DEMUXER: freeing sh_video at 0x848fb70



OR (for trying with alsa):


mencoder tv:// -tv 
driver=v4l:norm=SECAM:input=0:width=352:height=288:adevice=hw.0:alsa:forceaudio 
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 -oac mp3lame  -o output.avi -v

it gives:

jf at jf:~/swap> mencoder tv:// -tv 
driver=v4l:norm=SECAM:input=0:width=352:height=288:adevice=hw.0:alsa:forceaudio:amode=0:audioid=0 
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 -oac copy  -o test1.avi -v
MEncoder 1.0pre1-3.3.1 (C) 2000-2003 MPlayer Team

CPU: Advanced Micro Devices Duron SF Spitfire (Family: 6, Stepping: 1)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx

Reading /home/jf/.mplayer/codecs.conf: Can't open '/home/jf/.mplayer/
codecs.conf': Aucun fichier ou répertoire de ce type
Reading /usr/local/etc/mplayer/codecs.conf: This codecs.conf is too old and 
incompatible with this MPlayer release! at line 6
Using built-in default codecs.conf
AVI file format detected.
AVI_NI: No audio stream found -> no sound.
AVI: No audio stream found -> no sound.
VIDEO:  [FrNo]  352x288  24bpp  25,000 fps    0,8 kbps ( 0,1 kbyte/s)
Using pass3 control file: frameno.avi
Reading config file /home/jf/.mplayer/mencoder: Aucun fichier ou répertoire de 
ce type
get_path('font/font.desc') -> '/home/jf/.mplayer/font/font.desc'
font: can't open file: /home/jf/.mplayer/font/font.desc
font: can't open file: /usr/local/share/mplayer/font/font.desc
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
STREAM: [null] tv://
STREAM: Description: Null stream
STREAM: Author: Albeu
STREAM: Comment:
success: format: 9  data: 0x0 - 0x0
TV detected! ;-)
Selected driver: v4l
 name: Video 4 Linux input
 author: Alex Beregszaszi
 comment: under development
Selected device: rivatv video
 Capabilites: capture overlay chromakey
 Device type: 25
 Supported sizes: 64x32 => 704x576
 Inputs: 2
  0: Composite:  (tuner:0, norm:auto)
  1: S-Video:  (tuner:0, norm:auto)
mbuf: size=6635520, frames=4
Hardware PCM card 0 'Sound Blaster Live!' device 0 subdevice 0

Its setup is:
stream       : CAPTURE
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 16384
period_size  : 8192
period_time  : 185759
tick_time    : 10000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 8192
xfer_align   : 8192
start_threshold  : 0
stop_threshold   : 16384
silence_threshold: 0
silence_size : 0
boundary     : 1073741824
Audio capture - buffer 256 blocks of 32768 bytes, skew average from 16 meas.
Using input 'Composite'
Selected norm: SECAM
Requested width: 352
Requested height: 288
Selected input hasn't got a tuner!
==> Found video stream: 0
Output format: Planar YV12
Picture values:
 Depth: 12, Palette: yuv420p (Format: Planar YV12)
 Brightness: 32767, Hue: 32767, Colour: 32767, Contrast: 24576
Using a ring buffer for maximum 1301 frames, 188 MB total size.
[V] filefmt:9  fourcc:0x32315659  size:352x288  fps:25,00  ftime:=0,0400
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 352 x 288 (preferred csp: Planar YV12)
Trying filter chain: expand lavc
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (352x288->352x288,flags=0,'MPlayer',0x32315659)
REQ: flags=0x401  req=0x0
videocodec: libavcodec (352x288 fourcc=58564944 [DIVX])
Selected video codec: [rawyv12] vfm:raw (RAW YV12)
==========================================================================
Writing AVI header...
Forcing audio preload to 0, max pts correction to 0
*** [expand] Exporting mp_image_t, 352x288x12bpp YUV planar, 152064 bytes
*** [lavc] Allocating mp_image_t, 352x288x12bpp YUV planar, 152064 bytes

video capture thread: frame delta ~ 17,7 fps
ds_fill_buffer: EOF reached (stream: video)     0mb  A-V:0,000 [738:0] A/Vms 
0/44 D/B/S 5/1/1
Pos:   8,8s    215f ( 0%)  19fps Trem:   0min   0mb  A-V:0,000 [739:0] A/Vms 
0/44 D/B/S 5/1/1
Writing AVI index...
Fixing AVI header...

Video stream:  739,108 kbit/s  (92388 bps)  size: 809323 bytes  8,760 secs  
215 frames
uninit video: raw
DEMUXER: freeing demuxer at 0x848ef28
Waiting for threads to finish...   MJP: returning!
done
DEMUXER: freeing sh_video at 0x84978d0


---
My System:

Debian
kernel 2.4.22
v4l + patch v4l2
Live 5.1
GeForce 4 + rivatv for grabbing video

---
CONFIG OF COMPILATION

Config files successfully generated by ./configure !

  Install prefix: /usr/local
  Data directory: /usr/local/share/mplayer
  Config direct.: /usr/local/etc/mplayer

  Byte order: Little Endian
  Optimizing for: athlon mmx mmx2 3dnow 3dnowex mtrr

  Languages:
    Messages/GUI: en
    Manual pages: en (no localization selected, use --language=all)

  Enabled optional drivers:
    Input: ftp network tv-v4l2 tv-v4l edl tv mpdvdkit2 vcd
    Codecs: qtx divx5linux xvid libavcodec real xanim dshow/dmo win32 faad2 
libvorbis
    Audio output: alsa9 oss nas mpegpes(file)
    Video output: xvidix vesa png mpegpes(file) fbdev dga xv x11 xover tga
  Disabled optional drivers:
    Input: tv-bsdbt848 live.com matroska cdda dvdread dvdcss smb
    Codecs: divx4linux libdv libtheora libmad liblzo gif
    Audio output: sgi sun esd arts dxr2 win32 sdl macosx
    Video output: bl zr dxr3 dxr2 directx sdl gif89a jpeg svga aa ggi xmga mga 
opengl xvmc directfb tdfx_vid tdfxfb 3dfx





More information about the MPlayer-users mailing list