LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-06-2014, 02:54 PM   #1
spikeygg
Member
 
Registered: Dec 2004
Location: America
Distribution: Ubuntu
Posts: 42

Rep: Reputation: 0
Unhappy How do I change the v4l defaults?


I have a linux machine that runs 24hrs a day and it has zoneminder running on it watching the frames from a camera. I have the camera going into a TV/Video-capture card and everything works great. That is until I reboot the machine. V4L has "default" value which I can't seem to change. I've looked through the documentation and googled all around and I can't find any information on how to change the default. I can issue this command:

Code:
sudo v4lctl -c /dev/video0 setattr input Composite1
Which will set the "current" value to the correct input but as soon as I reboot, it gets reset to "Television". I know there's a default value but I don't know how to SET it.

Code:
$ sudo v4lctl -c /dev/video0 list
attribute  | type   | current | default | comment
-----------+--------+---------+---------+-------------------------------------
norm       | choice | NTSC-M  | NTSC-M  | NTSC-M NTSC-M-JP NTSC-443 PAL-BG PAL-I PAL-DK PAL-M PAL-N PAL-Nc PAL-60 SECAM-B SECAM-G SECAM-H SECAM-DK SECAM-L
input      | choice | Composi | Televis | Television Composite1 S-Video
audio mode | choice | mono    | mono    | mono stereo lang1 lang2
bright     | int    |     127 |     127 | range is 0 => 255
contrast   | int    |      63 |      63 | range is 0 => 255
color      | int    |     127 |     127 | range is 0 => 255
hue        | int    |     127 |     127 | range is 0 => 255
volume     | int    |      63 |      63 | range is 0 => 63
Balance    | int    |      64 |      64 | range is 0 => 127
mute       | bool   | on      | on      |
Sharpness  | int    |       0 |       0 | range is 0 => 4
Chroma AGC | bool   | on      | on      |
Color kill | bool   | on      | on      |
$
Anyone know how to *set* this "default"?

Thanks,
-Greg
 
Old 04-09-2014, 07:52 AM   #2
ichrispa
Member
 
Registered: Mar 2005
Location: Dresden, Germany
Distribution: OpenSuse 11.2/3, Debian 5.0 , Debian 1.3.1, OpenBSD
Posts: 277

Rep: Reputation: 32
Hello spikeegg,

since the camera is probably detected by the driver/udev after the v4l module is loaded, you would set a default device that does not exist if you modify the drivers parameters... I havent looked it up, but I suppose you can pass the default values to the v4l-module using the appropriate /etc/modprobe.d config file.

Might I suggest a simple if not so elegant workaround?

Just add the line

Code:
/usr/sbin/v4lctl -c /dev/video0 setattr input Composite1
either to /etc/rc.local or to the startup script of zoneminder (I am guessing /etc/init.d/zoneminder, but it depends on the distro you are using).

Regards,

ichrispa

Last edited by ichrispa; 04-09-2014 at 07:54 AM.
 
  


Reply

Tags
capture, default, v4l, video4linux


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 12 - How do I change soundcard defaults? RicardoClaro Slackware 1 09-10-2007 04:07 PM
Change notification defaults... custangro LQ Suggestions & Feedback 2 05-23-2007 01:44 PM
v4l rubadub Linux - Hardware 5 10-25-2006 12:36 PM
If you could change Ubuntu's system defaults Cyran Ubuntu 11 09-28-2006 03:01 PM
Change suspend mode defaults scottman Linux - Newbie 5 09-20-2004 11:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration