capture video from usb camera in linux with c++ - linux

I was wondering how is it possible to capture a video from a usb camera device connected to my linux machine with c++ and the terminal alone or perhaps a bash script, i see the terminal but i dont think an echo would provide me with video or frames. Help would be extremely appreciated.
Thank you

Give a look at this page . The v4l2grab is a program that reads raw images and convert them to jpeg and is run in a terminal

Related

watch for programms using audio output in linux

I would like to watch for programms outputing audio. Basically I try to make a system where I have VLC running in the background and if I start a video in firefox, VLC would automatically mute. Anyone have any idea how to do it ? A command line equivalent of pavucontrol would be cool I guess.
But a script or binary that would do something when there are more than one process that outputs audio would be really cool.
The NewPlaybackStream signal of the PulseAudio D-Bus interface will let you know when another application has begun playback (or technically when they've attached to the PulseAudio server, usually to play audio), and the opposite with PlaybackStreamRemoved.

How to write raw data directly to usb printer on Linux?

I'm developing app with qt4 (c++) for Linux platform. When I'm using QTextDocument::drawContext method(), sometimes (not always) printer is printing some junks and wasting a lot of paper. I think it can be related with printer driver. This is Oki MicroLine 3390 eco printer. This printer is emulating EPSON LQ driver.
I have tested few epson drivers but that did not help at all. I cannot fix this issue so I have started looking for some alternative solution - write directly to device.
I'm looking for info:
How to write raw data (formatted text) to usb dot matrix printer?
is any one know how to fix printing issue?
any write command will do print on device /dev/usb/lp0
test it # cat [file] > /dev/usb/lp0
Try to send reset sequence before printing process:
[ write_2_printer("\x1b\x40");]

How to create artificial microphone input in Linux?

I'm working on an audio recognition project.
For testing, I'd like to be able to have a program:
load audio data from a file
provide it to the Linux kernel, as if it were coming from a microphone
have any user-space program sampling the microphone be obtaining data sourced
from my file.
Is that possible in Linux without having to write a new kernel module?
EDIT: i guess that solution won't work .. but see my comment below.
this shoud be simple under linux.
here are the steps:
make a named pipe with mkfifo (mkfifo ~/audio_out.pipe)
cat the audiofile into this pipe (cat test.wav > ~/audio_out.pipe)
get the program you want to listen, to get input from this pipe. maybe you have to make a symlink for programs not flexible enough to read from any device.
I hope I got your question right.

making USB video in Linux

I am working on an embedded device using Linux that will read video, process and modify every frame and then return USB video stream. I don't know how to make USB video from a sequence of frames. Can someone direct me where to start?
Take a look at http://electron.mit.edu/~gsteele/ffmpeg/
It shows you how to make video from a sequence of images using ffmpeg and mencoder
Yes, take a look at OpenCV.
There are lots of code around here to show you how to use the library. For instance, take a look at: OpenCV: process every frame

Live DVD burning under Linux

A similar question has already been asked for the .NET platform but I am on Debian Linux.
I am trying to find a solution for burning a video DVD directly from a camera attached to a capture card. The card outputs an MPEG-2 stream and I want to write it directly to a DVD disc without creating any intermediate files.
The reason is so that when the recording is finished, the DVD can be very quickly finalized and ejected.
I have been looking at commandline tools like cdrecord and dvdauthor but I don't think they can do this. Any suggestions ?
As in a data-dvd or videodvd?
video dvd might need some work, data dvd however can easily be done by piping the output of mkisofs to growisofs.
man growisofs man mkisofs
edit:
mkisofs -r /media/cam/ | growisofs -Z /dev/dvd

Resources