Spout from VLC ?

Home Forums Spout Support Spout from VLC ?

This topic contains 16 replies, has 5 voices, and was last updated by  leadedge 1 month ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #2485

    norbertRostaing
    Participant

    Hello !

    maybe it is a stupid question, but it is possible to send videos in spout from VLC ?

    Thanks !

    #2486

    leadedge
    Keymaster

    Not so stupid. It would need a module made for Spout output. I have looked at it briefly and it should be possible to make one, but it wasn’t a simple job so I did not pursue it.

    #2487

    norbertRostaing
    Participant

    I’ve just looked this but, I have no idea how to do it >< (too strong for me)
    https://wiki.videolan.org/Hacker_Guide/How_To_Write_a_Module/

    If someone know how to make it

    #2488

    leadedge
    Keymaster

    Yes it’s not all that easy. This is not a simple job. The image format is complex. You would look at examples here :

    http://git.videolan.org/?p=vlc.git;f=modules/video_filter;hb=HEAD

    You would need to create an RGB or RGBA buffer from the input image. There could be some ideas for converting YUV > RGB in yuvp.c. There is also an OpenCV wrapper which might be useful as a guide. But then you have to create the shared texture. So this means initializing either DirectX or OpenGL. The spout object has to be initialized and a sender created. I have done a similar thing with SpoutCam and you could get some ideas from that.

    #2490

    norbertRostaing
    Participant

    I definitely cannot do that ๐Ÿ˜€

    #2903

    vdmokstati
    Keymaster

    You can use vvvv to capture vlc and via vvvv to spout to whatever..

    #2904

    vdmokstati
    Keymaster

    You can use vvvv to capture vlc and via vvvv to spout https://vk.com/topic-16165504_28370759

    #2907

    leadedge
    Keymaster

    I missed this one and will have a look at it.

    #2908

    leadedge
    Keymaster

    I had a few problems with this but it does work. I have re-packaged the required files in a zip file that can be downloaded here.

    1) Unzip and you end up with a folder “VLC to Resolume”.
    2) Go to “VLC to Resolume\core” and run “setup.exe” to initialize VVVV and check for dependencies.
    3) Go back to the “VLC to Resolume” folder.
    4) Run “Settings.bat”. Here you can change the output resolution and sender name. You can also use the patch now.
    5) Drop a video file or image to the window.
    6) Start the Spout demo receiver.
    7) RH click and enter the sender name used in the patch – default is “VLC” – and enter.
    8) The receiver should show the output of the patch.
    9) Start Resolume.
    10) In the Sources tab at right find “VLC” in the Spout sources.
    11) Drag to an empty cell.
    12) You can drag and drop different images or movies to the patch rendering window while it is running.

    After you have established the resolution and sender name and it is all working, you can use “Play.bat” thereafter to hide the patch window.

    This does not actually use VLC itself but libraries that VLC uses by way of “FileStream (DX11.Texture Vlc)”. It might depend on installation of VLC, and could also need the 64bit Version of VLC – I have VLC already installed and so have not tested it.

    If somebody could check all of this it would be good. Also I could not find out how to use it with other versions of VVVV.

    Eventually this could be updated to use the latest Spout nodes currently available in the alpha build.

    #2939

    lautaro.m.rainer
    Participant

    hi! i been trying to livestream from a gopro to resolume, iยดve managed to stream to vlc but i cannot drop it into the vvvv window because is not a file . is there anyway i can play the livestream on the vvvv window so i can then get it throug spout and then on resolume? thank you very much!!!!!

    #2940

    leadedge
    Keymaster

    It might be possible to use the Newtek NDI VLC plugin to create a network source from VLC, then use the “NDIreceiver” freeframe plugin to get the output into Resolume. You have the additional benefit that the output is available to any machine on the network.

    The NDIreceiver plugin is part of part of “Spout to NDI“.

    The Newtek VLC plugin is part of the Tools pack.

    Let us know how you get on.

    #3425

    robque
    Participant

    raising the main topic question again! ๐Ÿ™‚

    Why to use NDI if it has lag and missusing other system resources? vvvv is the most adequate choice atm, but I have a feeling that it is not as huge step to go for real VLC stand-alone.

    The things that are not allowing me to stay calm are these:

    Output modules like Direct3D video output, DirectX video output, Video memory output look very suspicious – it smells kike one of these is sharing video texture in shared memory already. And no need to convert from YUV (and it’s not too complicated few lines of code to do that if necessary).

    Eventhough i am still not capable to write plugins, I do understand very basics of programming and willing to give it a try if you will give me some hints what to look for in the code chunks! My idea is to modify some of existing source code of output modules.

    VLC spout!

    • This reply was modified 1 month, 1 week ago by  robque.
    • This reply was modified 1 month, 1 week ago by  robque.
    #3429

    leadedge
    Keymaster

    I looked at the VLC source code a while back and investigated creating a plugin. At the time it appeared to me that VLC images were handled on the CPU. I could not see how to produce the RGBA or RGB image pixels required for Spout output although I think this could be done. But none of the plugins use OpenGL and in order to send these pixels to Spout, it would be necessary to create an OpenGL context. Sometimes this can be difficult for multithreaded applications so I never proceeded with it.

    It is possible to use a DirectX texture directly rather than using OpenGL but it is not as easy. The requirements are set out in this document.

    I had another look at the video_output folder that you refer to, and it appears that VLC has an OpenGL output module. There is an RGBA conversion function in “vout_helper.c” and it might be possible to modify “vout_display_opengl_Display” for Spout output.

    I think the first task would be to rebuild VLC and get it working. Then you could examine how to add the Spout functions into the OpenGL output module.

    #3430

    robque
    Participant

    Yeah there is hell of challenge just to compile it… tried ubuntu, mingw already with no success yet ๐Ÿ˜‰ gonna try debian and other possible ways. Thaks a lot for the hints!

    There are as well wgl.c and glwin32.c in the folder in the picture, do you think it’s possible to find some hook in one of these?

    #3431

    leadedge
    Keymaster

    I have also tried without success. I guess you have already seen the VLC Wiki building guide. For MSYS+MinGW on Windows they say “Best of luck”!.

    In fact I really need to know much more about this to help. I think I have misled you by suggesting a full build.

    There is a section on building modules. Starting with the Hello world example it should be possible to create the required output module using either “glWin32.c” or “display.c” as the template.

    Presumably these build to “libglwin32_plugin.dll” and “libgl_plugin.dll” respectively. I am not sure which user options select these as output. Both are modules with the description “OpenGL video output”.

    I can’t immediately understand the detail of the code but initially I assume that, “Open” could be where the sender is initialized and “Close” where it is closed. “Control” could be where the sender is re-sized and maybe “Prepare” or “Display” could be where the Spout output would go or maybe within “vout_helper.c”. SpoutLibrary would have to be used for a MingW compile.

    Unfortunately I can’t help with this project right now which is why I have suggested the NDI to Spout interface. Improvement of the conversion utility to make the interface more transparent would help.

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.