YouTube-Links sind ja zu einem beliebiten Blogpost-Inhalt geworden … jetzt hab’ ich auch mal einen den ich gerne posten würde. Also dann, Bildschirm frei für Xavier Naidoo’s »Vielleicht hörn sie nicht hin« als Musikvideo.
In this case, the problem was that the soundcard’s master volume was regularly turned to mute by a program (specifically, ABUS DigiProtect 0900 Server). There had to be found a way how to keep it unchanged, and to turn it on automatically on system start.
We finally used “VolumeLock“; it is written for exactly that style of problems, and it was the perfect solution to the problem here.
- Try out “Power Mixer“; it includes a scheduler and command line options that come in handy here.
- Try out “IndieVolume” from; it lets you configure per-app audio volume.
- Try out “ZVolume Pro“; it includes command line control.
- Try out NoiseNakPlus; which is an advanced volume control.
- Perhaps “wxmixer” has some command line options that might help here, but that’s rather improbable.
mount -t davfs webdavserver dir
For example, to use Gallery2:
mount -t davfs http://shopimages.juii.net/gallery2/w/ localdir
It should also be possible to use konqueror for WebDAV by giving a URL like
However, in the case of Gallery 2, the authentication resulted in an error, while
davfs2 was able to do it.
Also, not all operations are possible with all applications … for Gallery2, creating
files was not.
The question here is how to capture a JPEG still image from a V4L2 (Video for Linux 2) webcam, using Linux tools. The webcam in question is a Creative Live!Cam Optia; because it is a UVC (USB video class) compatible camera, the solution should at least work with all other UVC webcams, too.
The only working alternative is, for now, to use gstreamer (to show the stream) and a screenshot tool. You cannot use all video sinks, as some are not accessible to the screenshot tools. What can be captured by the screenshot tools is the “ximagesink” video sink. How to do it:
- Execute this command in a terminal while your webcam is connected:
gst-launch v4l2src ! jpegdec ! ffmpegcolorspace ! ximagesink
- Now in another terminal, create a screenshot by executing the commandscrot.
- You may now write a script that gets a screenshot like this and handles / processes it, like uploading to a server.
To test things about gstreamer and screenshots, you can also use the test video source for testing. The following worked for creating screenshots like above:
gst-launch videotestsrc ! queue ! ximagesink
In my tests, the following video sinks did not work to create screenshots like above:
- autovideosink (shows green are in screenhosts)
- dfbvideosink (shows green are in screenhosts)
- glimagesink (shows green are in screenhosts)
- xvimagesink (shows green are in screenhosts)
- sdlvideosink (does not work at all)
- gconfvideosink (does not work at all)
Perhaps working alternatives
It is possible to use fswebcam (http://www.firestorm.cx/fswebcam).
Take screenshots with gstreamer
You may use gstreamer to take the screenshots. A webcam that serves JPEG images just serves JPEG images one after the other. The following worked to view the first captured image from a file that contains JPEG after JPEG:
gst-launch v4l2src ! filesink location=file.jpg
This is even a very promising path, as you can combine some JPGs to reduce the noise.
Use gstreamer to pipe to vlc
You may use gstreamer with a filesink and then pipe that to vlc. The following created basic screen output here:
gst-launch v4l2src ! jpegdec ! autovideosink
The following recorded and played an avi video:
gst-launch v4l2src ! avimux ! filesink location=video.avi
(Perhaps you need instead something like this or similar, but VLC cannot play this, saying: “avi demuxer error: avi module discarded (invalid file)”:)
gst-launch v4l2src device=/dev/video0 ! avimux ! filesink location=video.avi
The following recorded and played an avi video, using forwarding to stdout:
gst-launch v4l2src ! avimux ! fdsink | cat > video.avi
(This however makes xine not recognize the format.)
And now, piping to vlc media player is possible by:
gst-launch v4l2src ! avimux ! fdsink | vlc -
(But this is not possible yet.) (You may need the “ffmpegcolorspace” element, it’s important.) (See here for the documentation: http://wiki.videolan.org/Uncommon_uses.)
Something comparable should be possible with xine:
gst-launch v4l2src ! avimux ! fdsink | xine stdin://
(However, xine does not recognize the file format and there’s yet a way to find
how to tell it explicitly about that. See here for that:
ffmpeg to capture and convert
It is also possible to use ffmpeg to capture and transcode the stream from a V4L2 device. The command would be something like:
ffmpeg -v 100 -f video4linux2 -s 320x240 -i /dev/video0 -f audio_device -i /dev/dsp2 -f m4v test.m4v
This however leads to an error:
[video4linux2 @ 0xb7f64610]Cannot find a proper format.
Which might mean that the camera uses a compressed format. See this mailinglist contribution.
See for that and a discussion of alternatives: http://lists.berlios.de/pipermail/linux-uvc-devel/2007-September/002164.html
You may then pipe the ouput to vlc.
transcode to capture and convert
It is possible to use transcode and and pipe it’s output to VLC (as seen here:
http://wiki.videolan.org/Uncommon_uses ) and stream it from there.
On the transcode side something like:
transcode -x v4l2,null -g 640x480 -i /dev/video0 -w 4000 -y ffmpeg -F mjpeg -o test.avi
This leads however to this error:
[import_v4l2.so]: no usable pixel format supported by card
As also documented here: http://lists.berlios.de/pipermail/linux-uvc-devel/2007-September/002164.html
gstreamer is no alternative as it was impossible to create a network stream from it.
It is possible to use UVC-Streamer ( http://naaa.de/uvc_streamer.htm ), which works for V4L2 devices; however there were compilation errors.
It is possible to use MJPEG-Streamer, which is the successor to UVC-Streamer; however, compile errors happened in both the 35 and 51 revisions.
It is possible to use uvccapture; however, this is rather a hack and has errors when compiling.
MPEG4IP might be a possibility, but their tarball is corrupt and their development stopped.
You may try ucview (an application based on the unicap framework). There are .debs available; however, I wasn’t able to get an image (though it supports MJPEG); it would be the most comfortable software for capturing selected frames.
You may try luvcview.
Enter the following command for the autostart entry;
"c:ProgrammeWindows Media Playerwmplayer.exe" /Playlist Standard /Task MediaLibrary
If you need other command line options, refer to this reference of Windows Media Player.
Yes, immediately on next startup. See:
style="font-size:140%;" in all normal text paragraps (
li, …) for a readable and at the same time compact font size. Heading tags (
h2, …) are of readable size by default.