How can one play a FLV file from Youtube in a C++ application?
I'm using C++ to get Youtube video links, but now I would like to be able to play a stream in my application.
Using C++ wxWidgets, what cross platform 开发者_JAVA技巧options do I have?
Look at existing video players like mplayer or vlc that can both play flv files. It you want a something a a somewhat lower level, Qt::media supports Gstream that supports flv. However this might go against what you want as you use wxwidgets.
Then, you can directly look into integrating GStreamer in your app.
The wxMediaCtrl class in wxWidgets is used to play video:
http://docs.wxwidgets.org/stable/wx_wxmediactrl.html
http://docs.wxwidgets.org/trunk/classwx_media_ctrl.html
On MacOS X and Windows wxMediaCtrl uses the native backend, and on Linux GStreamer. I don't know if the native backends on the first two support flv.
FFMPEG supports demuxing and decoding of the FLV format (among others), and is the best implementation I know of besides Flash itself. It's relatively easy to use, and it's used by all of the software others have suggested for decoding of Flash Video.
After some searching in google I believe there isn't something pre-made in C++ that will match WxWidgets but you should be able to find a decoder and use it's API.
精彩评论