Page 1 of 1

Get a snapshot without saving it on disk

Posted: 01 Oct 2011 16:14
by vale4674
Hello,

in my project I use Xuggle (http://www.xuggle.com/xuggler/) (java library for video manipulating).
I'm making my own recorder so I need images from camera and encode them into a container to make a video.
I use java VLCJ library to access libVLC to take snapshots.

Problem is that it saves every snapshot in temp folder. This is slow because it is making a new file for every frame.
I run onto this old thread viewtopic.php?f=2&t=51008 with same problem.

How can achieve this? I need only in-memory picture/snapshot.

Re: Get a snapshot without saving it on disk

Posted: 01 Oct 2011 16:42
by Rémi Denis-Courmont
Snapshot to memory is not currently implemented, and you're welcome to provide a patch.

That being said, I suspect that the slowness you seem to observe comes as much from encoding the snapshot (to JPEG?), than from saving it to disk.

Re: Get a snapshot without saving it on disk

Posted: 01 Oct 2011 18:01
by vale4674
Snapshot to memory is not currently implemented, and you're welcome to provide a patch.

That being said, I suspect that the slowness you seem to observe comes as much from encoding the snapshot (to JPEG?), than from saving it to disk.
While I am taking all those snapshots, pictures are being saved as .png. Is this the same thing as it would be if it was JPEG?

Re: Get a snapshot without saving it on disk

Posted: 01 Oct 2011 22:11
by Rémi Denis-Courmont
Both JPEG and PNG are compressed formats, so it takes some CPU to encode the snapshot picture.

On the other hand, unless your hardware really sucks or is way overloaded, writing the file to disk should be quite fast.

Re: Get a snapshot without saving it on disk

Posted: 02 Oct 2011 00:08
by vale4674
Both JPEG and PNG are compressed formats, so it takes some CPU to encode the snapshot picture.

On the other hand, unless your hardware really sucks or is way overloaded, writing the file to disk should be quite fast.
Well I have a new iMac (4GB memory and i5 quad core 2.5GHz) and develop this in Windows7 in Parallels Desktop. I gave 1.5GB of memory and 2 Cores to the virtual machine. I'll try with more memory. It should be fast but that is 25 images per second. It would be much faster (or it wouldn't) if the pictures weren't saving on the disk.

Re: Get a snapshot without saving it on disk

Posted: 02 Oct 2011 10:53
by Rémi Denis-Courmont
I don't know. The only way you'll know if it's possible is if you do it.

Re: Get a snapshot without saving it on disk

Posted: 02 Oct 2011 21:59
by vale4674
I don't know. The only way you'll know if it's possible is if you do it.
Can I at least manipulate with some options. E.g. to take a snapshot with lower quality or this is the only option with taking snapshots?