(OGV) Video Images going faster than the music in AGS?

Started by Rik_Vargard, Sun 22/10/2023 17:43:18

Previous topic - Next topic

Rik_Vargard

I have that .ogv file that's working fine in any video reader.
But when I launch it in AGS, the video part goes like twice as fast as the music, like they are unlinked.

Here's the code (I've tried it all :

PlayVideo("Music-01.ogv",eVideoSkipNotAllowed, 1);

.avi files work just fine in AGS, but I'd like to know why .ogv ones don't.

Anyone having experience in using videos in AGS?


eri0o

@Rik Vargard , sorry, can you share the video file somewhere so it can be analyzed? Afaik video should play in engine with it's images and audio in sync. The audio is played in the same audio system used by audio clips.

Crimson Wizard

Multiple games used ogv, there may be something specific about this particular ogv, or maybe something got broken in a particular version of the engine.

Quote.avi files work just fine in AGS, but I'd like to know why .ogv ones don't.

Please tell which version of AGS do you use, because latest version does not support avi.

Rik_Vargard

@Khris @Crimson Wizard thx for the reply :)


Here's a link to the video : VIDEO LINK

I used this website to convert from mp4 to ogv OGV converter online
Perhaps there's a better one that's used for AGS videos?

The AGS version I use:
AGS Editor .NET (Build 3.5.1.27)
v3.5.1, March 2023

But don't worry about the avi files anymore (because of the latest version I'll have to install after I finish this game)

Little side question: Why can't we use mp4? Files are smaller and quality is better...?

Thx!

Khris

I created a test game with 3.5.1 and can confirm that the video track runs faster than the sound track. The video finishes about 5 seconds early, the screen simply stays black while the audio track plays to the end.

The same thing happens in the latest 3.6.0 build and 3.99. In VLC, the video is in sync.

eri0o

But does it reproduces in 3.6.1? I remember that 3.6.1 had video specific fixes.

About other video formats that answer is either the video library is at least the size of AGS (AV1 dlls are around 4MB) or bigger (vpx stuff is around 20-40MB), or the licenses are not compatible, or patents+license. H.264 patents apparently expire in 2027, so maybe we get to be able to use that stuff after - like it happened with mp3.

Note that exploring video codecs and stuff takes a lot of developer time, so the way we will go is probably to make a small unified decoder API in a way it's easy to build a shim around an existing library and making it a plugin for ags.


Btw opus audio suffers the no library with compatible license issue (see https://nothings.org/stb/stb_opus.html)

Crimson Wizard

#6
Quote from: Khris on Tue 24/10/2023 10:30:06I created a test game with 3.5.1 and can confirm that the video track runs faster than the sound track. The video finishes about 5 seconds early, the screen simply stays black while the audio track plays to the end.

The same thing happens in the latest 3.6.0 build and 3.99. In VLC, the video is in sync.

Given this occurs in every AGS version, this also may be a mistake or limitation either of the OGG Theora library which decodes this, or APEG library (intermediate between Theora and AGS).

I'd like to check the video properties and see what may be the difference between this and other ogvs that work.

Rik_Vargard

Hello guys, thank you so much for looking into this.

I don't know you guy's philosophy on being always there ready to help at any time, and I also know this isn't just that beginners' script problem.  :P
All I want to say is that there's no pressure or impatience on my end here, and that I know that one day this will be fixed. (nod)

(still hoping to read about this concerning version 3.61 tho  :P )
(And thx for the mp4 explanation, I went to see the pricing and yes, it's worth waiting for 2027  (laugh) )
---

I've been thinking on how to do this the AGS way and I think I have that idea where I export the movie without sound.
Then have a separated music and sounds only file.
And then I can put the three in AGS and script the thing.
I guess I'll have to go back and forward editing and exporting until the timings are right but I know it will work.

So! Thank you again and above all, cheers!  :)




Crimson Wizard

3.6.1 did not have any improvements to videos, and 3.99 was tested which is on par with 3.6.1 in this.

eri0o

@Crimson Wizard there is something different because Lorenzo's Stranger in Utopia had some black screen/audio unsync issue that was fixed by just changing to 3.6.1 from the 3.6.0 that he started development in, I remember because I was testing the game. I don't really remember anything different in the code, but my ask to try in 3.6.1 is from remembering that is something that indeed worked for some reason. Maybe the 3.6.0 was an old one that had such issue, I don't remember really, but this is why the game ended being released using 3.6.1.

Crimson Wizard

There's also a small chance that if 3.6.1 has some performance improvements then the game runs somewhat faster and video syncs better.

But to be fair the video playback in AGS lacks proper sync mechanism. I started writing a simple one in the past, but never completed, it was in the midst of various changes and refactor in 3.6.0.
Would be nice to have it implemented anyway.

Rik_Vargard

Quote from: Crimson Wizard on Wed 25/10/2023 21:13:47There's also a small chance that if 3.6.1 has some performance improvements then the game runs somewhat faster and video syncs better.

But to be fair the video playback in AGS lacks proper sync mechanism. I started writing a simple one in the past, but never completed, it was in the midst of various changes and refactor in 3.6.0.
Would be nice to have it implemented anyway.

That would be very nice indeed. (nod)

SMF spam blocked by CleanTalk