Syntactic Confectionery Delight | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi stevieb, I played around with it awhile back and found a couple of problems which you maybe able to overcome. First with v4l2 I was only able to grab
single pictures at a time, however, they could easily be assembled into a video. Second, I could not find an efficient way to display the video in reatime, and save it simultaneously. My advice would be to use mplayer or mencoder, which can be run in slave mode for scripting.
I have a raspberry pi too, and I love it. If I were attempting it, I would use either mplayer or mencoder run by perl in slave mode, which you can see a sample of in ztk-v4l-video-bloger/recorder. That link shows the use of slave mode, but the v4l part is outdated. It may help you though. Basically you get a window id of the Tk container, the canvas is easiest, and pass that window id to mplayer in slave mode. I have 2 working mplayer snippets which you may find useful. First is just display the camera in realtime. The following nicely records video and audio
The problem is to get them to work simultaneously, so you can have a realtime Tk display and save to a file as you go. The mplayer and mencoder options show a -dumpstream and -dumpfile option, but I as yet have gotten them to work together. Some have suggested using a tee for output, but no luck there either. Maybe you will be the one to discover the coding trick needed.:-). So, I recommend using a c program to do the heavy video work, rather than Perl. Here is an informative link describing the problem in full. play record same time. I'm not really a human, but I play one on earth. ..... an animated JAPH In reply to Re: Perl wrapper for v4l2-ctl
by zentara
|
|