Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video playback jitter #28

Open
FolkertVanVerseveld opened this issue Sep 8, 2019 · 7 comments
Open

Video playback jitter #28

FolkertVanVerseveld opened this issue Sep 8, 2019 · 7 comments
Assignees

Comments

@FolkertVanVerseveld
Copy link
Owner

In-game video's are using an AVI codec that is not properly supported by
the open source AVI library. Except the very first intro, all even and
odd frames look swapped, giving lots of jitter.

There is no workaround at the moment on linux, because I am definitely
not going to write an AVI player myself... on windows, we may use the
win32 API, but something tells me that is not going to be easy either...

@sandsmark
Copy link

what codec is it? and isn't it supported by ffmpeg?

@FolkertVanVerseveld
Copy link
Owner Author

It uses Indeo 41 video codec, which is primarily used for video games
from the '90s since it is one of the first codecs to play reasonably
well on a lightweight machine. Since the codec is obsolete, there is
only partial support for any playback tool except the old Windows media
player. ffmpeg does not properly support it either.

Only INTRO.AVI seems to play correctly, but all other AVIs have lots of
jitter to the extent it becomes unbearable to watch. Frankly, ffplay in
Ubuntu and Xubuntu 18 LTS only plays a couple of frames before bailing
out. I have also looked at another 3rd party playback library (can't
remember the name), but that one just crashed for any indeo 41 codec AVI
I tried to play with and the video stream was almost completely green.

In conclusion, I am not going to support something that only partially
works. The game currently tries to play all intro AVIs, but I am going
to ignore all broken AVIs or remove AVI playback alltogether. It would
be cool if it eventually would support proper indeo 41 playback or even
convert them to accomodate for the poorly 3rd party support, but at the
moment, I would consider this a nice to have feature that is almost
certainly not going to be added in the first playable prototype.

@sandsmark
Copy link

scummvm has an indeo implementation (with explicit support for indeo 41) based on ffmpeg's implementation, have you tested that?

When you said video games from the 90s scummvm was the first thing I thought of. :-)

Here's their indeo4 code; https://github.com/scummvm/scummvm/blob/master/image/codecs/indeo4.cpp + https://github.com/scummvm/scummvm/tree/master/image/codecs/indeo fwiw

@FolkertVanVerseveld
Copy link
Owner Author

That is interesting. I haven't tested that particular implementation
yet, but if it doesn't extend on ffmpeg's implementation it probably
won't work (ffmpeg's implementation is even worse than VLC's the last
time I checked). At the moment, fixing the video playback is on low
priority, so I probably won't check this until I've completed the new
rendering engine and game logic.

@sandsmark
Copy link

Sorry, my comment was a bit ambiguous, but they only started with ffmpeg's implementation and then improved it to get it working with the games they support.

And I understand that video is low on the list, I'll see if I find some time to at least test their implementation with the aoe videos. :-)

@FolkertVanVerseveld
Copy link
Owner Author

Ah okay, I was confused at first with your comment, but that makes
sense. I have looked at their code to see if I can integrate it or
import as an external library, but that is going to take some time.

Thanks for notifying me of scummvm, because I would have never
considered that they may have a working indeo decoder. I will update
this once the implementation is being worked on.

@sandsmark
Copy link

fwiw, I explored a bit more, and it seems like both all the aoe1 and aoe2 videos are the same wrt. to bpp, colorspace, etc. So I don't think even a full-fledged indeo41 implementation is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants