Page 1 of 1

vlm via libvlc

Posted: 17 Apr 2013 00:52
by d3x0r
I have a script that creates a picture-in-picure of two capture devices.....


new channel1 broadcast enabled\n" );
setup channel1 input dshow://\n" );
setup channel1 option dshow-vdev=\"Osprey-100e Video Device 1\"\n" );
setup channel1 option dshow-video-input=0\n" );
setup channel1 option dshow-adev=\"none\"\n" );
setup channel1 option dshow-size=\"320x240\"\n" );
setup channel1 option disc-caching=\"100\"\n" );
setup channel1 output #duplicate{dst=mosaic-bridge{width=320,height=240},select=video}\n" );

new channel2 broadcast enabled\n" );
setup channel2 input dshow://\n" );
setup channel2 option dshow-vdev=\"Osprey-100e Video Device 2\"\n" );
setup channel2 option dshow-video-input=0\n" );
setup channel2 option dshow-adev=\"none\"\n" );
setup channel2 option dshow-size=\"640x480\"\n" );
setup channel2 option disc-caching=\"100\"\n" );
setup channel2 option sout-keep\n" );
setup channel2 option fullscreen\n" );
setup channel2 option no-audio\n" );
setup channel2 option mosaic-keep-picture\n" );
setup channel2 output #transcode{sfilter=mosaic:logo{file=scripts/images/fortunet.png,position=10},vcodec=mp2v,vb=10000,scale=1,fps=24}:bridge-in{delay=400,id-offset=100}:duplicate{dst=display,dst=\"transcode{venc=x264{keyint=60,idrint=2},vcodec=h264,vb=300,acodec=mp4a,ab=32,channels=2,samplerate=22050}:rtp{dst=127.0.0.1,port=50004,caching=1000,sdp=rtsp://%s:8080/vlc.sdp}\"}\n", address );
\n" );
control channel2 play\n" );
control channel1 play\n" );

-------------
Right now, I'm writing that to a file and passing --vlm-conf parameter; but that causes libvlc to open a seperate window that is directshow, instead of going through what I set in libvlc_video_set_callbacks. actually looking maybe it's my bug that I'm expecting an input to get a media_t and a mediaplayer_t....

How do I get the vlm from vlc?

do I have to use the vlm interface and somehow port the above script into compatible programmatic steps?

Re: vlm via libvlc

Posted: 17 Apr 2013 01:40
by Jean-Baptiste Kempf
It works from main VLC?

Re: vlm via libvlc

Posted: 17 Apr 2013 18:28
by d3x0r
Yes. It also works when launched via libvlc loading, but it creates a seperate display window.

command line is basically

vlc -I dummy -vvv --fullscreen --no-audio --no-osd --video-x=%d --video-y=%d --width=%d --height=%d --mosaic-width=%d --mosaic-height=%d --mosaic-keep-picture --vlm-conf rtpserver.vlm --sout-keep --rtsp-timeout=-1

(the above script would be rtpserver.vlm)


(the above script was copied from code, hence the trailing `\n");`. Those aren't really in the script.

Re: vlm via libvlc

Posted: 17 Apr 2013 19:04
by Jean-Baptiste Kempf
TRy -Vdummy

Re: vlm via libvlc

Posted: 17 Apr 2013 19:42
by d3x0r
Okay; I also learned I wasn't getting a media_player_t; I was using media player from media, and in this mode, I don't pass a media... don't know if that is the fix, but am missing a large chunk of setup.

Re: vlm via libvlc

Posted: 17 Apr 2013 19:52
by d3x0r
-Vdummy does not open the directshow window, but I don't get any callbacks.

The VLM has a execute method that it uses to handle the vlm-conf parameter.... I could make these commands generate later? Maybe it's because the vlm is initializing its whole operation before I get to finish setting up callbacks, etc?

-----
Took the play commands from the end of the vlm script; added them back in after setting up a media player with callbacks/events. (called libvlc_vlm_play_media( ... channel1 ) ) after...

So without the play at the end, the extra direct draw display did not show.

After adding the call to vlm_media_play, then the direct show window appears again. (this is after setting up a media_player_t )

Re: vlm via libvlc

Posted: 17 Apr 2013 19:59
by Jean-Baptiste Kempf
Ok, and if you remove dst=display, from your command?

Re: vlm via libvlc

Posted: 17 Apr 2013 20:10
by d3x0r
Then I get no display popup, but I get no display. The network stream is being sent (with no video, connected a remote to it, and saw the video stream playing)

Re: vlm via libvlc

Posted: 17 Apr 2013 20:40
by d3x0r
I got a list of output modules, vmem is a 'memory output' not a video output, so that doesn't work.

the dummy interface is actually 'vdummy' tried Vvdummy , but that somehow ended up being the same as -Vdummy, and no output.
I tried wingdi, and it makes a popup like the direct3d.

I tried a combination of removing dst=display and the above, but then I just got no display.

For my application, maybe I'll just leave it with no display, and launch a second VLC on the local box to show the served stream... though would rather it was just one application to track.

Re: vlm via libvlc

Posted: 18 Apr 2013 01:09
by d3x0r
think can I add something like

?

setup output vmem
setup output vmem-lock=X
setup output vmem-unlock=X

I guess that wouldn't give me events though; and i need those just as much...

been browsing through the sources; would have thought that vlm would use the same primitives as media_player, and it does and doesn't....

not entirely sure what is a valid vlc_object_t to set the parameters on.. but I think I can't get the vlm object or item objects from the API (I could cheat and pull the libvlc_instance_t struct)

Re: vlm via libvlc

Posted: 18 Apr 2013 17:39
by RĂ©mi Denis-Courmont
Don't use VLM. Just spawn multiple media player instances from a single LibVLC instance.

Re: vlm via libvlc

Posted: 18 Apr 2013 18:23
by d3x0r
I don't see how that would make a picture in picture (mosaic) to send on the network stream? Is there some sample code for such a thing?