Playing OGV problem

Started by Daniel Thomas, Sun 10/03/2013 12:16:30

Previous topic - Next topic

Daniel Thomas

So we have been trying to get our intro movie to play smooth in AGS.
We can't use WMV since it doesn't work in D3D fullscreen, OGV seems to play so it leaves us with that.

But we're experience a lot of different problems. The main problem is that it doesn't play smooth when there is, for an example, screen scrolling.
We had some other odd behavior like sound getting out of sync.

So the first thing that comes to mind is, of course, it has to be performance related. We tried on 3 computers that was fairly powerfull, but it's still stuttering.
BUT it does play perfect in a media player, so we must assume there is something with how AGS plays the video.
We tried all kind of encoding options, very low quality, high quality, changing resolution etc. Nothing of those helped.

The only thing that helped was if we did NOT play the audio in the video, then the video played great and without problems. So we had to assume the Audio was the problem. We made sure to try and encode the audio with lowest quality etc, but same problem. The thing is, just playing the video but disabling sound (so the sound is still encoded in the video) helped.


So right now we only have 3 bad options.
1) One would be to play the video and audio separately (Video from OGV and audio from a sound clip), problem is it WILL get out of sync as soon as the computer can't render/play everything at perfect performance.
2) Play the video as it is, with the imperfections of AGS resulting in a stuttering video. It doesn't feel good and is kind of taking out the experience - I think you all know how it is to play a video and you get slow buffering.
3) Use WMV, but restrict the game to not be played in Fullscreen. This is a bad solution as I think a game should be experienced in fullscreen to get the best immersion.

So my questions, do any of you had similar problems? Found any solutions? Know any in depth knowledge about the AGS code that can be causing this?
Any tips is appreciated!
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Daniel Thomas

I obviously don't know anything about the AGS code, but is AGS using a very old version of the OGG codec?
Does it matter? Is there any newer?
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

selmiak

I've had problems with encoding video to ogv and playing it in AGS too. then I used this online coverter and it worked.
I have no idea what they do different to all my programs I have on hdd.
also you could try  this tool. Haven't tried it myself though.

GoToHellDave

Hi.

I recently made an intro video for our game but the frame rate is extremely choppy. I was just wondering if anyone on the forums knows of any way to counter this issue. I'm using .ogv and calling it in the room_load function. I thought that the slowdown may be being caused by all of the stuff going on in the loaded room behind the video, so I tried running it in the room_AfterFadeIn function in the hopes of circumnavigating the issue, but it just comes up as a blank screen.

As always, any help is appreciated.

Ben.

Daniel Thomas

#4
@selmiak: What kind of problem did you have with the video before?
The encoding itself should be fine I think, it plays great in a ordinary media player, and we tested a lot of different encoding settings and different versions of ffmpeg2theora. All result with playing fine in VLC, but in AGS there is a bit video stuttering.

@Ben, Maybe you can start a empty project and just try and lead the video, atleast then you can see if it's related to the "background" processes of the room.
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Khris

I recorded TombRaider gameplay using fraps (~3 minutes, @ half-size, i.e. 960x540).
The resulting avi was 1.6 GB.
Converted it with ffmepg2theora 0.29 and got a 60MB ogv file.

Put it in a 800 game, in AfterFadein, and it runs flawlessly. No stuttering, nothing.

Crimson Wizard

This may be related, or completely unrelated, but I remember there was a problem that some anti-virus programs may cause slowdowns when engine loads data, embedded in EXE, in high rate.

Daniel Thomas

@Khris, just to make sure, you did have audio in the video, right?
Stupid question maybe, but it worked fine in a 1024 project too?
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Khris

Yes, the video has the game's audio in it.
I made an empty 1024 game and played the video in the first room. I tried all four combinations of DD5 and DX9, windowed and fullscreen.
Works fine and runs smoothly every time.

I'm sorry, I know this isn't really helping. I don't know what the cause of the stuttering is; maybe it's just the audio codec.

Daniel Thomas

Yea I know, just trying to rule out different factors.

I'm not sure if it can be audio codec.. Doesn't Theora encode with it's own codec, so the source of the audio shouldn't matter?

The only reason I think it's a AGS problem is that it plays perfect in VLC.
Maybe it's the source file itself somehow, but it's just RAW AVI. And it does this on two different videos and has been exported from two different programs.
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Khris

One thought I had:
If you made a sample video, just some random stuff, and it also stuttered on your machines, you could upload it somewhere for us to put in a game and see how it's going to run.
Did you try putting one of your videos in an empty game?

selmiak

I don't quite remember what my problem was, but iirc the video didn't even play correctly in VLC and it was even worse in AGS. Did you try the online converter? It magically fixed it for me!
And there was some crap with a black border on top but I fixed this before even encoding the video the first time...

arj0n

Isn't this problem the combination of: (a)the video not playing correct while (b)the screen is scrolling.
So this problem might not be (completely) the video itself.

Daniel Thomas

#13
The video play fine in VLC (for all 3 of us who have tested it), so it shouldn't be the video itself.
It's just more noticeable when there is a screen scrolling/panning in the video as it's suppose to move smoothly. It's not noticeable on static scenes with just a few animation.

@Selmiak: Haven't tried the online converter. The raw AVI is 15gb, so it's way above their limit.
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

Snarky

VLC is a highly optimized, highly compatible, dedicated video player. It is to be expected that it can play some videos fine that AGS can't. The question is whether there's some way to encode an OGV video (in the desired quality) so that it works in AGS, or if it requires a change to the engine.

I think we've established that:

1. Some OGV videos play fine in an empty AGS game on some computers.
2. Some other OGV videos do not play fine in a non-empty AGS game on some other computers (but play fine in VLC).

In order to determine whether the difference is due to the computers, the enclosing AGS games, or the videos, you each need to test some of the other scenarios.

Once you've done that, it will be easier to figure out whether this problem can be fixed by changing the video (using a different encoder or something), changing AGS, or not at all.

Daniel Thomas

#15
Ok, so to summarize so far
1) Starting a new project didn't make any difference
2) The Video play fine in VLC and Miro. I do realize that they are dedicated media players.. But still.
3) It does, however, play perfect when disable/mute video audio in AGS (using flag 10 in PlayVideo). Playing the audio separately in the room instead doesn't affect the video, it still plays perfect.. So I would assume it has something to do with how AGS play the Video audio?
4) Someone mentioned to me that another game had the same problem, The Journey Down, with a scrolling background - there was stuttering.
5) We have tried several different ffmpeg2theora versions, with different settings (like low quality, low bitrate - both on video and sound. Scaling down the video etc).
6) We have tried on different computers, and testers have reported the same problem.

EDIT:
7) I did a new encoding with the audio disabled. It played perfect in AGS.
Check out The Journey of Iesir Demo | Freelance artist, check out my Portfolio

GoToHellDave

I've been experimenting with this on and off for the last 24 hours and I've found that, when I downloaded and used a much lower quality video from youtube, it ran perfectly. So I'm going to go and reduce the quality of our intro video and see if that helps at all.

Gabarts

My experience on this argument.
I've found a thread in the forum about ogv format conversion...
File size dropped, no quality loss and playing in VLC. So I compiled the game and all worked. I was happy :)

But then launching the game I can't hear sound in my intro...
With avi. works fine, but size is bigger of course.

SMF spam blocked by CleanTalk