Video Addon - al_open_video() always returns null
chundermike

Hi,

I'm trying to use the Allegro 5.2.2 video addon, but al_open_video() always returns NULL. al_init_video_addon() is returning ok, and the file I'm trying to open is in the expected place. I've even tried the example in github (https://github.com/liballeg/allegro5/blob/5.1/examples/ex_video.c) and even that doesn't work. I've tried many types of video file (mpg, mp4, off, wmv) and they all return null when I try to open them. I've tried Windows, linux and Raspberry Pi environments and they all have the same problem.

I'm thinking now it's something to do with not having a backend (ogg or ffmpeg) installed, but I've absolutely no idea how to do this. I can't find anything on the web anywhere explaining what to do.

Could someone please explain how I can get the video addon working please? (Windows preferably, but ideally linux too).

Many thanks in advance,
Mike

SiegeLord

The extension needs to be .ogv, and the contents need to have the theora codec for video and optionally ogg codec for audio. I've attached a test video you can try.

chundermike

Thanks for the quick reply. I tried your example and it worked fine :)

So I guess I'll have to convert all my videos into ogv format (using ffmpeg) now?

Would the only way to write an app which accepts other formats (such as mp4) be to use a different addon (or code it myself)?

Also I have seen the ffmpeg backend mentioned as being supported in the past, but if I understand correctly this has been removed due to stability issues? If this were re-instated would it be capable of accepting non-ogv video formats?

Many thanks again,
Mike

SiegeLord

So I guess I'll have to convert all my videos into ogv format (using ffmpeg) now?

Yep.

Quote:

Would the only way to write an app which accepts other formats (such as mp4) be to use a different addon (or code it myself)?

Basically, yeah.

Quote:

Also I have seen the ffmpeg backend mentioned as being supported in the past, but if I understand correctly this has been removed due to stability issues? If this were re-instated would it be capable of accepting non-ogv video formats?

For better or worse, ffmpeg likes to change its APIs very often and what used to be in Allegro stopped working at some point. I spent a bit of time trying to get it to work without much success, so in an effort to get the video addon to be released with Allegro 5.2 at all, that backend got removed. It'll take a bit of work to get it back (e.g. I would consider the refactoring proposed in https://github.com/liballeg/allegro5/issues/604 to be the essential start), but there's no philosophical reason why it can't be done.

chundermike

Many thanks again

Just one last question on this topic if you don't mind...can I have more than one instance of an ALLEGRO_VIDEO and, if so, how I distinguish between their different ALLEGRO_EVENT_VIDEO_FRAME_SHOW events? (Sorry I cannot find much documentation on the ALLEGRO_EVENT_VIDEO_FRAME_SHOW type to indicate if it has any fields)

Thanks,
Mike

SiegeLord

ALLEGRO_EVENT_VIDEO_FRAME_SHOW is a user event with event.user.data1 field set to the video pointer.

Thomas Fjellstrom

Would you be able to also check the event source? I imagine it should get set to something useful like other events?

Thread #616702. Printed from Allegro.cc