Struggling with a "video playing error", and resolution of the game

Started by Noto, Tue 15/03/2016 03:15:41

Previous topic - Next topic

Noto

The past week has been extremely frustrating, in which every technical aspect of AGS and my game have refused to cooperate on every level. The two primary issues have stemmed from both how AGS handles video, and the game's resolution.

Much of my game relies on videos, which I export using the ".wmv" extension. For a long time, they ran flawlessly, but suddenly, seemingly out of nowhere, they stopped working. Whenever the game needs to load one, it gives me this error message:



Unsure of what to do and remembering that my previous game (which was done in the 3.4 alpha of AGS) ran .wmv's without an issue, I decided to make the switch and upgrade the game by making it now in the 3.4 alpha. Thankfully, it did work, and my .wmv files ran perfect. Earlier today, however, I decided to test the game in .exe format, and after building the .exe the .wmv files would, again, not work.  It now gives me the same error as shown above.

I have a strong feeling this is related to the .wmv extension itself, but converting them to another format wouldn't quite work. Aside from the larger file size, it would undoubtedly result in a loss of quality. For me, .wmv files are most preferable, so this is a frustrating obstacle.

As for resolution, for the first month I've developed my game I did it in 800 x 600, but then read up that apparently widescreen is a much more preferable resolution. I began to redo everything accordingly in 640 x 480, mistakenly thinking it was widescreen because of its resemblance to 640 x 400 -- which IS a widescreen resolution. A really stupid mistake, I know. Still, I found the game ran perfect in 640 x 480, and 800 x 600, but upon making it to 640 x 400 I began to run into an issue with the test-run (F5) of the game, which would always open it in a much larger preview window. The game would look significantly worse in terms of quality, and I'm sure this is just because the preview is larger, but I don't know entirely. All my backgrounds are in 640 x 400, so it's nothing to do with that. I'm wondering now -- was it worth all the work I did to make it widescreen? Should I go back and start over again?


So, these have been my issues, and I've run into a wall in trying to address them. Any help or insight would be much appreciated!


Edit: Resolution's no longer a problem, but video still is.


Grok

Maybe you should give the .ogv format a try anyway. It might be better than you fear. :)

For the problem of the larger preview window you might want to check the settings in the winsetup.exe file.





Noto

I make all my cinematics in Sony Vegas 9, and unfortunately I don't believe it has an .ogv format. If it did, I'd definitely take the advice. Thank you!

As for the preview window, the first thing I did was check the settings, but I didn't have any luck playing with them. In the end I think I'm going to go with what I started with -- 800 x 600 -- which means I'll have to redo everything again, but that's my own fault for not backing things up.

So my resolution issue I guess is addressed on account of me being paranoid, but I'm still stuck with the video error.

Khris

I also recommend switching to ogv; you can convert the videos using http://v2v.cc/~j/ffmpeg2theora/

As for previewing the game, try building it with F7, then using winsetup in the Compiled folder to set how it runs. Subsequent test runs should now use that setting.

Noto

I looked around the link you gave me, but I'm not very code-savvy, so couldn't make heads or tails of it. I couldn't find any sort of instruction on how to convert the videos, and what I downloaded appeared to be a fully-working SNES emulator. I'm assuming I'm doing something wrong there.

And, I had tried messing around with the winsetup, but couldn't get it to work the way I wanted to on the previous resolution. I ended up going back to 800 x 600, so thankfully that's not a problem anymore.

Danvzare

A SNES emualtor?
Just... how!?!
Just download the Windows build, or click on this link which should download it for you: http://firefogg.org/nightly/ffmpeg2theora.exe
As for how you convert it. Just drag and drop the video file onto the program. It's as simple as that.

Crimson Wizard

The preview window size is not strictly bound to game native resolution. It is determined by the player's config. That is - even if you make game 800x600 again and it will work well for you, some of your players will still be able to run it scaled up in very large window.
I just want to say, that changing game resolution when you run in a problem like that is a rush and excessive solution.

There are two reasons that could happen to your preview window:
1) You are using alpha version of AGS that has a bug in it, that did not apply configuration properly. We had such problem in AGS 3.4 before, but I think the latest public release (3.4.0.6) has it fixed.
2) You do not choose appropriate settings in cofig. For instance, there is a setting that will try to run your game in largest window possible. If you turn that on by mistake, you will keep getting large window.

I would advise to update to the latest AGS 3.4 version, unless you already did that (in this case we are talking about new bug, which should be investigated); you may also try this: copy acsetup.cfg from Compiled folder into _Debug folder by hand.

If nothing works, please tell which settings exactly do you use to run your game.

Noto

Quote from: Danvzare on Tue 15/03/2016 11:04:08
A SNES emualtor?
Just... how!?!
Just download the Windows build, or click on this link which should download it for you: http://firefogg.org/nightly/ffmpeg2theora.exe
As for how you convert it. Just drag and drop the video file onto the program. It's as simple as that.

I asked myself the same question! On their website I went to "downloads", and downloaded the "source" rar file. I extracted it, and from that I got a SNES emulator.

Appreciate the link! I was going to say it didn't work, as opening it did nothing, but I realized you literally just drag the files into the .exe. It works perfect now, seemingly! I'll try testing the files in-game.

Edit: It seemed too good to be true, and unfortunately it was.



Damn.

Quote from: Crimson Wizard on Tue 15/03/2016 11:29:07
The preview window size is not strictly bound to game native resolution. It is determined by the player's config. That is - even if you make game 800x600 again and it will work well for you, some of your players will still be able to run it scaled up in very large window.
I just want to say, that changing game resolution when you run in a problem like that is a rush and excessive solution.

There are two reasons that could happen to your preview window:
1) You are using alpha version of AGS that has a bug in it, that did not apply configuration properly. We had such problem in AGS 3.4 before, but I think the latest public release (3.4.0.6) has it fixed.
2) You do not choose appropriate settings in cofig. For instance, there is a setting that will try to run your game in largest window possible. If you turn that on by mistake, you will keep getting large window.

I would advise to update to the latest AGS 3.4 version, unless you already did that (in this case we are talking about new bug, which should be investigated); you may also try this: copy acsetup.cfg from Compiled folder into _Debug folder by hand.

If nothing works, please tell which settings exactly do you use to run your game.

I'm using the latest version of the alpha, so hopefully the first possibility is ruled out, then. I'm assuming it's the second part, and I'm almost certain it is. I will go ahead and do that, but I don't think I'll be able to tell now that I changed the resolution back to 800 x 600. I would have stuck with the new resolution (640 x 400) if not for the fact I'd need to redo several more backgrounds of the game, which I'm just fed-up doing at this point. I suppose once I go into the testing phase and distribute the game and the issue persists, I'll let you know!

Grok


I believe that the message
    unable to load video 'Montagefinal.ogv'

indicates that the program is trying to play the movie, but can not find it.

That could be due to spelling the name of the movie file wrong or to the file not being in the place where the program expects to find it. The file should be in the main folder
(where you have the different room files) when you compile the game to an exe file. Or at least that is how I do it. :)

Crimson Wizard

A quote from the manual:
Quote
There are two distinct type of videos that the PlayVideo function can play.
The first is OGG Theora, which is a recently introduced video file format. AGS has built-in support for playing these videos, so everyone who plays your game will be able to see the video. OGG Theora videos are also built into the game EXE file when you compile the game (just make sure the file has a .OGV extension and is placed in your main game folder).

The second type of files that AGS can play is anything supported by Windows Media Player. This includes AVI, MPG and more. However, in order for these to work on the player's system, they will need to have the correct codecs installed. For example, if you create your video with the XVid codec, the player will need to have XVid installed to be able to view it. These types of video cannot be included into the game EXE, so you will have to place them separately in the Compiled folder for them to work.

Noto

Thank you both! My mistake was thinking the .ogv videos worked the same way as .wmv videos did -- I placed them in the compiled folder, and wasn't sure why gave me that error.

Placing them in the main folder, they worked! The only problem are two very slight black bars on the top and bottom, which make the transition from game-to-video noticeable. With the .wmv files, they were mostly seamless -- from the black-bar standpoint, at least. Is there any way to get rid of those?

Grok

Quote from: Noto on Tue 15/03/2016 21:54:24
--- The only problem are two very slight black bars on the top and bottom, --- Is there any way to get rid of those?


I don't have the same problem, so it doesn't seem to be a general ogv-problem.

Could it be that the size of the movie is different from the game size. Maybe something changed when you converted the movie?

If you play the movie separately outside the game, does it look OK then?

You could also try to change the third variable in the PlayVideo function.

    PlayVideo("MovieIntroS.ogv",eVideoSkipAnyKey, 1);

     0: the video will be played at original size, with AVI audio
     1: the video will be stretched to full screen, with appropriate
         black borders to maintain its aspect ratio and AVI audio.
     10: original size, with game audio continuing (AVI audio muted)
     11: stretched to full screen, with game audio continuing (AVI audio muted)

Doesn't seem to do any difference for me, as far as movie image sizes goes. But you could give that a try.


Noto

First off, thank you! These feel like really trivial concerns I'm running into at this point, so I really appreciate you sticking it out with me.

That's good to know. I doubled-checked my videos in Sony Vegas -- everything was fine there, as was the actual rendered .wmv video itself, so I assume it's like you say -- that something went wrong in the conversion. If I play the video itself, it appears to be in the exact same resolution as the game.

Trying to change the setting on PlayVideo doesn't fix it, unfortunately.

And looking closer, there's no black bar on-top at all. That was an error on my part -- the black bar is only on the bottom.

To give a visual example of why this is somewhat of an annoyance, I took a few gifs of the game:
https://i.gyazo.com/31a3fe4a24a7a62399da6775cc34bdec.gif
https://i.gyazo.com/b854857251b105890f071dbcb93cd837.gif

(It's supposed to be ridiculously corny.)


Khris

Maybe somebody who's familiar with editing the engine source could fix the ogv playback's y-position?

Edit: I took a look at this:
https://github.com/adventuregamestudio/ags/blob/master/Engine/media/video/video.cpp
In line 120 (stretched playback), there's this:
Code: cpp
 drawAtY = scrnhit / 2 - fliTargetHeight / 2;

In line 139:
Code: cpp
 drawAtY = scrnhit / 2 - gl_TheoraBuffer.GetHeight() / 2;


Looks fine, but maybe there's a quirk that'll move up the video slighly? I'm just spitballing here.

Crimson Wizard

Quote from: Khris on Thu 17/03/2016 22:15:22
Looks fine, but maybe there's a quirk that'll move up the video slighly? I'm just spitballing here.
I could not find anything suspicious yet too.
The thing to investigate, IMO, is to check what the Theora codec gives to AGS. Maybe the frame is already broken at that point.

SMF spam blocked by CleanTalk