View Full Version : Video support within ClanLib applications
martinsmith160
11-08-2011, 04:07 PM
Hi All,
Just a quick question, is there any functionality in Clanlib to allow playback of a video sequence within an application. Such as a cutseen or something similar.
All the best.
rombust
11-08-2011, 07:42 PM
Currently there is no direct support for it.
There are various ways to achieve it, depending what platform you wish to target.
Basically you obtain the pixel buffer of the image and upload it to a CL_Image/CL_Texture. (The fastest uploading method is using a OpenGL pixelbuffer object)
If I remember correctly 2 developers have done this using different techniques.
I am not sure if the source is available anywhere
http://esoteric.clanlib.org/~mbn/temp/cvideo.png
martinsmith160
11-10-2011, 08:54 AM
Thanks for the reply, I dont know if I fully understand what you mean. I am developing a game for the windows platform. Do you know the names of the developers who achieved video playback so I can get in contact with them.
All the best,
Magnus Norddahl
11-11-2011, 04:38 AM
Image linked by Rombust was my 'CVideo' project, which used ffmpeg to render video. It has problems with audio getting out of sync for long playback, and its subject to the licensing requirements of ffmpeg.
If you want the source code for it I can upload a zip file.
rhurst
01-08-2012, 07:51 PM
If it helps any, calling mplayer externally with -wid will attach to a ClanLib window as descibed in its man page:
-wid <window ID> (also see -gui-wid) (X11, OpenGL and DirectX only)
This tells MPlayer to attach to an existing window. Useful to embed MPlayer in a browser (e.g. the plugger exten‐
sion). This option fills the given window completely, thus aspect scaling, panscan, etc are no longer handled by
MPlayer but must be managed by the application that created the window.
I like to know if there is a way to return a ClanLib window's "wid" as described here? I can set_title("tv") to a window, and a system call to xdotool search --onlyvisible --name 'tv' to fetch the wid result externally, works, but kind of ugly.
martinsmith_storm
01-27-2012, 02:54 PM
Image linked by Rombust was my 'CVideo' project, which used ffmpeg to render video. It has problems with audio getting out of sync for long playback, and its subject to the licensing requirements of ffmpeg.
If you want the source code for it I can upload a zip file.
Hi Magnus
Sorry for the delayed response, I seemed to have lost the link and didn't see any email responses. I would greatly appreciate if you could send me the video player code so i could take a look at it. The videos I would play would be small short sequences that most likely wouldn't have sound so that shouldn't be and issue.
Thanks so much.
Martin
Magnus Norddahl
01-28-2012, 02:31 PM
You can download the source code from here: http://esoteric.clanlib.org/~mbn/CVideo.zip
It includes a compiled ffmpeg library and a Visual Studio 2008 project. This also indicates that I haven't built it a single time since I installed Visual Studio 2010, so I have no idea if it builds or not. :)
Magnus Norddahl
01-29-2012, 02:07 AM
Being a bit bored, I wrote a new player that uses the WebM format instead: http://esoteric.clanlib.org/~mbn/WebMVideo.zip. The license should be a bit more usable since it doesn't rely on FFmpeg.
Since rombust loves pictures of Star Trek TNG, here's one from WebM:
http://esoteric.clanlib.org/~mbn/temp/webm.jpg
Just don't compare them for quality since it was a convert of the already awful quality movie I had. :)
martinsmith_storm
01-30-2012, 08:43 AM
Thanks a lot Magnus.
I downloaded the .zip but im running visual studios 2008 and the solution wont open on mine. So i will take the files and try and set it up in 2008.
Thanks a lot for the help, much appreciated.
All the best,
Martin
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.