Page 1 of 1

problem with streaming when using libvlc 3.0.6

Posted: 22 Feb 2019 08:00
by bingjingshi
Hello,
I have a program using vlc win32 sdk + MFC in VS2010。The OS is WIN7, it works well in vlc2.2.8。
the sout option is

Code: Select all

"--sout=#duplicate{dst=udp{dst=127.0.0.1:1234},dst=display} " "--sout-keep"
Now I want to use vlc3.0.6 sdk, vlc.exe can also work well, Using libvlc sdk in the program it can display the video ,but can't stream out .
what's the problem?
Any input would be greatly appreciated!

Re: problem with streaming when using libvlc 3.0.6

Posted: 22 Feb 2019 17:15
by Rémi Denis-Courmont
I'm not sure how you are passing sout options, but streaming output was never supported in LibVLC - so you must have been relying on unsupported and undocumented behaviour that for a reason or other stopped working.

Re: problem with streaming when using libvlc 3.0.6

Posted: 25 Feb 2019 14:35
by bingjingshi
I'm not sure how you are passing sout options, but streaming output was never supported in LibVLC - so you must have been relying on unsupported and undocumented behaviour that for a reason or other stopped working.
This is my code,It work well in 2.2.8

Code: Select all

int vlc_argc = 0; char *vlc_argv[20]; CString str; str.Format("udp://@:5000"); vlc_argv[vlc_argc++] = "--network-caching=150"; vlc_argv[vlc_argc++] = "--sout=#duplicate{dst=udp{dst=127.0.0.1:1234},dst=display}"; vlc_argv[vlc_argc++] = "--sout-keep"; libvlc_instance_t *p_instance1 = libvlc_new(vlc_argc, vlc_argv); libvlc_media_t *p_media1 = libvlc_media_new_location(p_instance1, str); libvlc_media_player_t *p_media_player1=libvlc_media_player_new_from_media(p_media1); libvlc_media_player_set_hwnd(p_media_player1,dlg->GetDlgItem(IDC_STATIC_DISPLAY)->GetSafeHwnd()); libvlc_media_player_play(p_media_player1); while (1) { if (dlg->m_Quit) { break; } Sleep(1000); } libvlc_media_player_stop(p_media_player1); libvlc_media_player_release(p_media_player1); libvlc_media_release(p_media1); return 0;

Re: problem with streaming when using libvlc 3.0.6

Posted: 25 Feb 2019 17:22
by Rémi Denis-Courmont

Re: problem with streaming when using libvlc 3.0.6

Posted: 12 Jul 2019 09:20
by LookingAhead
Hi! I had a similar problem. My solution: '--sout' should be moved to libvlc_media_add_option() for VLC 3 and 4 versions;
For example:

Code: Select all

libvlc_media_add_option(p_media1, ":sout=#duplicate{dst=udp{dst=127.0.0.1:1234},dst=display}");