[vlc-devel] Split video output with LibVLC

Tobias Rapp t.rapp at noa-archive.com
Mon Oct 24 08:35:47 UTC 2022


On 24/10/2022 09:48, Steve Lhomme wrote:
> Hi,
> 
> On 2022-10-24 9:41, Tobias Rapp wrote:
>> On 21/10/2022 21:01, Rémi Denis-Courmont wrote:
>>> Le 21 octobre 2022 16:45:59 GMT+03:00, Tobias Rapp 
>>> <t.rapp at noa-archive.com> a écrit :
>>>> Hi,
>>>>
>>>> I'm currently trying to integrate LibVLC into one of my native 
>>>> Windows applications. Passing in a window handle via 
>>>> libvlc_media_player_set_hwnd() and starting playback works fine.
>>>>
>>>> Now I'd like to send video to two outputs simultaneously: Once to 
>>>> the window handle and another, scaled-down version to some callback 
>>>> handler for other visualization controls within the application.
>>>>
>>>> Is it possible to use libvlc_media_player_set_hwnd() and something 
>>>> similar to libvlc_video_set_callbacks() at the same time, where only 
>>>> the output sent to the callbacks is processed by some resize filter?
>>>>
>>>> Best regards,
>>>> Tobias
>>>>
>>> Hi,
>>>
>>> This is not possible currently. You need to use callbacks for all 
>>> tracks, which is inefficient but at least it works.
>>>
>>> Or then you need to modify LibVLC.
>>
>> I'm currently looking into writing a custom module for that. Do you 
>> think it would be better to create a video output module for the 
>> down-scaled memory callbacks, or use a filter module that is inserted 
>> before the window handle output? Is this just a matter of taste or are 
>> there technical implications when choosing between those two?
> 
> If the second visualization is just the first one scaled and displayed 
> in a different location, it's possible to use the D3D11 callbacks for 
> that. You render into a texture and then you use that texture in your 
> code to display it in 2 different places. The scale will be handled on 
> your side (which can have a bad impact of subtitle rendering).

Good to know. But in my case I use the second output for calculating 
some other real-time video information like Y/U/V level meters. The 
reason I don't plan to do those statistics directly inside a LibVLC 
module is that I want to be more independent from architectural changes 
inside of LibVLC. Thus I'd like to pass video data in some fixed format 
to my outer application and do the rest there.

Regards,
Tobias



More information about the vlc-devel mailing list