[MPlayer-users] Capture tv using mencoder but no sound.

Per Mellander per.m at mmtab.se
Tue Dec 3 10:12:02 CET 2002


Hello!

I have been using mplayer for a pretty long time but I've never used mencoder 
for TV grabbing because of the lack of sound grabbing. As I understand it 
should be possible to capture sound now ( According to the DOC chapter 2.5 ). 
I can watch TV ( with sound ) using the regular commandline. I have the 
lineout/in cable connected from my Hauppauge WinTV Theater card to a Hercules 
Fortissimo II sound card, i use the regular kernel module for the soundcard.

I use MPlayer CVS from 2002-11-30 on a RH 7.3.

I didn't get any audio stream grabbing via the analog connection so I started 
to try with btaudio. I have inserted the module with the debug=1 option.

[root at arfineq root]# tail -f /var/log/messages
Dec  2 20:46:42 arfineq kernel: btaudio: driver version 0.6 loaded 
[digital+analog]
Dec  2 20:46:42 arfineq kernel: btaudio: Bt878 (rev 17) at 00:09.1, irq: 5, 
latency: 32, memory: 0xdb201000
Dec  2 20:46:42 arfineq kernel: btaudio: registered device dsp1 [digital]
Dec  2 20:46:42 arfineq kernel: btaudio: registered device dsp2 [analog]
Dec  2 20:46:42 arfineq kernel: btaudio: registered device mixer1

and whenever I use mencoder with the following options:

mencoder -tv 
on:driver=v4l:device=/dev/video0:width=384:height=288:channel=46:adevice=/dev/
dsp1 -o /tmp/output.avi -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900 -oac 
mp3lame -lameopts cbr:br=32 -endpos 00:00:01 -v

This results in:

---8<--------- snipp ---
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
dec_audio: Allocating 2048 + 65536 = 67584 bytes for output buffer
Unknown/missing audio format -> no sound
uninit audio: pcm
ADecoder init failed :(
---8<--------- snipp ---

And in /var/log/messages I get:

Dec  2 20:46:58 arfineq kernel: btaudio: open digital dsp [19]
Dec  2 20:46:58 arfineq kernel: btaudio: stereo=0 channels=1

Apparantly mencoder is opening the audio device but nothing more happens. I 
can hear sound in my speakers but that seems to come from the line cable.

I also get:
---8<--------- snipp ---
 Audio devices: 1
Video capture card reports the audio setup as follows:
  0: TV: muted=yes vol=0 bass=32768 treble=32768 balance=32768 mode=unknown 
chan=0
ioctl dsp getfmt: 0
Supported formats: 10
ioctl dsp setfmt: 0
ioctl dsp stereo: 0 (req: 0)
ioctl dsp speed: 0
ioctl dsp trigger: -1
trigger: 7d00
ioctl dsp trigger: -1
Unable to set trigger: 1
ioctl dsp getblocksize: 0
blocksize: 4096
Audio capture - buffer 256 blocks of 4096 bytes, skew average from 16 meas.
---8<--------- snipp ---

Which should mean that the audio is muted. But whatever I try it remains 
muted. I can do a:

sox -w -r 32000 -t ossdsp /dev/dsp2 -t ossdsp /dev/dsp

and hear the sound from the tv card.

I've tried a lot of aumix -d /dev/mixer1 options to set the volume etc. It 
reports three different line objects, Line1 to Line3 which are unmuted but 
with volume set to zero at 'modprobe' time. Is there another way of setting 
the mixer values.

I can run mencoder with :noaudio and get a good grabbing of the video stream 
at 25fps.

I have a AMD 1GHz, 512MB on a Kinetiz mobo.

Does anyone have an idea?

/Mel


==========================================================================
Here follows the complete log:

MEncoder CVS-021130-21:11-2.96 (C) 2000-2002 Arpad Gereoffy (see DOCS!)

CPU: Advanced Micro Devices Athlon TB Thunderbird (Family: 6, Stepping: 2)
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Reading /root/.mplayer/codecs.conf: 47 audio & 114 video codecs
File not found: 'frameno.avi'
get_path('font/font.desc') -> '/root/.mplayer/font/font.desc'
Font /root/.mplayer/font/font.desc loaded successfully! (206 chars)
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
success: format: 0  data: 0x0 - 0x0
Detected TV! ;-)
Selected driver: v4l
 name: Video 4 Linux input
 author: Alex Beregszaszi <alex at naxine.org>
 comment: under development
Selected device: BT878(Hauppauge (bt878))
 Capabilites: capture tuner overlay clipping frameram scales
 Device type: 235
 Supported sizes: 48x32 => 924x576
 Inputs: 4
  0: Television: tuner audio tv camera  (tuner:1, norm:pal)
  1: Composite1: audio camera  (tuner:0, norm:pal)
  2: S-Video: audio camera  (tuner:0, norm:pal)
  3: Composite3: audio camera  (tuner:0, norm:pal)
mbuf: size=68157440, frames=32
 Audio devices: 1
Video capture card reports the audio setup as follows:
  0: TV: muted=yes vol=0 bass=32768 treble=32768 balance=32768 mode=unknown 
chan=0
ioctl dsp getfmt: 0
Supported formats: 10
ioctl dsp setfmt: 0
ioctl dsp stereo: 0 (req: 0)
ioctl dsp speed: 0
ioctl dsp trigger: -1
trigger: 7d00
ioctl dsp trigger: -1
Unable to set trigger: 1
ioctl dsp getblocksize: 0
blocksize: 4096
Audio capture - buffer 256 blocks of 4096 bytes, skew average from 16 meas.
Using input 'Television'
Tuner (Television) range: 0 -> 4294967295
Selected norm: pal
Tuner (Television) range: 0 -> 4294967295
Requested width: 384
Requested height: 288
Selected channel list: europe-east (including 133 channels)
Requested channel: 46
Selected channel: 46 (freq: 671.250)
requested frequency: 671.250
Current frequency: 10740 (671.250)
Current frequency: 10740 (671.250)
==> Found video stream: 0
Output format: Planar YV12
Audio capture - buffer 256 blocks of 4096 bytes, skew average from 16 meas.
==> Found audio stream: 0
  TV audio: 0 channels, 16 bits, 44100 Hz
Picture values:
 Depth: 12, Palette: yuv420p (Format: Planar YV12)
 Brightness: 32768, Hue: 32768, Colour: 32512, Contrast: 27648
Audio capture - buffer 256 blocks of 4096 bytes, skew average from 16 meas.
Video buffer shorter than 3 times audio frame duration.
You will probably experience heavy framedrops.
Allocating a ring buffer for 1587 frames, 251 MB total size.
Enabling tv audio. Requested setup is:
id=0 vol=60000 bass=32768 treble=32768 balance=32768 mode=unknown chan=0
[V] filefmt:9  fourcc:0x32315659  size:384x288  fps:25.00  ftime:=0.0400
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
dec_audio: Allocating 2048 + 65536 = 67584 bytes for output buffer
Unknown/missing audio format -> no sound
uninit audio: pcm
ADecoder init failed :(
get_path('codecs.conf') -> '/root/.mplayer/codecs.conf'
*** Try to upgrade /root/.mplayer/codecs.conf from etc/codecs.conf
*** If it still does not work, read DOCS/codecs.html!
Can't find codec for audio format 0x1!
==========================================================================
Opening video filter: [expand=-1:-1:-1:-1:1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 384 x 288 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (384x288->384x288,flags=0,'MPlayer',0x32315659)
REQ: flags=0x401  req=0x0
videocodec: libavcodec (384x288 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, 384x288x12bpp YUV planar, 165888 bytes
*** [lavc] Allocating mp_image_t, 384x288x12bpp YUV planar, 165888 bytes
Pos:   0.1s      3f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [0:0] A/Vms 
0/9 D/B/S 0/0/0
video capture thread: frame delta ~ 12.1 fps

video capture thread: frame delta ~ 745.7 fps
Pos:   0.3s      5f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [0:0] A/Vms 
0/10 D/B/S 3/0/0
video capture thread: frame delta ~ 8.6 fps
Pos:   1.0s     23f ( 0%)  21fps Trem:   0min   0mb  A-V:0.000 [4323:0] A/Vms 
0/11 D/B/S 4/1/1
Writing AVI index...
Fixup AVI header...

Video stream: 4323.800 kbit/s  (540474 bps)  size: 562094 bytes  1.040 secs  
23 frames
uninit video: raw
DEMUXER: freeing demuxer at 0x82df000
Waiting for threads to finish... done
DEMUXER: freeing sh_audio at 0x82d96e8
DEMUXER: freeing sh_video at 0x82dfdc0

==================================================================





More information about the MPlayer-users mailing list