Get a snapshot without saving it on disk

This forum is about all development around libVLC.
vale4674
Blank Cone
Blank Cone
Posts: 32
Joined: 29 Sep 2011 12:50

Get a snapshot without saving it on disk

Postby vale4674 » 01 Oct 2011 16:14

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15323
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Get a snapshot without saving it on disk

Postby Rémi Denis-Courmont » 01 Oct 2011 16:42

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

vale4674
Blank Cone
Blank Cone
Posts: 32
Joined: 29 Sep 2011 12:50

Re: Get a snapshot without saving it on disk

Postby vale4674 » 01 Oct 2011 18:01

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?

Rémi Denis-Courmont
Developer
Developer
Posts: 15323
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Get a snapshot without saving it on disk

Postby Rémi Denis-Courmont » 01 Oct 2011 22:11

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

vale4674
Blank Cone
Blank Cone
Posts: 32
Joined: 29 Sep 2011 12:50

Re: Get a snapshot without saving it on disk

Postby vale4674 » 02 Oct 2011 00:08

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.

Rémi Denis-Courmont
Developer
Developer
Posts: 15323
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Get a snapshot without saving it on disk

Postby Rémi Denis-Courmont » 02 Oct 2011 10:53

I don't know. The only way you'll know if it's possible is if you do it.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

vale4674
Blank Cone
Blank Cone
Posts: 32
Joined: 29 Sep 2011 12:50

Re: Get a snapshot without saving it on disk

Postby vale4674 » 02 Oct 2011 21:59

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?


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 4 guests