Page 1 of 1

How to control video rendering window during streaming ?

Posted: 01 Dec 2011 18:18
by Claupacius
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.

Re: How to control video rendering window during streaming ?

Posted: 01 Dec 2011 18:33
by RĂ©mi Denis-Courmont
You should be able to set the "drawable-hwnd" option manually to the HWND value.

Re: How to control video rendering window during streaming ?

Posted: 05 Dec 2011 13:07
by Claupacius
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

Re: How to control video rendering window during streaming ?

Posted: 16 Dec 2011 18:27
by bzuidgeest
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?

Re: How to control video rendering window during streaming ?

Posted: 10 Jul 2013 08:14
by turgut
Hello guys,

Is there any workaround for this issue?

Re: How to control video rendering window during streaming ?

Posted: 10 Jul 2013 16:55
by Jean-Baptiste Kempf
which issue ? There are a few in this thread...

Re: How to control video rendering window during streaming ?

Posted: 26 Aug 2013 10:45
by turgut
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,

Re: How to control video rendering window during streaming ?

Posted: 28 Aug 2013 00:29
by Jean-Baptiste Kempf
Is the drawable plugin built in?