Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Samwise on Sun 17/06/2007 09:01:15

Title: Trouble Playing a Video File
Post by: Samwise on Sun 17/06/2007 09:01:15
Hello,

I've got a problem playing a video file in my game.  I've tried to find the solution in the manual and here, but no luck yet.

When I run the game with this command:
PlayVideo ("Jingle.avi", 0, 0);
in the "player enters room - after fade-in" script, the editor throws me back to the Windows XP desktop. 

The test game window still exists though, and after I restore the window (from the desktop)  it either plays the video properly, or jumps to the next command in the script.

Relevant information:
- The video is 640x480, just like the game resolution.
- The video is in AVI format is based on XVID codec, MP3 sound.
- The video plays perfectly when I run it with Windows Media Player.
- The video is saved in the game's compiled directory.
- I've tried to put the command in another script of another room, and bumped into the same problem.

What am I doing wrong?

Title: Re: Trouble Playing a Video File
Post by: Privateer Puddin' on Sun 17/06/2007 11:09:48
Could be something stealing focus.

The Heist by AJA had a tool / reg fix for sorting this

http://custardsclutter.com/divxfix.rar

Sounds like you'll need to use section 3 / 4 from the troubleshooting, you'll need to edit the reg file (open in notepad or something)  and replace GameName with yours.  Probably best to distribute something like this with yours.

I asked AJA permission to re-use this for Drug Bust.
Title: Re: Trouble Playing a Video File
Post by: AJA on Sun 17/06/2007 14:22:50
You might want to consider using WMV videos because they won't steal focus and pretty much every windows system has the codecs installed. Plus the compression isn't that bad either.
Title: Re: Trouble Playing a Video File
Post by: Samwise on Sun 17/06/2007 15:05:08
Privateer Puddin', thanks, it looks a little sophisticated to me but I'll try that later.

AJA, I thought about trying that too, but to my surprise, all the video converters I've tried to use (about 4-5 of them) weren't able to perform such a basic task.

Edit:

Ok, I've converted the movie to WMV, using Microsoft Movie Maker.  The movie does run now, but here's another problem: it cuts 2-3 seconds from the movie - I mean the movie's starting a little late.  Does this has a known solution?


(Also, there's another non-AGS related problem: the audio sounds kinda crappy after the convertion.  Does anybody know how to convert files to WMV without ruining the sound quality?)
Title: Re: Trouble Playing a Video File
Post by: AJA on Sun 17/06/2007 18:44:03
Hmm, I haven't noticed any problems with wmv videos in AGS.

Movie Maker's compression settings are apparently very limited. Try Windows Media Encoder (http://www.microsoft.com/windows/windowsmedia/forpros/encoder/default.mspx).
Title: Re: Trouble Playing a Video File
Post by: Samwise on Sun 17/06/2007 21:19:24
Thank you, I appreciate your help.

I've solved this issue by loading the AVI video and re-importing the audio on Windows Movie Maker, adding 3 seconds of black screen before the beginning and after the end of the movie file, and saving the whole thing as WMV.  Now it works  :)