How to control video rendering window during streaming ?

This forum is about all development around libVLC.
Claupacius
Blank Cone
Blank Cone
Posts: 12
Joined: 01 Dec 2011 18:08

How to control video rendering window during streaming ?

Postby Claupacius » 01 Dec 2011 18:18

Hi,
I have encountered a problem controlling output video window, while using VLM on Windows platform.


For example, I make the following calls :

Code: Select all

const char *sout = "#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=d:\\\\test.mp4},dst=rtp{dst=localhost,port=5004,mux=ts},dst=display}"; int iRes = libvlc_vlm_add_broadcast(_vlcInstance, "mybroadcast", "dshow://", sout, numOptions, options, TRUE, 0); iRes = libvlc_vlm_play_media(_vlcInstance, "mybroadcast");
One of the dst parameters is a display, e.g. I want to see input video in application frame.
When streaming is initialized Direct3D output window pops out and shows dshow stream.

How this window can be controlled ? I'd like to host video window inside my app. A standard call to libvlc_media_player_set_hwnd can not be used here, because there is no libvlc_media_player_t object here.

Another problem is that video freezes in this window when h264 codec is used. While using DIV3 encoder this does not happen. What can be a reason for that ?
Thank you in advance.

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: How to control video rendering window during streaming ?

Postby Rémi Denis-Courmont » 01 Dec 2011 18:33

You should be able to set the "drawable-hwnd" option manually to the HWND value.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Claupacius
Blank Cone
Blank Cone
Posts: 12
Joined: 01 Dec 2011 18:08

Re: How to control video rendering window during streaming ?

Postby Claupacius » 05 Dec 2011 13:07

Thank you for the fast reply.

I'm trying to add this parameter to options array like ":drawable-hwnd=12345", and also to output string, like :

const char *sout = "#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=d:\\\\test.mp4},dst=rtp{dst=localhost,port=5004,mux=ts},dst=display},drawable-hwnd=12234";

But none of these options worked.

What is wrong here ?

Thank you

bzuidgeest
New Cone
New Cone
Posts: 3
Joined: 10 Jun 2011 16:12

Re: How to control video rendering window during streaming ?

Postby bzuidgeest » 16 Dec 2011 18:27

To bad Remi has not replied to your question again. I just ran into your problem and would like to know the answer to. From what I can quickly gather from Remi's answer and google is that this is an vlc 1.2 option, so you might want to test with that version and I think you should set drawable-hwnd to the options collection but without an :.

These are just suggestions as I'm a noob to this kind of thing, but who knows?

turgut
New Cone
New Cone
Posts: 3
Joined: 08 Dec 2012 15:51

Re: How to control video rendering window during streaming ?

Postby turgut » 10 Jul 2013 08:14

Hello guys,

Is there any workaround for this issue?

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to control video rendering window during streaming ?

Postby Jean-Baptiste Kempf » 10 Jul 2013 16:55

which issue ? There are a few in this thread...
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

turgut
New Cone
New Cone
Posts: 3
Joined: 08 Dec 2012 15:51

Re: How to control video rendering window during streaming ?

Postby turgut » 26 Aug 2013 10:45

Hello and sorry for late reply,

I would like to display content on custom widget while streaming. I pass drawable-hwnd value as parameter. But Direct3D windows pops out.

Any idea?

Code: Select all

const char * const vlm_args[] = { "-I", "dummy", // don't use interface "--ignore-config", // ignore VLC's config QString("--drawable-hwnd=%1").arg(StringUtils::fromHex( (ulong)_wdgDisplay->winId() )).toStdString().c_str() }; _instance = libvlc_new( sizeof(vlm_args)/sizeof(vlm_args[0]), vlm_args ); _broadcastName = name; QString url = QString("rtsp://%1:%2/speaker.sdp").arg( _ip ).arg( QString::number( _port ) ); QString opts = QString("#transcode{vcodec=mp4v,vb=800,acodec=mpga,ab=128,channels=2,samplerate=44100,deinterlace,audio-sync}" ":duplicate{dst=rtp{sdp=%1,mux=ts},dst=display}" ).arg( url ); short pc = 2; const char * params[2]; params[0] = QString("dshow-vdev=" + captureDevice.getVideoDevice().getName() ).toStdString().c_str(); params[1] = QString("dshow-adev=" + captureDevice.getAudioDevice().getName() ).toStdString().c_str(); int res = libvlc_vlm_add_broadcast( _instance, _broadcastName.toStdString().c_str(), "dshow://", opts.toStdString().c_str(), pc, params, true, 0 ); if ( res != -1 ) { if ( libvlc_vlm_set_enabled( _instance, _broadcastName.toStdString().c_str(), 1) != -1 ) { if ( libvlc_vlm_play_media( _instance, _broadcastName.toStdString().c_str() ) != -1 ) { if( libvlc_errmsg() ) { throw UnableToStreamMedia( libvlc_errmsg() ); } else { emit started(); } } else { libvlc_vlm_set_enabled( _instance, _broadcastName.toStdString().c_str(), 0); throw UnableToStreamMedia( libvlc_errmsg() ); } } else { throw UnableToStreamMedia( libvlc_errmsg() ); } } else { throw UnableToStreamMedia( libvlc_errmsg() ); }

VLC v2.0.7
OS: Win7

Thanks in advance,

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: How to control video rendering window during streaming ?

Postby Jean-Baptiste Kempf » 28 Aug 2013 00:29

Is the drawable plugin built in?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 11 guests