Sound of my video has a delay that is getting worse every second

Started by qinzha, Thu 20/03/2025 18:40:07

Previous topic - Next topic

qinzha

Hello, it's me again :) I've created a video (ogv) and would like to use it as an intro sequence at the beginning of the game. It starts as intended but for some reason the video and the audio aren't in sync and and it gets worse the longer the video runs. Is there a way to fix this?

The code I use is:

Code: ags
[code]PlayVideo("Introsequenz_v01.ogv", eVideoSkipNotAllowed, 0);[code]

I use it in the global script at the beginning of the function:
[code=ags][code]function game_start()[code]

Thank you in advance! :)

Crimson Wizard

First of all please clarify: does it play fine when you open it by a video player program?
In other words is the problem in video or in how AGS plays it?

Then, how does AGS compare to the external video player? Does the image run same speed and sound becomes slower, or does the sound run same speed and frame changes become faster?

One known issue is that the video player in ags skips "black frames". This is mentioned in the two older conversations:
https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/how-play-two-videos-one-right-after-the-other/msg636661268/#msg636661268
https://www.adventuregamestudio.co.uk/forums/advanced-technical-forum/problems-with-ogv-video/

qinzha

Quote from: Crimson Wizard on Thu 20/03/2025 20:38:27First of all please clarify: does it play fine when you open it by a video player program?
In other words is the problem in video or in how AGS plays it?

Then, how does AGS compare to the external video player? Does the image run same speed and sound becomes slower, or does the sound run same speed and frame changes become faster?

One known issue is that the video player in ags skips "black frames". This is mentioned in the two older conversations:
https://www.adventuregamestudio.co.uk/forums/beginners-technical-questions/how-play-two-videos-one-right-after-the-other/msg636661268/#msg636661268
https://www.adventuregamestudio.co.uk/forums/advanced-technical-forum/problems-with-ogv-video/

I've checked the video in two different media players, and it plays as intended in both. I also looked again at how it plays with AGS
and it definitely doesn't skip any black frames because I can still see the smooth fading-transitions (otherwise they would be interrupted somehow).

The thing is, that the video seems to get slower, not faster and the audio sounds fine to me :S

Crimson Wizard

Quote from: qinzha on Fri 21/03/2025 10:05:33The thing is, that the video seems to get slower, not faster and the audio sounds fine to me :S

Sorry for now replying earlier. I don't really know what to say based on this information. There are two possibilities here: either AGS does not decode the video properly, or it fails to play it with proper speed because things go slowly for some reason.

Could you tell which resolution your game and your video are, and maybe you could upload your video somewhere to let me check it out? (You can PM me the link if you don't want to post it in public)

SMF spam blocked by CleanTalk