Author Topic: Video Conversion to OGG  (Read 2416 times)

0 Members and 1 Guest are viewing this topic.

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Anims: 420, Cutscenes: 10, Mainhalls: 7, Logos: 52
    • Steam
    • Twitter
    • Mix-Hai Productions
Video Conversion to OGG
I've gotten several questions on how to convert videos for ingame cutscene use and I had a heck of time trying to figure it out myself. I'm posting this so that I can be added to the stickied 'Modding Tutorials' thread.

For this you will need ffmpeg2theora

I render out final version of any video in AVI with DivX compression because ffmpeg2theora doesn't handle large filesizes very well. To give you an idea of the compression, EndGame at 1080p with DivX is 369 MB. Another thing to keep in mind is that the frame size needs to be divisible by 16. So 1920x1088, 1280x720, and 848x480 are the actual resolutions I use, and I crop rather than stretch. The final AVI must have a resolution divisible by 16. I tried taking a 1920x1080 avi and adding the 8 pixels during the OGG conversion and it didn't work. I work at 1080p, so my final AVI before all the OGG fun is 1920x1088 with DivX compression.

Now, I do some organizational stuff for my own sanity because I finish with 480, 720 and 1080 OGGs all ready for ingame use.

I create a file structure like this.

I drop the AVIs into the folder called AVI. Also, copy the ffmpeg2theora application into that folder. Run Command Prompt and navigate to the AVI folder. (Yup, you gotta remember those old DOS commands). 'cd\' to take you back to the root drive, then type the drive letter you need (in my case 'E:'), then 'cd\FOLDER\FOLDER\AVI'.

Now type the name of the ffmpeg2theora application which should be something like 'ffmpeg2theora 0.27'. (I got rid of the version and renamed it to 'ffmpeg2theora' for ease of use). Next are some settings for quality and compression. I'll go over the basics.

ffmpeg2theora without any settings will convert the source file to OGG using whatever framerate and framesize that are present in the source file. In many cases, this is just fine. I'm all about quality and have already compressed the file with DIVX so I don't want to use too much more compression. So I use these settings. '-v XX' where XX is a quality variable with 1 being the lowest and 10 being the highest. '-V XXXX' (confusing right?) sets the bitrate. '-X XXX' sets the frame x size and '-Y XXX' sets the frame y size. Other commands can be found here.

Here are my settings for each resolution. You can choose whichever is relevant to your project. I highly recommend having your video in all three versions. 480p for those low-end computers. 720p for general use, and 1080p for the future (when FSO can handle it), or for showing it off.

1080p 'ffmpeg2theora -v 10 -V 13000 FILENAME.EXT' (no frame size is necessary because my source is always 1920x1088)
720p 'ffmpeg2theora -v 10 -V 13000 -x 1280 -y 720 FILENAME.EXT'
480p 'ffmpeg2theora -v 10 -V 13000 -x 848 -y 480 FILENAME.EXT'

When you have your command line written, then hit 'Enter' and it should spit out a file in the AVI folder with the same root name as the source. So Ancients1.avi becomes Ancients1.ogv. My next step is to move the FILE.OGV to a new folder because I compress each source 3 times (for the different resolutions) and ffmpeg2theora will just overwrite files without asking.

Once you have all your OGVs ready, there is another step. Let me explain. '.ogv' is the Theora codec extension. FSO needs '.ogg' which is simply a container format like '.mov' or '.avi'. This is the easiest part though. Simply rename your file from 'FILENAME.OGV' to 'FILENAME.OGG'. Windows will give you some warning about changing the extension, but you can ignore it.

NOTE: you may need to change your folder settings to see file extensions. You can do this by pressing 'Alt' in a folder window, selecting tools from the menu and then folder options. In the dialogue navigate to 'View' and deselect 'Hide extensions for known file types'.

From there just drop the file into data/movies. If it is supposed to be an intro video (IE: Played when the player starts FSO) then it MUST be named intro.ogg.

In the end I have 4 versions of each video: The source AVI and an OGG for 1080p, 720p and 480p. You do not need to use my file structure, I just like it.

That should do it.
Cutscene Upgrade Project - Mainhall Remakes - MixaelANITools - Between the Ashes - MjnMixael's Render Boutique - Mix-Hai Productions
Youtube Channel - P3D Model Box - Photobucket Albums - Model Releases - Downloads
Between the Ashes is looking for committed testers, PM me for details.
Report MediaVP issues, now on the MediaVP Mantis! Read all about it Here!


Offline BlackDove

  • Star Killer
  • 211
  • Section 3 of the GTVI
Re: Video Conversion to OGG
Yeah, thanks for this :)


Offline Kusanagi

  • A man, a van, a plan, Vanama!
  • 27
  • Enemy vessel captured
Re: Video Conversion to OGG
Excellent! Thanks for this!
Cum historia
mutat valde Razgriz
revelat ipsum
primum daemon scelestus est.