project-navigation
Personal tools

Author Topic: OGM videos made easy - buffer issue in game playback though...  (Read 6862 times)

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
I was close to getting working presets for various GUIs for Mencoder and FFMPEG, it got kind of messy after a bit, but then I found a better solution:

The 1.0.0 release candidate for VLC media Player has a Ogg/Ogm conversion preset built-in that works terrific for making working OGM files.  It isn't in the 9.9 release, but the RC runs fine on my test (Win32) system and the conversion preset works fine out-of-the-box without any need for adjusting bitrate or any other settings.

Converting is easy - just download the RC installer on Windows, use the easy and friendly wizard for conversion ("Convert/Save") under "File" and select the preset for "Video - Theora + Vorbis (OGG)" after picking a filename with "ogm" extension.

It doesn't get much easier than that.

The encoding worked in *realtime* on my test system, much faster than RoQ-encoding with WinFF.

The quality is also much better than RoQ.

One issue though: With playback inside the game, video and audio both stutter a bit, as if the buffers are just a little too small and should be increased.  I could be wrong, it might be some other bug, but I'm guessing it's a buffer issue.

If anyone else wants to test this, just use any video file that VLC will read, it should work.
« Last Edit: August 24, 2010, 01:51:52 pm by bayo »

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: OGM videos made easy - buffer issue in game playback though...
« Reply #1 on: June 08, 2009, 04:52:21 pm »
Hang on, I did some more testing, and found that some videos - depending on how the source original is encoded - have audio/video sync errors.

I'll be doing some more testing and experiments to see if I can correct a few things, I *might* be able to fix the stuttering with some adjustments to the way the files are transcoded, I'll report back later.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: OGM videos made easy - buffer issue in game playback though...
« Reply #2 on: June 08, 2009, 06:04:18 pm »
i've tested with big buck bunny and there it worked fine

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: OGM videos made easy - buffer issue in game playback though...
« Reply #3 on: June 08, 2009, 06:34:15 pm »
i've tested with big buck bunny and there it worked fine

Funny coincidence, Big Buck Bunny just happens to be one video I used for testing, and I was also going to recommend it for others to test with as well!  I downloaded the AVI stereo version.  On a side note, I only watched the short movie for the first time about a month ago, I found it entertaining even though I'm probably a bit older than the intended viewer, and had a good laugh.

I've been playing with conversion and encoding options, I'm still getting stuttering in playback on Windows, the type that usually means a buffer issue, and I'm having this with videos from all different sources, including my music video collection and DVD backups.

I'm going to test this on Linux, same machine (I multi-boot) as well as another computer to see if the problem is specifically with my computer.

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: OGM videos made easy - buffer issue in game playback though...
« Reply #4 on: June 08, 2009, 10:21:25 pm »
I'm still doing more testing, but I've also found that a new version of Xvid came out, with a new xvidcore.dll file, from 1.2.1 to 1.2.2.  I checked Xvid's site, the API is the same, but it internally has many performance and security enhancements.

By placing the new xvidcore.dll in the game directory I saw an improvement right there with the stuttering issue, although it didn't make it go away completely.

I also found that going to the sound options menu and switching to 22050 KHz frequency (from 44100) made the stuttering go away totally on some OGM videos, but only most of the way on others.

I looked at the code - I noticed a "DEFINE" for Ogm buffer size in one place, and also from looking up SDL Mixer the docs talked about "Chucksize" which, if too small, can cause this issue.

I'm wondering if there could be a troubleshooting option in the game options menu for optionally increasing the buffer and chunksize for audio if there is a problem playing video.

I'm also hoping some other people can test videos on their computers to verify how many computers and what environments this problem occurs on, so far I haven't seen anyone else test video playback yet.  (FYI to anyone who wants to test:  There's an "Intro.ogm" video file already in the SVN version you can start with if you don't want to try to convert some random video.)

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: OGM videos made easy - buffer issue in game playback though...
« Reply #5 on: June 08, 2009, 10:59:42 pm »
Aha!  I think I've got it - If I first convert videos to MP4 format, and then OGM, instead of any format directly to OGM, it usually comes out OK without stuttering.

odie

  • Guest
Re: OGM videos made easy - buffer issue in game playback though...
« Reply #6 on: July 21, 2009, 05:58:06 pm »
Aha!  I think I've got it - If I first convert videos to MP4 format, and then OGM, instead of any format directly to OGM, it usually comes out OK without stuttering.

Destructavator,

I realised that in the NSIS scripts, it does not seemed to compile the OGM OGG files? Or was it that its being packed into one of the archives? I did a search in the installed version on my home lappy, and realised no ogg to test..... :P

Offline Destructavator

  • Combination Multiple Specialty Developer
  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1908
  • Creater of Scorchcrafter, knows the zarakites...
    • View Profile
Re: OGM videos made easy - buffer issue in game playback though...
« Reply #7 on: July 21, 2009, 07:39:36 pm »
Sorry, I'm a bit confused about what you're asking here - When you say "compile the OGM OGG files" do you mean the NSIS script packing the "0vids.pk3" into the binary installer?  Or are you talking about something with creating the OGM video clips themselves not working?

odie

  • Guest
Re: OGM videos made easy - buffer issue in game playback though...
« Reply #8 on: July 22, 2009, 05:26:59 am »
Sorry, I'm a bit confused about what you're asking here - When you say "compile the OGM OGG files" do you mean the NSIS script packing the "0vids.pk3" into the binary installer?  Or are you talking about something with creating the OGM video clips themselves not working?

Ah, pardon my lingo and the confusion.

I meant to say that the NSIS script (which packs the windows installer) did not contain ogg files.
Then i realised they do, in the form on pk3 files. (Hehe, which is 0vids.pk3 as pointed out to u).

Then i realised silly me that pk3 files are the 7za (7zip)'s archives of the various needed files, including 0vids.pk3 which should contain the ogg files! OMG. Big blunder on my side.

I must have been doing this too late into the wee hrs! Lol.

Anyway, i have extracted tat since on my good computer here @ work (not my home's lappy) and using VLC Media Player, it ran well. :D

I did notice a strange behaviour -> This video is onli 3 mins plus but at the end (notice the screenshot, how the current bar is almost done playing), it says 3 min plus / 9:52! Is it the player's issue or the ogg format's compatibility's issue?

And on the quality again, it does not stutters nor jerk, resolution ran at 200% looks good. I try again at home later. :D