|
|
Comments and Discussions
|
|
 |

|
This has saved me so much time. Thanks for sharing. Dankeschön.
|
|
|
|

|
hello!
I am newcomer in this field.
I like your article abort VLC.
However,not work for me.I find that the return value find libvlc_new is NULL.
Do you know why??
|
|
|
|

|
I had an occasion to use this wrapper in my project. Great that you managed to port it to newer version of VLC.
|
|
|
|

|
Hello,
Very nice wrapper !
I've juste replaced
(LPCTSTR)file
in the following line :
vlcPlayer_.OpenMedia((LPCTSTR)file);
by the URL or address of the source to test.
It's working fine with rtsp protocol and IP camera, with screen://// or with the path of video file in my disk.
But if I use an internet source like Youtube, it doesn't work !
vlcPlayer_.OpenMedia("http://www.youtube.com/watch?v=b-3oWajA6ZQ");
Do you know why ???
regards
|
|
|
|

|
Even if I replace in OpenMedia method pMedia_ = libvlc_media_new_path(pVLCInstance_, pMediaPathName);
by pMedia_ = libvlc_media_new_location(pVLCInstance_, pMediaPathName); which seems to be indicated for valid URL, the internet video isn't displayed.
However, libvlc_media_player_play API doesn't return error.
I really don't understand why it doesn't work with such URL.
|
|
|
|
|

|
i can not inherit my app's class from public CDialog,what am i missing>
and i also cant declare CStatic,what could be wrong?
Please elaborate a little on how and what files i should include.
I am including the headers mentioned in the article.And they do get included without any problem.
|
|
|
|

|
Excellent! Thanks.
In my application, I need play a movie and auto-repeat the playing until the Stop button is hit. Here is how I did based on the VLCWrapper in this article:
1. Define a couple of more members in class VLCWrapperImpl:
libvlc_media_list_t* pMediaList_;
libvlc_media_list_player_t* pMdeiaListPlayer_;
2. In the VLCWrapperImpl constructor, add
pMediaList_ = libvlc_media_list_new(pVLCInstance_);
pMdeiaListPlayer_ = libvlc_media_list_player_new(pVLCInstance_);
libvlc_media_list_player_set_media_list(pMdeiaListPlayer_, pMediaList_);
libvlc_media_list_player_set_media_player(pMdeiaListPlayer_, pMediaPlayer_);
libvlc_media_list_player_set_playback_mode(pMdeiaListPlayer_, libvlc_playback_mode_loop);
3. In VLCWrapperImpl::OpenMedia(...), replace
libvlc_media_player_set_media(pMediaPlayer_, pMedia_);
with
libvlc_media_list_add_media(pMediaList_, pMedia_);
4. In VLCWrapperImpl::Play(), replace with
libvlc_media_list_player_play(pMdeiaListPlayer_);
Similar changes apply in ::Pause() and ::Stop().
Just share it here in case someone wants to know.
Shhu
|
|
|
|

|
Bel article merci
Comment activer le désentrelacement?
Je seche
Merci
|
|
|
|

|
Solved
1. Create new project MFC Aplication
2. Aplication Type Dialog Based
- Use MFC in shared dll
- Use Unicode libraries
3. copy VLCWrapper.cpp, VLCWrapper.h, VLCWrapperImpl.cpp, VLCWrapperImpl.h
in Project folder
find stdint.h in internet and put in Project folder
4. from http://www.videolan.org/vlc/ Download latest VLC zip package, Unzip,copy from VLC folder to project folder
sdk\lib -> to project folder name Lib
sdk\include\vlc -> to project folder name vlc
plugins (.dll) -> to project folder name plugins, to Release and Debug folder name plugins
copy libvlc.dll, libvlc.dll.manifest, libvlccore.dll -> to project folder, to Release and Debug folder
create emptu folder lua in project folder
5. Modify Project propertis for Debug and Release
Project-> General Aditional include Directories : .\,.\vlc
Linker -> General -> Additional Libray Directories: .\lib
Linker -> Input -> Additional Dependences : libvlc.lib libvlccore.lib
6. Modify Project propertis for Release
Linker -> Optimization -> Keep Unreferenced Data: (/OPT:NOREF)
7. Modify Solution Explorer -> Source Files -> Properties only for VLCWrapperImpl.cpp, VLCWrapper.cpp
Properties -> C/C++ -> Precompilied Header -> Create/Use Precompilied Header : Not Using Precompilied Header
8. in xxDlg.cpp put #include
in xxDlg.h put #include "VLCWrapper.h"
9. put LGPL licenz, autors for used source in project
10. for unicode bulid change
CString file = FileDlg.GetPathName();
// Kind of like a symbol of UTF-16 convertible is usually not more than 3 char in UTF-8
char pszMediaPathNameUTF8 [1024 * 3];
WideCharToMultiByte (CP_UTF8, 0, file, -1, pszMediaPathNameUTF8, _countof (pszMediaPathNameUTF8), NULL, NULL);
vlcPlayer_.OpenMedia( pszMediaPathNameUTF8);
10. build project
|
|
|
|

|
Hi Alex, thank you for providing this interesting project.
I've a problem with your demo VLCDialog.
I use a German Windows, and media files may contain Umlauts like ÄÖÜ...
There are special chars > 127 in many other European languages.
These files are not displayed, because libvlc_media_new_path afaik requires UTF-8 coded strings, not ANSI or Windows-1252. Thus the file paths should be converted to UTF-8 before.
As I do not use MFC, but plain Windows API, I would use the unicode version of the open file dialog GetOpenFileNameW and convert the UCS-2 output to UTF-8 with WideCharToMultiByte. Perhaps MFC has sth. similar.
Regards,
Fred
|
|
|
|

|
Sorry for my bad english
Nice project, this is only complete project for use VLC API in VS c++ who i've found on the net.
I want create new project for begin, modify project properties and include everything for building, but not work.
There is something specifically for use VLC API in VS c++.
You probably do not want these things to share. Major project and not a working full example VS c++ than that.
The purpose of the GPL is to use or change. Apparently VLC policy is to not modified much and use independently.
My goal is to put VLC in my project which base class is not CDialog.
These are no more than 20 changes in the code to implementation.For ordinary programmer is hard to find this
If you a little help
thank you
|
|
|
|

|
Nice wrapper.
Can I play videos directly from my application's resources without extracting them to a local location?
Thanks
modified 15-Aug-12 10:28am.
|
|
|
|

|
I am also interested in this. Somebody knows how please?
hunt
|
|
|
|

|
Nice app, but it only shows video under XP, not Win7 (file plays but screen is black).
For playing video under Win7 with vlc player I have to set the video output to WinGDI or Direct2D (Extras->Settings->Video).
But how can I do this using libvlc?
Problem solved:
I have to add "--vout=direct2d" into vlc_args.
|
|
|
|

|
Nice work. Very helpful.
I am building a 64 bit MFC application. When i build the demo you provided in x64, it fails to link since the dll / lib files are win32.
Is there a x64 version of libvlc?
Thank you.
Geri
|
|
|
|
|

|
not to familiar with c++
b.ware
|
|
|
|

|
You no longer have to copy the .dll.a files to the .lib files. They are now included
sdk/lib directory.
|
|
|
|

|
Anyone uses new VLC 2.0.0 version ?
TIA
|
|
|
|

|
Hi,
Just to point out that libVLC is almost LGPL see this commit.
|
|
|
|

|
Thank you for the hint, I will update the article as soon as I have some time!
|
|
|
|

|
Does the new licensing allow someone to add the libs to a closed source application for resale without any costs?
|
|
|
|

|
Hi,
I tried streaming via HTTP using the released binary for VLC, and this worked very well for my purposes. Has anyone had any experience/exposure to using the VLC source code and libs to perform streaming in there own application?. I was very pleased to be able to download this example you have posted here, and rebuild and run it myself with NO hitches whatsoever. i thank ALL of you who contributed to this!
I DID look at the online wiki - developers corner, and the streaming page is only a placeholder. perhaps i will try to contribute to that after i conquer my own learning curve on this subject. I have little or no experience with multimedia playback application development, hence keen interest in VLC. i won't have to re-invent any wheels!
I also looked at the "vlc_stream.h" header file, and see the methods outlined, but this still doesn't provide a clear operating concept. I only want to duplicate the streaming functionality that i was able to do with the released binary from vlc.org
Any help, comments, pointers, anyone has will be much appreciated.
Thanks,
Dave Doyle
|
|
|
|

|
Ok, so ... never mind. I figured out 'how to fish' on my own. It turns out its 'pretty' easy to stream from libVLC, but the wiki and documentation are a little cryptic if you aren't already familiar with streaming concepts and methods, etc. the required code changes are here, i just edited the VLCWrapperImpl::OpenMedia method as follows: void VLCWrapperImpl::OpenMedia(const char* pszMediaPathName) { const char *media_name = "mybroadcast"; libvlc_instance_t *vlc; char sout[1024] = "#transcode{vcodec=h264,vb=0,scale=0}:http{dst=:8080/go.mpg}"; vlc = libvlc_new(0, NULL); libvlc_vlm_add_broadcast(vlc, media_name, pszMediaPathName, sout, 0, NULL, true, false); libvlc_vlm_play_media(vlc, media_name); Sleep(1000 * 45); libvlc_vlm_stop_media(vlc, media_name); libvlc_vlm_release(vlc); MessageBox(NULL, "Video Streaming Complete", "Done", MB_OK); } A couple of notes on what i did above. 1. my aim was to stream a chosen file vs play it locally. (I will work on making it play locally while streaming next, but this isn't essential for my effort) 2. To keep things 'simple', i created a new VLC instance each time, and trashed it when i was done. This may prove problematic down stream, (all the creating and releasing) so i'll likely revisit this concept as well, i.e. try to resuse the main instance created w/ the vlc wrapper class 3. i was just looking to HTTP broadcast a video segment (no sound) to several remote PCs in the same subnet, not over the internet (i have no idea how much more complicated that is?) 4. in this way, i can view the stream locally via: "vlc http://127.0.0.1:8080/go.mpg" or remotely using "vlc http://xxx.xxx.xxx.xxx:8080/go.mpg", where the xxx's are the real ip address of the host machine 5. i am fairly sure adding the audio portions just involves some monkeying w/ the transcoding part "#transcode{vcodec=h264,vb=0,scale=0)" ... see the documentation for this. 6. another next step is to move some of this code to spread these functions out, so that the open button just loads the video, and the "play' begins the streaming (and possibly the displays it here also?). the stop will stop the stream. 7. clearly what i have above is 'crude' and just a 'proof of concept' test, but many times thats all thats needed to make your way to what you want/need. again, i thank you for your work here, this gave me the 'shoulders to stand on' so i could see what i needed to see. I am on my way to incorporating the streaming function into my application. Dave Doyle
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
An article on wrapping libvlc (VLC media player) in a C++-class
| Type | Article |
| Licence | CPOL |
| First Posted | 13 Aug 2009 |
| Views | 146,389 |
| Downloads | 10,867 |
| Bookmarked | 136 times |
|
|