Author Topic: Best video format for AGS  (Read 5517 times)

KodiakBehr

  • Cavefish
  • Click click click click click...
    • KodiakBehr worked on one or more games that won an AGS Award!
    •  
    • KodiakBehr worked on one or more games that was nominated for an AGS Award!
Best video format for AGS
« on: 02 Sep 2015, 19:07 »
Was debating which forum to post this in, so no worries if it needs relocation.

Until now, we've been implementing video in .ogv format for the usual obvious reasons.  Problem is no matter how the video is compiled, the framerate just isn't as smooth in AGS as I would like.

With this in mind, is there any reason why we wouldn't want to use a MP4 with the H.264 codec instead?  That's pretty much as universal as it gets, isn't it?

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #1 on: 02 Sep 2015, 21:09 »
What about xvid, isn't that one free too?
There are those who believe that life here began out there...

selmiak

  • ǝsıɔɹǝxǝ ʞɔǝu puɐ uıɐɹq
    • I can help with play testing
    • I can help with proof reading
    • I can help with translating
    • I can help with web design
    • selmiak worked on one or more games that won an AGS Award!
    •  
    • selmiak worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #2 on: 02 Sep 2015, 23:05 »
xvid is getting old and has its flaws. MP4 with H.264 inside or .MKV with H.264 inside should be first on the list of video compatibility for AGS, especially with the new HD resolutions in AGS. After that of course XVID.

Problem

  • Cavefish
    • I can help with animation
    • I can help with characters
    • I can help with making music
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Problem worked on one or more games that won an AGS Award!
    •  
    • Problem worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #3 on: 03 Sep 2015, 08:38 »
Is there a way to check from inside AGS if a video has been successfully played? (I don't think so, because PlayVideo doesn't return anything.) This would allow us to use H.264 and have a fallback OGV if for some reason it doesn't play.

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #4 on: 03 Sep 2015, 08:52 »
Using h.264 would be no option for commercial developers (same as mp3), because of the pretty steep licensing fees.

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #5 on: 03 Sep 2015, 10:20 »
Also, does H.264 do lossless? That's important for low-res games.
 

Snarky

  • Global Moderator
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #6 on: 03 Sep 2015, 10:33 »
I would argue that even in a low-resolution game, there are very few use-cases for lossless video. Video is much more forgiving of minor compression artifacts, since because each frame is displayed for a very short moment, you don't have time to study it and notice them. A high-quality lossy encoding should be indistinguishable in practice and save a lot of storage. If you do need absolutely lossless video, you can just import the frames as sprites and display them as an animation.

In any case, x264 apparently allows encoding lossless into h.264 format: https://stackoverflow.com/questions/768999/what-is-a-good-lossless-video-codec

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #7 on: 04 Sep 2015, 13:10 »
I would argue that even in a low-resolution game, there are very few use-cases for lossless video. Video is much more forgiving of minor compression artifacts, since because each frame is displayed for a very short moment, you don't have time to study it and notice them. A high-quality lossy encoding should be indistinguishable in practice and save a lot of storage. If you do need absolutely lossless video, you can just import the frames as sprites and display them as an animation.

In any case, x264 apparently allows encoding lossless into h.264 format: https://stackoverflow.com/questions/768999/what-is-a-good-lossless-video-codec

yeah but sometimes you want to do sequences that look like actual gameplay, but without going through the hassle of scripting the whole thing. And in a pixel-art game, the transition between "real" gameplay" and video is not seemless if the codec is not lossless. That was a problem in many 90's games, such as Heart of Darkness.

If H.264 allows encapsulating lossless codecs such as x264, then I'm happy.
« Last Edit: 04 Sep 2015, 13:14 by Monsieur OUXX »
 

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #8 on: 04 Sep 2015, 13:40 »
About h.264 again: according to the MPEG-LA, everything under 100.000 units is free, after that, it's 0.20$ per "encoder", which I suppose can be interpreted as a game. So for most of us, h.264 pricing shouldn't be a big deal - even for the commercial devs.

Btw. this is also a quite interesting read:
http://www.gamasutra.com/view/news/170671/Indepth_Playing_with_video.php


KodiakBehr

  • Cavefish
  • Click click click click click...
    • KodiakBehr worked on one or more games that won an AGS Award!
    •  
    • KodiakBehr worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #9 on: 05 Sep 2015, 03:31 »
Thanks for pointing out this information to us -- this is something I'm afraid I would have overlooked otherwise.  I guess we'll pursue the H.264 and see about obtaining a license.

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #10 on: 05 Sep 2015, 11:42 »
Honestly this was more a pointer towards OGV ;)
But since I haven't worked with videos in AGS since .flc, I obviously have no idea how good the Theora implementation is.

Problem

  • Cavefish
    • I can help with animation
    • I can help with characters
    • I can help with making music
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Problem worked on one or more games that won an AGS Award!
    •  
    • Problem worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #11 on: 05 Sep 2015, 12:08 »
It's pretty bad unfortunately. I don't know why, but the built-in video playback just doesn't run smoothly, at least for high resolution games. On some PCs even the audio stutters. Other video formats work much better, maybe because they are not played by AGS? Of course the best solution would be to improve the performance of the built-in OGV playback, because it doesn't depend on any codecs being installed, but for now we'll try our luck with H.264.
I don't know much about Windows codecs, is it safe to assume that the H.264 codec is installed on current Windows machines?

KodiakBehr

  • Cavefish
  • Click click click click click...
    • KodiakBehr worked on one or more games that won an AGS Award!
    •  
    • KodiakBehr worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #12 on: 09 Sep 2015, 13:49 »
H.264 is supposed to be pretty universal.  However, AGS delivered an interesting error when it attempted to play an external .mp4.  Note that I have no trouble running this .mp4 outside of AGS, but when being called through AGS, it says:



This is a message generally associated with a filter/codec absence.  But the video runs just fine outside of AGS, so I'm at a loss for explaining why things are different inside.  Is this an engine bug?

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #13 on: 09 Sep 2015, 19:07 »
My guess is that Allegro does not have the codec to render the video, and therefor gives that error.
You have no idea how many head bangs I have given cause VirtualDub refuses to load any mp4 file, or mkv, or... >:(
There are those who believe that life here began out there...

Problem

  • Cavefish
    • I can help with animation
    • I can help with characters
    • I can help with making music
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Problem worked on one or more games that won an AGS Award!
    •  
    • Problem worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #14 on: 09 Sep 2015, 19:48 »
This has nothing to do with Allegro. The AGS manual says that AGS plays anything supported by Windows Media Player.

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #15 on: 11 Sep 2015, 16:39 »
This has nothing to do with Allegro. The AGS manual says that AGS plays anything supported by Windows Media Player.
You said the vido plays well outside of AGS, but with what player? For example if you use VLC they have their own codecs embedded, they don't care about what's on your system.
 

KodiakBehr

  • Cavefish
  • Click click click click click...
    • KodiakBehr worked on one or more games that won an AGS Award!
    •  
    • KodiakBehr worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #16 on: 13 Sep 2015, 03:20 »
It ran perfectly in Windows Media Player.  With no idea why we're having issues with MP4s in AGS, we're currently trying to make do with Theora, which is good for the universality and the lack of codec licensing issues.  We're dropping the framerate and resolution a fair bit, but it still chugs...just a little less so.

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #17 on: 13 Sep 2015, 09:00 »
I'm not sure what frame rate you are using, but keep in mind that animated series/movies only normally use 15fps. Your video is mostly still pics, so you could probably drop the rate fairly low with still decent show... or import the "spites" and code the intro in AGS. (Which am currently considering for my own intro, since I haven't had much success playing AGS videos on my system so far).
There are those who believe that life here began out there...

Problem

  • Cavefish
    • I can help with animation
    • I can help with characters
    • I can help with making music
    • I can help with play testing
    • I can help with scripting
    • I can help with translating
    • Problem worked on one or more games that won an AGS Award!
    •  
    • Problem worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #18 on: 13 Sep 2015, 16:55 »
The camera zooms and parallax layers in the video can't be done in AGS at this resolution, so the intro would have to be a lot simpler without a video. We've dropped the framerate a bit, which makes the video playback more stable. 15fps is too low though, the camera movement doesn't look good this way. But I think with careful testing we can find a compromise between video quality and smooth playback.

abstauber

  • Cavefish
  • still mowing the lawn
    • abstauber worked on one or more games that won an AGS Award!
    •  
    • abstauber worked on one or more games that was nominated for an AGS Award!
Re: Best video format for AGS
« Reply #19 on: 14 Sep 2015, 09:01 »
Did you already try AJA direct3d plugin?
http://www.adventuregamestudio.co.uk/forums/index.php?topic=45348.0

Since it seems like it addresses D3D directly, you might see better performance - or at least you can corner the culprit ;)