[MPlayer-dev-eng] Supporting Plextor PX-TV402U for mencoder

Brad Clements bkc at murkworks.com
Thu Jun 9 15:45:17 CEST 2005


Greetings,

I would like to add support for the PX-TV402U so I can use mencoder to 
record from it.

I have MEncoder dev-CVS-050606-18:51-3.4.3

I've been looking at the mplayer source, and trying to figure out where I 
should insert new code to support this device.

First, a summary of the device, here's text pasted from the GO7007 
driver README file:

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

The V4L2 device implemented by the driver provides a standard 
compressed format API, within the following criteria:  

  * Applications that only support the original Video4Linux1 API will not
    be able to communicate with this driver at all.

  * No raw video modes are supported, so applications like xawtv that
    expect only uncompressed video will not function.

  * Supported compression formats are: Motion-JPEG, MPEG1, MPEG2 
and MPEG4.

  * MPEG video formats are delivered as Video Elementary Streams only.
    Program Stream (PS), Transport Stream (TS) and Packetized 
Elementary
    Stream (PES) formats are not supported.

  * Video parameters such as format and input port may not be changed 
while
    the encoder is active.

  * The audio capture device only functions when the video encoder is
    actively capturing video.  Attempts to read from the audio device when
    the encoder is inactive will result in an I/O error.

  * The native format of the audio device is 48Khz 2-channel 16-bit
    little-endian PCM, delivered through the ALSA system.  No audio
    compression is implemented in the hardware.  ALSA may convert to 
other
    uncompressed formats on the fly.

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

The quality of the output stream is controlled by setting the bitrate using  
a set of custom ioctls.

I think I need to:

a) provide parsing of additional command-line driver options to specify 
values to use with the custom ioctls

b) find the appropriate module and method to make those new ioctl calls 
from

c) add the appropriate #ifdef and autoconf sniffing for this device 


My objective is to be able to do something (roughly) like this:

mencoder -tv 
driver=v4l2:norm=ntsc:input=2:channel=4:device=/dev/video0:amode=0:
adevice=/dev/dsp1:
immediatemode=0:mjpeg:decimation=1 -ovc copy -oac lavc -o
 /tmp/test.avi tv://

Well, at least that's what I'm trying at the moment. 


That is, create either a DIVX/MPEG4 avi file, or MPEG1, MPEG2 or 
MPEG4 .mpg files with compressed audio.


It's not clear to me how I tell mencoder (in the code) the format of the 
video stream so that it can create the appropriate file header.

I don't know enough about the architecture of mencoder to "do the right 
thing" w/o spending a lot of time digging.

So, could someone provide a few hints as to where I should inject my 
code, and the preferred method of supporting this device (adding 
command line option, etc)

----

btw, there seems to be a problem setting the tuner channel, I'll have to 
figure that out too:

MEncoder dev-CVS-050606-18:51-3.4.3 (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
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: Plextor PX-TV402U-NA
 Tuner cap:
 Tuner rxs:
 Capabilites:  video capture  tuner  streaming
 supported norms: 0 = NTSC; 1 = PAL/SECAM;
 inputs: 0 = Composite; 1 = S-Video; 2 = Tuner;
 Current input: 0
 Current format: unknown (0x47504a4d)
v4l2: ioctl set tuner 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...



-- 
Brad Clements,                bkc at murkworks.com    (315)268-1000
http://www.murkworks.com                          
AOL-IM or SKYPE: BKClements

We must come down from our heights, and leave our straight 
paths, for the byways and low places of life, if we would 
learn truths by strong contrasts; and in hovels, in forecastles, 
and among our own outcasts in foreign lands, see what has been 
wrought upon our fellow-creatures by accident, hardship, or vice. 
- Richard Henry Dana, Jr. 1836




More information about the MPlayer-dev-eng mailing list