Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: Perl wrapper for v4l2-ctl

by stevieb (Canon)
on May 15, 2017 at 19:53 UTC ( [id://1190341]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl wrapper for v4l2-ctl
in thread Perl wrapper for v4l2-ctl

Thanks to both of you for the replies.

I didn't realize that streaming to two locations simultaneously (display and file) would be problematic.

I ordered my camera from Amazon Canada this morning and it should be here in a couple of days. At that time I'll commence playing around with various options.

On another note, my GPS receivers came in today, so I'll be picking that up after work, so hopefully I'll have a Perl module for the GPS side of things (wrapped C, of course). One will be used with the Pi for the same project (so I can embed the coordinates in the video directly), and the other for my Arduino Trinket Pro, as I'm making my own GPS device for when I'm out on my days-long mountain hikes (yes, I could buy one, but where's the fun in that ;)

Replies are listed 'Best First'.
Re^3: Perl wrapper for v4l2-ctl
by zentara (Archbishop) on May 15, 2017 at 20:47 UTC
    Hi, you know, in terms of development time and cost, the easiest solution would be to have 2 raspberry pi's and 2 cameras. One to record, and one for realtime display. :-) What does a Pi and a camera cost $50? Plus you would have a backup to record with if your main recorder failed. Is $50 worth all the head-scratching required to get just 1 Pi to do it all? Like a few weeks of time for $50? :-)

    I also came across something for you to google around for. It is claimed that Gstreamer, which has a Perl module, has the ability to duplex the video feed from one camera. That is what we need, take 1 camera output and split it into 2 identical streams. It dosn't seem it should be that hard, but it eludes us for now. ffmpeg seems to be able to do it, see ffmpeg multiple outputs. I'm going to play with that.

    UPDATE0 These 2 links are the most promising leads. Use a kernel module 2 split the /dev/video stream, then use whatever to display 1 stream and record another. v4l2loopback module and splitting /dev/video to 2 streams .

    UPDATE1It works! Here is how to split /dev0 into /dev/video1 and /dev/video2

    modprobe v4l2loopback devices=2 # as root # then ffmpeg -f v4l2 -i /dev/video0 -f v4l2 /dev/video1 -f v4l2 /dev/video2
    Now you can watch /dev/video1 in realtime, and record /dev/video2. :-)

    I'm not really a human, but I play one on earth. ..... an animated JAPH

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1190341]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-18 01:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found