[MPlayer-users] Capturing audio from sound card line input

Mark Zimmerman mark at foresthaven.com
Fri May 27 16:41:25 CEST 2005


Greetings:

The documentation says that I should be able to capture audio from
sound card line input when recording from tv but I have not been able
to find the mencoder options that actually make this happen. Video
is captured properly but there is no audio in the resulting file
(mplayer reports 'Audio: no sound').

I know the hardware works because I can do arecord / aplay with
success.

Command line and console output follows.

Thanks,
-- Mark

mencoder -v -tv \
driver=v4l2:device=/dev/video1:input=2:normid=0:brightness=60:contrast=25:hue=99:saturation=55:outfmt=bgr24:width=640:height=480:alsa \
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 \
-oac mp3lame -lameopts cbr:br=64 \
-vf pp=lb -o test.avi tv://


MEncoder 1.0pre7-3.3.5 (C) 2000-2005 MPlayer Team
CPU: Intel Pentium 4/Xeon/Celeron Foster (Family: 8, Stepping: 9)
Detected cache-line size is 64 bytes
CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2

File not found: 'frameno.avi'
Failed to open frameno.avi
init_freetype
get_path('font/font.desc') -> '/home/mark/.mplayer/font/font.desc'
Font /home/mark/.mplayer/font/font.desc loaded successfully! (206 chars)
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: v4l2
 name: Video 4 Linux 2 input
 author: Martin Olschewski <olschewski at zpr.uni-koeln.de>
 comment: first try, more to come ;-)
Selected device: pcHDTV HD3000 HDTV
 Tuner cap: STEREO LANG2
 Tuner rxs: STEREO
 Capabilites:  video capture  VBI capture device  tuner  read/write  streaming
 supported norms: 0 = NTSC-M; 1 = NTSC-JP; 2 = PAL-BG; 3 = PAL-DK; 4 = PAL-I; 5 = PAL-M; 6 = PAL-N; 7 = PAL-Nc; 8 = PAL-60; 9 = SECAM-L; 10 = SECAM-DK;
 inputs: 0 = Television; 1 = Composite1; 2 = S-Video;
 Current input: 2
 Format GREY   ( 8 bits, 8 bpp, gray): Planar Y800
 Format RGB555 (16 bits, 15 bpp RGB, le): RGB 15-bit
 Format RGB555X (16 bits, 15 bpp RGB, be): Unknown
 Format RGB565 (16 bits, 16 bpp RGB, le): RGB 16-bit
 Format RGB565X (16 bits, 16 bpp RGB, be): Unknown
 Format BGR24  (24 bits, 24 bpp RGB, le): BGR 24-bit
 Format BGR32  (32 bits, 32 bpp RGB, le): BGRA
 Format RGB32  (32 bits, 32 bpp RGB, be): RGBA
 Format YUYV   (16 bits, 4:2:2, packed, YUYV): Packed YUY2
 Format UYVY   (16 bits, 4:2:2, packed, UYVY): Packed UYVY
 Current format: BGR24
v4l2: current audio mode is : MONO
Plug PCM: Route conversion PCM (sformat=S32_LE)
Transformation table:
0 <- 0*0.5 + 1*0.5
Its setup is:
stream       : CAPTURE
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 1
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 16
buffer_size  : 32768
period_size  : 8192
period_time  : 185759
tick_time    : 1000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 8192
xfer_align   : 8192
start_threshold  : 0
stop_threshold   : 32768
silence_threshold: 0
silence_size : 0
boundary     : 1073741824
Slave: Hardware PCM card 0 'AMP Ltd AUDIO2000' device 0 subdevice 0

Its setup is:
stream       : CAPTURE
access       : MMAP_INTERLEAVED
format       : S32_LE
subformat    : STD
channels     : 2
rate         : 44100
exact rate   : 44100 (44100/1)
msbits       : 24
buffer_size  : 32768
period_size  : 8192
period_time  : 185759
tick_time    : 1000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 8192
xfer_align   : 8192
start_threshold  : 0
stop_threshold   : 32768
silence_threshold: 0
silence_size : 0
boundary     : 1073741824
==================================================================
 WARNING: UNTESTED OR UNKNOWN OUTPUT IMAGE FORMAT REQUESTED (0x42475218)
 This may cause buggy playback or program crash! Bug reports will
 be ignored! You should try again with YV12 (which is the default
 colorspace) and read the documentation!
==================================================================
v4l2: set format: BGR24
v4l2: set input: 2
Selected norm id: 0
v4l2: set norm: NTSC-M
v4l2: set width: 640
v4l2: set height: 480
Selected channel list: europe-east (including 133 channels)
Current frequency: 0 (0.000)
==> Found video stream: 0
v4l2: get format: BGR24
v4l2: get fps: 29.000000
v4l2: get width: 640
v4l2: get height: 480
Audio capture - buffer 256 blocks of 16384 bytes, skew average from 16 meas.
Using a ring buffer for maximum 575 frames, 505 MB total size.
v4l2: set Brightness: 153 [0, 255]
v4l2: set Hue: 252 [0, 255]
v4l2: set Saturation: 140 [0, 255]
v4l2: set Contrast: 63 [0, 255]
[V] filefmt:9  fourcc:0x42475218  size:640x480  fps:29.00  ftime:=0.0345
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
Opening video filter: [pp=lb]
[expand] query(Planar YV12) -> 1
[expand] query(Planar I420) -> 1
[expand] query(Planar IYUV) -> 1
[expand] query(Planar 444P) -> 0
[expand] query(Planar 422P) -> 0
[expand] query(Planar 411P) -> 0
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 640 x 480 (preferred csp: BGR 24-bit)
[PP] Using external postprocessing filter, max q = 6.
Trying filter chain: pp expand lavc
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
SwScale params: -1 x -1 (-1=no scaling)
Trying filter chain: scale pp expand lavc
VDec: using BGR 24-bit as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (640x480->640x480,flags=0,'MPlayer',0x42475218)
SwScaler: using unscaled BGR 24-bit -> Planar YV12 special converter
REQ: flags=0xC01  req=0x0  
REQ: flags=0x401  req=0x0  
REQ: flags=0x401  req=0x0  
videocodec: libavcodec (640x480 fourcc=34504d46 [FMP4])
Selected video codec: [rawbgr24] vfm:raw (RAW BGR24)
==========================================================================
Writing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Forcing audio preload to 0, max pts correction to 0
v4l2: going to capture
*** [scale] Exporting mp_image_t, 640x480x24bpp BGR packed, 921600 bytes
*** [pp] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
*** [lavc] Allocating mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
*** [expand] Direct Rendering mp_image_t, 640x480x12bpp YUV planar, 460800 bytes
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Pos:   7.5s    207f ( 0%)  30fps Trem:   0min   0mb  A-V:0.000 [960:0] A/Vms 0/9 D/B/S 11/0/0 Pos:   7.6s    208f ( 0%)  30fps Trem:   0min   0mb  A-V:0.000 [961:0] A/Vms 0/9 D/B/S 11/0/0 
Flushing video frames

Writing AVI index...
Fixing AVI header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.

Video stream:  961.734 kbit/s  (120216 bps)  size: 907844 bytes  7.552 secs  208 frames
uninit video: raw
v4l2: 210 frames successfully processed, 0 frames dropped.
v4l2: up to 1 video frames buffered.




More information about the MPlayer-users mailing list