Page 1 of 1

How can I set the sanpshot name before I use get/setVariable

Posted: 03 Jan 2007 05:02
by bobbook
I use VLC in html to play video and make a botton to get snapshot.

VLC version is 0.8.5

It is work to play video and get snapshot file in the "My Picture" folder.

But I have a question about the snapshot image name and type.

Can I set the snapshot image name/type before I create it?????

Thanks for answer my question.

Posted: 03 Jan 2007 06:29
by Tappen
If you run VLC outside of the web browser, you can set the format in Preferences (Video main page). This will stay when you are running in html. I don't think you can ever set the filename though, it will either have a timestamp or sequential index in the file name.

Posted: 03 Jan 2007 08:48
by bobbook
Thanks for your help.

Now I know how to set the image format and folder.

My code

Code: Select all

<SCRIPT language=JScript> function doGo(targetURL) { var options = new Array(":input-repeat=1"); document.vlc.addTarget(targetURL, options, 4+8, -666); }; doGo(http://127.0.0.1/aaa.wmv'); </SCRIPT> <input type="button" value="SNAPSHOT" onclick='var X = document.vlc.getVariable("key-snapshot"); document.vlc.setVariable("key-pressed", X);'>
But is it possiable to setup image format by Javascript?

If I want to use the same page in another PC, it means I have to setup again.

Posted: 03 Jan 2007 17:54
by Tappen
There are 3 options you can put in your options array when you add each item to the playlist.

Video snapshot directory (or filename):
--snapshot-path=<string>

Video snapshot file prefix:
--snapshot-prefix=<string>

Video snapshot format:
--snapshot-format={png,jpg}

So you could say

var options = new Array(":input-repeat=1", "--snapshot-path=c:\documents and settings", "--snapshot-prefix=MyPic", "--snapshot-format=jpg");

I'm pretty sure you can go without quotes inside an option string like I did even though c:\documents and settings has a space in it but if that doesn't work try single or double quotes.