Video player component using ffmpeg?
Video player component using ffmpeg?
Hey,
I'm looking for a way to load video inside a wxWidget application. The format support should be platform independent (not using DirectShow, GStreamer, QuickTime etc.) and it should be possible to access and manipulate the pixel data.
My idea is using the ffmpeg libraries for video decoding, but what is the best way to display video (scaling should also be possible)? I do not need maximum performance like 4k120p or high-end scalers, but it should be easily possible to play normal FullHD video on standard hardware.
I looked around and couldn't find anything, has anybody already done something like that?
Best regards,
Stefan
I'm looking for a way to load video inside a wxWidget application. The format support should be platform independent (not using DirectShow, GStreamer, QuickTime etc.) and it should be possible to access and manipulate the pixel data.
My idea is using the ffmpeg libraries for video decoding, but what is the best way to display video (scaling should also be possible)? I do not need maximum performance like 4k120p or high-end scalers, but it should be easily possible to play normal FullHD video on standard hardware.
I looked around and couldn't find anything, has anybody already done something like that?
Best regards,
Stefan
-
- Super wx Problem Solver
- Posts: 466
- Joined: Tue Jun 20, 2006 6:47 pm
- Contact:
Re: Video player component using ffmpeg?
This is a wrapper around FFMpeg that sounds like it does what you want.
Re: Video player component using ffmpeg?
You could also try wxVLC:
viewtopic.php?f=20&t=44697&p=185130
viewtopic.php?f=20&t=44697&p=185130
Use the source, Luke!
Re: Video player component using ffmpeg?
Thanks for your fast answers!
Best regards
Stefan
I know that project, but I don't see any connection to wxWidgets or am I missing something? I'm looking for a connection between ffmpeg and wxWidgetsNew Pagodi wrote:This is a wrapper around FFMpeg that sounds like it does what you want.
That seems to be more what I'm looking for, I thought VLC was not option after they switched to Qt. Question is if I can access the video data, I need more that just a wrapper that allows me to include the VLC player in my application. Also I would prefer ffmpeg based on the simple fact is much smaller to build.doublemax wrote:You could also try wxVLC:
viewtopic.php?f=20&t=44697&p=185130
Best regards
Stefan
Re: Video player component using ffmpeg?
Qt is only used for the GUI. The component uses libvlc which has a plain C interface.That seems to be more what I'm looking for, I thought VLC was not option after they switched to Qt.
The wxVLC component probably doesn't expose all libvlc functions, but in libvlc you can install callbacks that are called for each frame with the frame data in RGB.Question is if I can access the video data, I need more that just a wrapper that allows me to include the VLC player in my application.
Use the source, Luke!
Re: Video player component using ffmpeg?
I had a look a libvlc, but it doesn't seem to expose all the internals I need to access compared to the ffmpeg api.
Is there a simple way to display video (decoded data from some buffer) using wxWidgets efficiently? Or do I need some other library like SDL for that?
Is there a simple way to display video (decoded data from some buffer) using wxWidgets efficiently? Or do I need some other library like SDL for that?
Re: Video player component using ffmpeg?
The only information libvlc gets from wxWidgets in wxVLC is a window handle. If you can find a way to let ffmpeg render into a window given by a window handle, that should be enough.Is there a simple way to display video (decoded data from some buffer) using wxWidgets efficiently? Or do I need some other library like SDL for that?
Use the source, Luke!
Re: Video player component using ffmpeg?
As far as I understand the ffmpeg api, what I get is a buffer with a decoded image and metainformation (width, height, pixel format, timestamp...)
The functions from the API do not display any video. What I would need is something I could que buffers in and that displays it according to the timestamps.
The functions from the API do not display any video. What I would need is something I could que buffers in and that displays it according to the timestamps.
Re: Video player component using ffmpeg?
There is nothing like that in wxWidgets.What I would need is something I could que buffers in and that displays it according to the timestamps.
Just out of curiosity: What features that you need are missing in libvlc?
Use the source, Luke!
Re: Video player component using ffmpeg?
I already assumed that, because I found a lot of posts of people having trouble combining wxWidgets and SDL...
I need to able to access the raw frame data, which seems to possible but complicated, but I also need to access the exact timestamp of each frame and be able to control what frame is shown precisely, not just play/pause, but show next frame, show previous, goto frame 1234 etc. This is possible with ffmpeg, although not for all formats perfectly and requires some additional steps (like scanning the entire file at the beginning, the project previously linked is able to do exactly that). libvlc seems to be lacking this features.
Re: Video player component using ffmpeg?
This sound more like the requirements for a video editor. So, is high performance, hardware accelerated output a necessity? If not, you could just take the frame data, convert it to a bitmap and display it.
Last year someone needed to display a video stream from a camera on a Raspberry and i hacked together some code that could display a 640x480 bitmap at 1300 fps on a fast PC using OpenGL.
viewtopic.php?p=183279#p183279
Last year someone needed to display a video stream from a camera on a Raspberry and i hacked together some code that could display a 640x480 bitmap at 1300 fps on a fast PC using OpenGL.
viewtopic.php?p=183279#p183279
Use the source, Luke!
Re: Video player component using ffmpeg?
Not a video editor, because no video export is needed, but actually video analysis. High performance is not needed, but normal non-jerky playback of 1080p30 should be easily possible (with resize to the panel).
That looks very interesting and 1300fps is way more than I need.
Re: Video player component using ffmpeg?
I just wrote one.
https://github.com/dolmens/wxFFmpeg
https://github.com/dolmens/wxFFmpeg
Re: Video player component using ffmpeg?
dolmens, I tried compiling your wxFFmpeg project and ran into some issues. I posted where I'm at on your github issue queue.