[PlanetCCRMA] Capture Analog Video

ClaudiusMaximus gloriousclaudiusmaximus@yahoo.co.uk
Fri Oct 29 05:35:02 2004


Ingo Lantschner (Lists) wrote:
> Hi all,
> I have a very simple and stupid question - sorry. But after searching 
> all of the archives and googeling for hours I have to ask someone:
> Given a Miro DC30plus and Fedora Core 2 with 2.6 kernel I can load the 
> modules which are necesary w/o problems.
> 
> [root@localhost ingo]# lsmod
> Module                  Size  Used by
> zr36060                 8076  0
> zr36016                 4616  1
> zr36050                 7432  1
> 
> So somehow I think that I can now capture from /dev/video0. But how?! 
> Which program or command can I use please?
> 
> TIA, Ingo.

I use the following command (all on one line) to capture from my 
/dev/video0 's composite input:

$ mencoder -tv 
driver=v4l:input=1:width=384:height=288:fps=25:adevice=/dev/dsp:audiorate=44100:forceaudio:forcechan=2 
-oac mp3lame -lameopts cbr:preset=192 -ovc
xvid -xvidencopts bitrate=1600 tv:// ouputfile.avi

However, no matter what I put for "outputfile.avi", mencoder always 
writes to a file called "test.avi" - I don't know why, and I don't know 
how to change it.  Any ideas?

To monitor the recording I do
$ mplayer test.avi
about 10 seconds after I start recording

And I use avidemux2 to edit (normally just trim the excess ends off) the 
video without recompressing it.


The output of the above mencoder command is this:

----
MEncoder 1.0pre4-3.2.2 (C) 2000-2004 MPlayer Team

CPU: Advanced Micro Devices Athlon 4 /Athlon MP/XP Palomino 1467 MHz 
(Family: 6, Stepping: 2)
Detected cache-line size is 64 bytes
CPUflags: Type: 6 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx SSE

Reading /home/claude/.mplayer/codecs.conf: Can't open 
'/home/claude/.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 /home/claude/.mplayer/mencoder: No such file or 
directory
font: can't open file: /home/claude/.mplayer/font/font.desc
Font /usr/local/share/mplayer/font/font.desc loaded successfully! (206 
chars)
success: format: 9  data: 0x0 - 0x0
TV detected! ;-)
Selected driver: v4l
  name: Video 4 Linux input
  author: Alex Beregszaszi
  comment: under development
Selected device: bttv video
  Capabilites: capture tuner overlay clipping frameram scales
  Device type: 235
  Supported sizes: 48x32 => 924x576
  Inputs: 2
   0: Television: tuner audio tv camera  (tuner:1, norm:pal)
   1: Composite1: audio camera  (tuner:0, norm:pal)
audio block size too low, setting to 16384!
Using input 'Composite1'
Selected input hasn't got a tuner!
[V] filefmt:9  fourcc:0x32315659  size:384x288  fps:25.00  ftime:=0.0400
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 2 ch, 16 bit (0x10), ratio: 176400->176400 (1411.2 kbit)
Selected audio codec: [pcm] afm:pcm (Uncompressed PCM)
==========================================================================
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 - 384 x 288 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
videocodec: XViD (384x288 fourcc=44495658 [XVID])
Selected video codec: [rawyv12] vfm:raw (RAW YV12)
==========================================================================
MP3 audio selected
Building audio filter chain for 44100Hz/2ch/16bit -> 44100Hz/2ch/16bit...
Writing AVI header...
ODML: vprp aspect is 4:3.

preset=192

Forcing audio preload to 0, max pts correction to 0
Pos:   4.9s    121f ( 0%)  24fps Trem:   0min   0mb  A-V:0.000 [14:191]

CBR audio: 24000 bytes/sec, 627 bytes/block

Writing AVI index...
Fixing AVI header...
ODML: vprp aspect is 4:3.

Video stream:   13.987 kbit/s  (1748 bps)  size: 8602 bytes  4.920 secs 
  122 frames

Audio stream:  191.999 kbit/s  (23999 bps)  size: 117237 bytes  4.885 secs
   MJP: returning!
----


The [14:191] is [ video bitrate : audio bitrate ], the video rate is low 
because there was no input when I ran this test ;-)