Playing and recording video from web-cam

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
SyRenity
Blank Cone
Blank Cone
Posts: 53
Joined: 19 Feb 2006 20:08

Playing and recording video from web-cam

Postby SyRenity » 13 Oct 2007 04:27

Hi.

I'm trying to simultaneously view and record video from the web-cam. The following command line parameters work great:

vlc.exe dshow:// :dshow-vdev="" :dshow-adev="none" :dshow-size="" :sout=#transcode{vcodec=DIV3,vb=1024,scale=1}:duplicate{dst=display,dst=std{access=file,mux=ogg,dst="C:\test.ogg"}}

Problem is, that I don't know how to translate them to ActiveX correctly. I tried various options, and only reached this one so far:

(VB6)

vlcLive.addTarget "dshow:// :dshow-vdev=""""", Array(":dshow-adev=""none"" :dshow-size="""" :sout=#transcode{vcodec=DIV3,vb=1024,scale=1} :duplicate{dst=display,dst=std{access=file,mux=ogg,dst=""C:\test.ogg""}}"), VLCPlayListReplaceAndGo, -666

This one displays the ActiveX with web-cam video, but doesn't produce any recordings.

Am I doing something incorrect?

Thanks in advance.

SyRenity
Blank Cone
Blank Cone
Posts: 53
Joined: 19 Feb 2006 20:08

Re: Playing and recording video from web-cam

Postby SyRenity » 14 Oct 2007 23:08

Hi.

Has anyone tried something similar to the above? Perhaps someone can provide reliable instructions how to show video AND record it in the same time?

Thanks in advance.

MuNk
Blank Cone
Blank Cone
Posts: 12
Joined: 11 Oct 2007 22:20

Re: Playing and recording video from web-cam

Postby MuNk » 15 Oct 2007 22:30

viewtopic.php?f=16&t=41319#p128898

read this reply, you seam to be formatting your MRL string wrongly..


and :duplicate{dst=display,dst=std{access=file,mux=ogg,dst=""C:\test.ogg""}}


dst=display is for display to monitor
dst=std{access=file,mux=ogg,dst=""C:\test.ogg""} is run as a secound display and record it to this file.

SyRenity
Blank Cone
Blank Cone
Posts: 53
Joined: 19 Feb 2006 20:08

Re: Playing and recording video from web-cam

Postby SyRenity » 21 Oct 2007 20:51

Hi MuNk.

I already placing the options string in the MLR position, you can see in the example above:

vlcLive.addTarget "dshow:// :dshow-vdev=""""", Array(":dshow-adev=""none"" :dshow-size="""" :sout=#transcode{vcodec=DIV3,vb=1024,scale=1} :duplicate{dst=display,dst=std{access=file,mux=ogg,dst=""C:\test.ogg""}}"), VLCPlayListReplaceAndGo, -666

where
* URL is "dshow:// :dshow-vdev=""

* MRL is Array(":dshow-adev="none" :dshow-size="" :sout=#transcode{vcodec=DIV3,vb=1024,scale=1} :duplicate{dst=display,dst=std{access=file,mux=ogg,dst="C:\test.ogg"}}")

* Mode is VLCPlayListReplaceAndGo

* position is number.

Any idea why it doesn't work?

Regards.

MuNk
Blank Cone
Blank Cone
Posts: 12
Joined: 11 Oct 2007 22:20

Re: Playing and recording video from web-cam

Postby MuNk » 22 Oct 2007 00:47

the MRL should be one string, and not a array from what i know, in C== , C# , Delphi the mrl is a string and not a array so i assume this rule applys to vbscrip, javascript and even VisualBasic (all versions), try that might work>?

SyRenity
Blank Cone
Blank Cone
Posts: 53
Joined: 19 Feb 2006 20:08

Re: Playing and recording video from web-cam

Postby SyRenity » 22 Oct 2007 01:44

Without array, it doesn't work at all, there is no video from the local camera.

I also remember that I read on these forums, and you have to specify the options in an Array.

Any idea?

Mathelem
New Cone
New Cone
Posts: 6
Joined: 14 May 2007 20:09

Re: Playing and recording video from web-cam

Postby Mathelem » 22 Oct 2007 15:51

i sort of have the same problem, although i am trying to stream out from the web cam and not write to a file. I can safely say I tried all possible formats from strings to arrays for sout. I think there is a problem with the sout option and addTarget.

You can also try another way to do this by:

var vlc = document.getElementById("vlc");
var options = [":sout=#transcode{vcodec=H263,vb=1024,scale=1}", ":duplicate{dst=std{access=udp,mux=ts,dst=47.135.122.226:30002}}"];
vlc.playlist.clear();
vlc.playlist.add('dshow:// :dshow-vdev="" :dshow-adev="" :dshow-size="176x144" ', null, options);
vlc.playlist.play();

didnt work for me, but in theory should do the same as addTarget.

Let us know if you find a solution. I do hope that someone addresses this issue once and for all cause its being brought up in a lot of threads.

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: Playing and recording video from web-cam

Postby revolunet » 23 Oct 2007 14:22

hello all

this syntax seems to work with Mozilla :

:sout = "#duplicate{dst=display,dst=std{access=file,mux=ps,url=c:\\movie.mpg}}"

enjoy
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

SyRenity
Blank Cone
Blank Cone
Posts: 53
Joined: 19 Feb 2006 20:08

Re: Playing and recording video from web-cam

Postby SyRenity » 23 Oct 2007 21:09

Hi.

I'm using a desktop environment rather then a browser. Can you perhaps post an example working on VB or C#?

Also, according to your example the transcode={} section, specifying the codec parameters is entirely dropped. Have you managed to create with this option a playable file?

Thanks.

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: Playing and recording video from web-cam

Postby revolunet » 24 Oct 2007 19:29

This works with the IE activex too so i think its the same ?

i didn't try to transcode yet..

if someone has an example string, i can try it
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

SyRenity
Blank Cone
Blank Cone
Posts: 53
Joined: 19 Feb 2006 20:08

Re: Playing and recording video from web-cam

Postby SyRenity » 25 Oct 2007 11:49

Try mine, for example (change as necessary for HTML):

vlcLive.addTarget "dshow:// :dshow-vdev=""""", Array(":dshow-adev=""none"" :dshow-size="""" :sout=#transcode{vcodec=DIV3,vb=1024,scale=1} :duplicate{dst=display,dst=std{access=file,mux=ogg,dst=""C:\test.ogg""}}"), VLCPlayListReplaceAndGo, -666

revolunet
Big Cone-huna
Big Cone-huna
Posts: 515
Joined: 17 Oct 2007 13:16
VLC version: 0.9.8
Operating System: Vista
Location: Paris, France
Contact:

Re: Playing and recording video from web-cam

Postby revolunet » 25 Oct 2007 12:30

Hello dude

it's working for me with this option :

:sout="#transcode{vcodec=DIV3,vb=1024,scale=1}:duplicate{dst=display,dst=std{access=file,mux=ogg,dst=C:\\test.ogg}}";

in the plugin log, i have :

VLC: main private : using sout stream module "stream_out_standard"
VLC: main private : using sout stream module "stream_out_duplicate"
VLC: main private : set sout option: sout-transcode-vcodec to DIV3
VLC: main private : set sout option: sout-transcode-vb to 1024
VLC: main private : set sout option: sout-transcode-scale to 1
VLC: stream_out_transcode private : codec video=DIV3 0x0 scaling: 1.000000 1024kb/s
VLC: main private : using sout stream module "stream_out_transcode"

and c:\test.ogg is created !!

youhou, vlc rox ;)
VLC & web IT consulting - http://www.revolunet.com
Github : http://github.com/revolunet

SyRenity
Blank Cone
Blank Cone
Posts: 53
Joined: 19 Feb 2006 20:08

Re: Playing and recording video from web-cam

Postby SyRenity » 26 Oct 2007 19:52

Thanks man, that works indeed :).

Here is the final code:
vlcLive.addTarget "dshow://:dshow-vdev=""""", Array(":dshow-adev=""none"":dshow-size=""""", ":sout=#transcode{vcodec=DIV3,vb=1024,scale=1}:duplicate{dst=display,dst=std{access=file,mux=ogg,dst=C:\\test.ogg}}"), VLCPlayListReplaceAndGo, -1

This both displays the webcam, and records it to an OGG file.

lvasco
New Cone
New Cone
Posts: 1
Joined: 20 Jan 2008 12:12

Re: Playing and recording video from web-cam

Postby lvasco » 20 Jan 2008 17:17

Hello all,

i spend i lot of time to slove my issue (connecting my logitech web cam thru vlc by using VLC ActiveX plugin and c#)

all forums gives me hints to go fwd. thank you all and here is my solution:


this.axVLCPlugin1.addTarget("dshow://",
new string[] { ":dshow-vdev=Logitech QuickCam Pro 9000", ":dshow-adev=\"\"", ":dshow-size=\"320x240\"" },
AXVLC.VLCPlaylistMode.VLCPlayListAppendAndGo, -666);

it works for me...

good luck to you all,

regards,
laïd B


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 10 guests