Take a still image from video input?

mitchellcraig's picture

Hi all,

Does anyone have any ideas how/if it would be possible to, on predefined intervals i.e. very minute, capture a still image from the camera being used as the video input? I will then display this image on a different billboard, activated by a condition.

I have managed to create a patch that loads a new image every minute from a folder that is being populated by a images taken every minute using the Freeverse software; Periscope, however when running Periscope and QC (with the same camera as input on both) simultaneously Periscope's doesnt work.

See 'Picture 1' for th patch that loads images but wont work, and 'Picture 2' for the video input & midi controller that i want to use to display the (potentially!) captured image from the video input.

Any help much appreciated, Cheers, Craig

PreviewAttachmentSize
Picture 1.png
Picture 1.png97.57 KB
Picture 2.png
Picture 2.png55.28 KB

franz's picture
Re: Take a still image from video input?

look in dev. folder. there's a movie/picture exporter plugin. build it. put it in your QC plugs folder.

in QC, connect the video input to the picture/movie exporter plug. Use a boolean to trigger file write. Then use a directory scanner to read previously saved files from your folder. Connect to image dwloader.

get rid of Periscope.

mitchellcraig's picture
Re: Take a still image from video input?

Thanks Franz, i have built the movie exporter and opened it in QC, however i am now confused by what you mean by 'file write' - movie exported doesnt have that plug.

periscope will be got rid off...!

cybero's picture
Take a still image from video input?

The following example SimpleSnap is a raw simple snapshot mechanism.

The Movie Exporter patch is set to JPEG codec and the boolean value of true is sent via either keyboard, mouse or gamepad right button.

The export runs for as long as the requisite key is being depressed and ceases upon release.

It's not quite a shutter , focus and zoom sophisticated sort of kit, but it might point you in the right sort of direction and should work straight out of the box.

Timers, stopwatches, other operational logic, I shall leave entirely up to the recipient and incorporator of this example.

Just a PostScript [pun intended] - if you should open the movie you have written to, you will not be able to export from the quartz composer.

Simplest thing to do is to allocate a new export file name for every export.

Should be easy enough to create a simple array of movie 1, movie 2, etc and use a boolean to then change the string that is written to the Movie location in the movie exporter application patch.

Stopwatch and automation next ?

PreviewAttachmentSize
examplesnapshotsimpleform.qtz3.68 KB

blackburst's picture
Re: Take a still image from video input?

How can I get this to export jpegs, instead of jpeg encoded movs? Is there a similar plugin for images around?

gtoledo3's picture
Re: Take a still image from video input?

This should work for you... let me know. This is based on the developer example franz is referencing, but has some different file types, including jpeg.

PreviewAttachmentSize
ImageWriter_gt.plugin.zip84.39 KB
ImageWriter_gt Demo.qtz35.15 KB

blackburst's picture
Re: Take a still image from video input?

Thanks heaps George that's really helpful. You guys...!

blackburst's picture
Re: Take a still image from video input?

I'm actually trying to write the images to disk in such a format as to allow me to assign unique file names to the images to recall later. As it stands your plugin lets me assign the destination folder and not the individual url's of the files, obviously for the purposes of saving a video stream to an image sequence. Do you have any suggestions on how I can save images with a file name input? To give you some insight into the project, I want to eventually setup a kinect to be constantly taking stills that are named after their xyz positions of the hands, which build up a database of previous users. The effect will eventually be that unique, live kinect hand positions will recall images of previous users in the same position, I kind of mirror effect with other users as the reflection. Right now I'm using a string printer to sum the xyz pos of the hands into a url for the destination files, but reached a dead end once i realised that the destination was only the folder.

gtoledo3's picture
Re: Take a still image from video input?

franz wrote:
doesn't this plugin work ? Image exporter....

http://developer.apple.com/library/mac/#samplecode/ImageExporter/Introduction/Intro.html%23//apple_ref/doc/uid/DTS40009329

If you follow the back and forth, one of the issues was apparently saving to jpeg.

The plugin I posted is essentially the same as the link, save that I've added an option to save to jpeg and a few other file types, whereas the sample project only saves to png.

In response to the question above, yes, it's fairly easy to write to a file path without the numbering schema...in a way, the numbering schema is a feature that helps make sure that all of your file write, you don't mismatch file type extensions, double write the same file, etc.

Check attachment.

PreviewAttachmentSize
ImageWriter_gtAlt.zip9.67 KB

blackburst's picture
Re: Take a still image from video input?

That's it, that's exactly what I need thank you heaps. So you know, it doesn't seem to be adding the file extensions itself, so there isn't much point in having the image type option as I have to add the .jpg extension as an extra argument in the string at the destination input. No biggy. ..is there a way to change the file size/compression apart from image size? As you'd expect the image database is going to end up absolutely monstrous. I thought maybe there is a system setting for jpeg compression or something I don't know about, or is it hard-coded into the plug? Again thank you a bunch, you're a scholar and a gent.

gtoledo3's picture
Re: Take a still image from video input?

Mmm, no, so you know, make sure that your file extension matches your selected type. It's totally possible to encode one way, filetype another, and still have Preview open it. I'm not doing any hand holding for you w/ the code on that one. I wouldn't count on the fact that the mismatch will be handled correctly in all environments. Again, if you choose an encode type, try to make sure your file extension matches. It's also probably totally workable to write image without even a filetype... I've done that before in an old screengrab app of mine (and never fixed it. Non-QC based though), and I can name it pretty much any image extension, regardless of what I encoded it as, and it opens. Some of the only issues with that are in 32 bit only image types, but I haven't supported that here.

The quality level is part of the plugin, not a system setting.

I totally don't have a problem doing it, but I also totally don't have time. You can enquire, gtoledo3@gmail.com for a quote based on whatever your spec is, and we can talk about when I have time to work on it, or maybe someone here has the time to get it going for you. I would also suggest asking kineme for a quote, as they may be able to get that going for you quicker...I'm pretty darn booked for the next couple wks.

No problem on the help, and I'm totally not trying to be a hardass, I just know I don't have the time right now. Maybe if I get some downtime...