liballeg / allegro5

The official Allegro 5 git repository. Pull requests welcome!
https://liballeg.org
Other
1.9k stars 285 forks source link

Feature Request: More video back-ends #1135

Open pmprog opened 4 years ago

pmprog commented 4 years ago

I was wondering how easy it would be to link ffmpeg or libav to the Video add-on to add support for more video formats.

chundermike commented 4 years ago

I think this was tried a couple of years ago, but dismissed due to the volatility of the ffmpeg API?

SiegeLord commented 4 years ago

I'm not against ffmpeg being brought back in, but I'd want it to happen in a way that shares logic as possible with the ogv backend (i.e. as part of adding ffmpeg back in, we'd refactor the common bits out). In addition to the volatility of ffmpeg's API, the fact that it used a completely separate re-implementation of synchronization/seeking etc logic meant that it doubled the maintenance burden (and when it was removed, it was already broken).

chundermike commented 4 years ago

But wouldn't you get OGV decoding for free if you used ffmpeg? Then you could remove the current ogv support perhaps and be left with one maintenance burden. Forgive me if I misunderstand...

SiegeLord commented 4 years ago

In principle yes, but a lot of the complexity lies in the synchronization code, and once that's separated from the decoding code, the maintenance burden is reduced significantly. After that, it doesn't matter as much how many backends we have. I'd still prefer to keep dedicated ogv around due to its stability and simplicity.

pmprog commented 4 years ago

Would libav be a better option then, if ffmpeg is a hard to use? Sorry, I've never used either, so just throwing ideas out there

guilt commented 4 years ago

There's a branch with ffmpeg that works but no audio. If anyone's willing to complete the audio portion it can fix this. The audio code with timers was too convoluted in vorbis to go in; I haven't had time to fix anything yet, but this code is quite usable. See:

https://github.com/guilt/allegro5/tree/kaku.FFmpeg.0