Page 1 of 1

Tv and Mencoder on Sabayon

Posted: Sat Dec 20, 2008 1:19
by alexandre3g

I tried to record the images form TV using this command:

mencoder tv:// -tv driver=v4l2:input=1:normid=4:channel=3:chanlist=us-bcast:width=320:height=240:contrast=-25:saturation=-25:brightness=-0:device=/dev/video0 -vf crop=295:230,scale=320:240 -oac lavc -lavcopts abitrate=128 -ovc lavc -ofps 29.97 -lavcopts vcodec=msmpeg4:vbitrate=800 -o video.avi

And this is what I got in return:

MEncoder dev-SVN-r27458-4.3.1 (C) 2000-2008 MPlayer Team
CPU: Intel(R) Celeron(R) CPU 2.26GHz (Family: 15, Model: 4, Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
success: format: 9 data: 0x0 - 0x0
TV file format detected.
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski <[email protected]>
comment: first try, more to come ;-)
Selected device: LifeView/Typhoon FlyVIDEO2000
Tuner rxs: MONO
Capabilites: video capture video overlay VBI capture device tuner read/write streaming
supported norms: 0 = PAL; 1 = PAL-M; 2 = PAL-N; 3 = PAL-Nc; 4 = PAL-60; 5 = NTSC; 6 = SECAM;
inputs: 0 = Television; 1 = Composite1; 2 = Composite2; 3 = S-Video;
Current input: 1
Current format: BGR24
v4l2: current audio mode is : MONO
Selected channel: 3 (freq: 61.250)
Unable to open '/dev/dsp': Device or resource busy
Unable to open '/dev/dsp': Device or resource busy
Unable to open '/dev/dsp': Device or resource busy
v4l2: 0 frames successfully processed, 0 frames dropped.
============ 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.

Could anyone please help me with this,

* Why the '/dev/dsp' is busy

* Why demuxer can not be open

Re: Tv and Mencoder on Sabayon

Posted: Sun Dec 21, 2008 0:24
by thenthenio
I did few googling about this and I found some hints: try to run the following commands from a console as normal user:

Code: Select all

$ fuser /dev/dsp
$ lsof /dev/dsp
If they print some output you should know now which is the process locking /dev/dsp.
If they do not print any outputs it is ok, try this now:

Code: Select all

$ cat /dev/urandom > /dev/dsp
bash: /dev/dsp: Device or resource busy
This should be the result as long as mencoder gives the same error.
In this case, given that no process is locking /dev/dsp the problem should be that you do not have the rights to access /dev/dsp.
As root now edit the /etc/group file, simply add your user to the audio group and save.
Now repeat (as normal user):

Code: Select all

$ cat /dev/urandom > /dev/dsp
You should now hear a noise coming out from PC speakers.
Ok, you are done, you can now record your TV stream using mencoder.


Re: Tv and Mencoder on Sabayon

Posted: Mon Dec 22, 2008 0:59
by alexandre3g
hi Maro!

Thank you for your help. I will try out your tips