[MPlayer-users] Matrox G200 mjpeg capture with MEncoder 1.0pre2

Mauriat Miranda lists at mjmwired.net
Tue Feb 24 22:45:46 CET 2004


Hi,

I have a Matrox Marvel G200 which I'm using to capture TV input.

What is the proper procedure in initializing the card so that the 
capture will work correctly?

It captures correctly using 'lavrec' from mjpegtools. If I run mencoder 
BEFORE lavrec, it won't work. If I run mencoder AFTER lavrec, it will work.

What am I missing? Does anyone else have this problem? I didn't find 
anything similar in the docs, man, or mailing lists arch.

# mencoder <SNIP> tv://4 -tv 
driver=v4l:input=2:norm=ntsc:chanlist=us-cable:mjpeg:decimation=2:quality=40 


ends with this error:

   MJP: ioctl MJPIOC_QBUF_CAPT failed: Invalid argument

Syslog reports the following, when I run the above command:

mgagrab: get_format failed
mgacore: no sub-handler for VIRQ 0x0 to remove!
tuner: TV freq (0.00) out of range (44-958)

----

I have both mgavideo-0.1.1b and mjpegtools-1.6.2. mgavideo provides a 
set of drivers which I have loaded in order to get mjpegtools to work. 
They DO work.

IF I run lavrec first, mencoder WORKS! I can't figure out what changed. 
No extra modules load when 'lavrec' is called.

[root at proteus]# lavrec -f q -i T -d 2 -g 672x448 -q 40 -C us-cable:4 -t 
1 -s -R l -U /root/test.qt
<SNIP, correct>

[root at proteus root]# mencoder -ovc lavc -lavcopts 
vcodec=mpeg4:vhq:vbitrate=1000:aspect=1.333 -oac copy tv://4 -tv 
driver=v4l:input=2:norm=ntsc:chanlist=us-cable:mjpeg:decimation=2:quality=40:adevice=/dev/dsp:forceaudio:forcechan=1 
-endpos 10 -o test.avi
<SNIP, correct>
Using input 'Television'
ioctl set tuner failed: Invalid argument
   MJP: width 352 height 240
Selected channel: 4 (freq: 67.250)
   MJP: setting sh_video->format to mjpg
[V] filefmt:9  fourcc:0x67706A6D  size:352x240  fps:29.97  ftime:=0.0334
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1  (-1=autodetect) osd: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmjpeg] vfm:ffmpeg (FFmpeg MJPEG decoder)
==========================================================================
audiocodec: framecopy (format=1 chans=1 rate=44100 bits=16 bps=88200 
sample=2)
Writing AVI header...
Forcing audio preload to 0, max pts correction to 0
   MJP: gonna capture !
<SNIP>
   MJP: returning!

I cannot use 1.0pre3 since there is a bug in decoding libquicktime 
movies (mjpegtools quicktime qt movies). If mjpegtools could record to 
divx, I would it instead. I want the compression feature of mencoder.

I attached the full output when it does NOT run. Also below is a snippet 
of the dmesg and my modules output.

Suggestions? Ideas? Any help appreciated.

-Mauriat



Relevant Information:

--------------------

MEncoder 1.0pre2-3.2 (C) 2000-2003 MPlayer Team
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
lspci: 01:05.0 VGA compatible controller: Matrox Graphics, Inc. MGA G200 
AGP (rev 01)
kernel: 2.4.20 (with ACPI, with preempt)

--------------------

[root at proteus root]# mencoder -ovc lavc -lavcopts 
vcodec=mpeg4:vhq:vbitrate=1000:aspect=1.333 -oac copy tv://4 -tv 
driver=v4l:input=2:norm=ntsc:chanlist=us-cable:mjpeg:decimation=2:quality=40:adevice=/dev/dsp:forceaudio:forcechan=1 
-endpos 10 -o test.avi
MEncoder 1.0pre2-3.2 (C) 2000-2003 MPlayer Team

CPU: Advanced Micro Devices Athlon Thunderbird 858.9 MHz (Family: 6, 
Stepping: 2)
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 /root/.mplayer/codecs.conf: Can't open 
'/root/.mplayer/codecs.conf': No such file or directory
Reading /usr/local/etc/mplayer/codecs.conf: Can't open 
'/usr/local/etc/mplayer/codecs.conf': No such file or directory
Using built-in default codecs.conf
File not found: 'frameno.avi'
Failed to open frameno.avi
Reading config file /root/.mplayer/mencoder: No such file or directory
success: format: 9  data: 0x0 - 0x0
TV detected! ;-)
Selected driver: v4l
  name: Video 4 Linux input
  author: Alex Beregszaszi
  comment: under development
Selected device: mgacap-0
  Capabilites: capture tuner overlay chromakey scales mjpeg-decoder 
mjpeg-encoder
  Device type: 12443
  Supported sizes: 8x8 => 800x600
   MJP: previous params: x: 8, y: 0, w: 704, h: 240, decim: 2, fields: 1,
   MJP: HorDcm: 2, VerDcm: 1, TmpDcm: 2
   MJP: setting params to decimation: 2, quality: 40
   MJP: current params: x: 8, y: 0, w: 704, h: 240, decim: 2, fields: 1,
   MJP: HorDcm: 2, VerDcm: 1, TmpDcm: 2
   MJP: Got 64 buffers of size 256 KB
  Inputs: 3
   0: Composite:  (tuner:0, norm:pal)
   1: S-Video:  (tuner:0, norm:pal)
   2: Television: tuner tv  (tuner:1, norm:pal)
audio block size too low, setting to 8192!
Using input 'Television'
ioctl set tuner failed: Invalid argument
Error: Cannot set norm!

   MJP: ioctl MJPIOC_QBUF_CAPT failed: Invalid argument
============ Sorry, this file format is not recognized/supported 
=============
=== If this file is an AVI, ASF or MPEG stream, please contact the 
author! ===
Cannot open demuxer.
Exiting...

--------------------

i2c-core.o: i2c core module
i2c-algo-ks.o: i2c bit algorithm module version 2.6.1 (20010830)
Matrox core interface v0.1 (c) David Barth
mgacore: Found MGA G200 AGP
mgacore: 16 MB detected
mgacore: PCI IRQ 11 handler registered
mgacodec: *mga @ d18d7b40
  i2c-algo-ks.o: scanning bus mgai2c.
(00)..........................(1b)....................................(40)................................(61)...........(6d)..................
msp34xx: init: chip=MSP3430G-A1, has NICAM support
msp3400: daemon started
maven: attach: tv-out
ks0127: attach: on-board video decoder
tuner: probing mgai2c i2c adapter [id=0x10005]
tuner: chip found @ 0xc2
Matrox Marvel and Rainbow Runner G Capture Driver (V4L)
Matrox KS switchboard
Matrox MJPEG driver
Matrox Marvel and Rainbow Runner G Capture Driver (V4L1)

--------------------

mgajpg                  9524   0
i33                     8276   0  [mgajpg]
zr36060                15280   0  [mgajpg i33]
mgavideo                9768   0  [mgajpg i33]
mgacap                  8340   0  [mgajpg]
mgagrab                13424   1  [mgavideo mgacap]
mga_core               54152   4  [mgajpg i33 zr36060 mgavideo mgacap 
mgagrab]
tuner                  11680   1
ks0127                 11808   1
maven                   8060   1
msp3400                16364   1
i2c-algo-ks             8264   1  [mga_core]
i2c-core               19140   0  [tuner ks0127 maven msp3400 i2c-algo-ks]

--------------------




More information about the MPlayer-users mailing list