Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Pages: 1 2 [All]

Author Topic: Ogg Theora - Or, how to convert them and have them play correctly.  (Read 21366 times)

0 Members and 1 Guest are viewing this topic.

CMK2901

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 35
  • Zoidberg is afoot!
    • View Profile
    • CMK Studios

Wintermute supports the use of Ogg Theora video files, which are very well compressed without losing much quality.  The problem I had was that none of the methods outlined anywhere I could find for converting an AVI/MOV file to Ogg Theora was actually working on a level I'd call "professional" - very frustrating.

The problem seemed to be this (as far as I could tell): though many utilities could convert AVI to Theora, they were often buggy and had strict requirements for successful transfers, and the most stable utility I've found - "ffmpeg2theora" - requires that the AVI use specific codecs for sound and video for the conversion to be successful.  Unfortunately, AVI seems to act only as a container for multiple combinations of Audio/Video codecs, making it difficult to get a video that uses the right stuff for conversion.

So, I've taken it upon myself to make this small guide ::).  This is the method I use to get Theora files into the engine that are small (a 2-min video file is 3MB-8MB, depending on resolution) and that work, as a big plus, with optional subtitles. 

Tools you'll need:

Rad Video Tools
Virtual Dub
ffmpeg2theora
SubtitlesK5ky (Subtitle Software)

And at least 10GB of free hard drive space (some temporary space for LARGE uncompressed video files).

What you need to do:

1) Open RadVideo.exe and select the source file in the browser.  Click the button "Convert a File".

2) Make sure to check both "Convert Video" and "Convert Audio".  Set the output file to "AVI File" and click "Convert".

3) When a Video Compression dialog pops up, choose "Full Frames (Uncompressed)" and hit OK.  Note that this new file will be VERY LARGE, probably in the 2-5Gb range or higher.

4) Run VirtualDub.exe and open the Uncompressed AVI file.  Here, you can use the "Video->Filters..." menu to fix up the video if needs be (resizing, contrast, grayscale, etc).  VirtualDub's resizing utility is particularly nice because it doesn't limit resolutions to DVD and movie resolutions like a lot of editing software does.

4b) If you plan on using subtitles, it is vital that you know how many frames per second the video file is, or the subtitles will show up at the wrong time.  Use "Video->Frame Rate..." to find the current frame rate or to change the frame rate (25 is easy to remember, but I IMAGINE changing it could cause the audio and video to unsync in some situations...though I have no proof of this, change at own risk).  If nothing else, write down the current frame rate to use later.

5) Be sure that the "Video->Compression..." has the "Uncompressed RGB" option selected and use "Save as AVI..." from the file menu to save it.  You can't overwrite your other file because virtual dub is still using it :P.  Depending on what you did to the file, the new file may be even larger.

(This is why you need so much hard drive space.  ;D)

6) "ffmpeg2theora.exe" is a drag-and-drop utility, so drag you're Uncompressed, Resized AVI file onto the icon and wait for it to convert.  It will automatically save a .OGG file in the same directory as the original.  The .OGG file will be very small by comparison; for a test run, I used a 100MB file...it is now 300kb with no noticeable visual or audio loss.  Nice!

(NOTE: .OGG files do not save the FPS (frames per second) in the property dialog...this can be important to know, so it might be a good idea to put the FPS in the comments section of the property dialog for future use.)

(At this point, the video file is ready to be used in the engine using the PlayTheora command.  However, the subtitle stuff is pretty cool, and will make your game that much more professional.)

7) Run "SubtitlesK5ky.exe" - this program is pretty bizarre, but it works - and use "Player->Open File..." to select the ogg file.  You'll need to switch to "All Files" to see the ogg file, but as long as you have the ogg codec installed, it will work.  When it asks for the number of frames per second, USE THE RIGHT NUMBER.  If you don't, the subtitles will display at the wrong time when you run it.

8) Basically, the "Compendium" window shows the entire sequence.  When you play the movie, there is a box at the bottom of the main window marked "Actual Frame:" - this shows the frame the video is on at any given point.  You put the "Actual Frame" values into the "From" and "To" text boxes.  For example, if a person in the movie starts saying "Hello" at frame 34 and ends at frame 45, you'd put 34 and 45 in the "From" and "To" boxes respectively, and then "Hello" into the subtitle box.  There are a lot of buttons, but the ones that you'll use a lot are the ones with two rectangles in them in the main window; these insert a new subtitle.  After you've inserted a few of subtitles, you can play back the movie and the subtitle will light up when it will show up during the movie, so you can be sure it works.

(NOTE: You can also do SUB files with a simple text editor.  To do the above in a text editor, you'd insert "{34}{45}Hello")
(NOTE: It's also a good idea to fill the frames you don't have anything displaying with a space, so that you know nothing will show when it's not supposed to)

An example .SUB file is as simple as:
{1}{1} 25                        <--The program author suggests that FPS is first line of the SUB for reference.
{2}{35}
{36}{50} Who's there?
{51}{80}
{81}{96} Hmm...must have been nothing.

9) When you're done, use "File->Save" and save it as a .SUB file in the same directory as the video.  The program will give you a message that basically says "You can't save until you register, unless you really have to." (WTF?) and then you can save. 


And you are done!  Play the ogg file in game, watch the subtitles show up on cue (unless you have them turned off) and pat yourself on the back.  Since the subtitles are a separate file and not part of the movie, they can be turned off and also translated into different languages for localization.  Sure, you might get away with just using ffmpeg2theora on everything, but chances are you'll get garbage, it won't be the right size, the audio won't work, or everything will be out of sync.  This method ensures that the converted file IS the original taking up less space. 

NOTE: And remember to delete those Uncompressed AVI files after the conversion, or you will be using a good 10GB for every file.  Not good.

I hope this was helpful, and have fun!
« Last Edit: September 24, 2007, 10:49:02 PM by CMK2901 »
Logged
CMK Studios
I don't think we're hearing the same voices.

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #1 on: July 05, 2007, 11:28:00 PM »

wow !!! thats a superb explanation and pretty usefull too !!
thanks for sharing your knowledge with us !

if i get to the point to deal with movies this will be really very helpful ..

again thanks for sharing !!

you  O0 ::rock O0

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #2 on: July 06, 2007, 08:01:16 AM »

Excellent, thanks a lot for sharing!
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

plobone

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 17
    • View Profile
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #3 on: August 07, 2008, 05:18:11 PM »

Hi I trying to convert an AVI video to OGG theora ......I Have tryed all the things that you say but whet I get to step 6 here is the problem the ffmpeg2theora program it does not convert my AVI video to OGG but in OGV what is OGV in the text below I didnt see any OGV convert file only OGG...

Thanks!
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #4 on: August 07, 2008, 06:06:03 PM »

what version do you use? I get normal ogg's from ffmpeg2theora
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #5 on: August 07, 2008, 06:42:22 PM »

OGV (Ogg video) & OGA (Ogg audio) are the new official extensions by xiph foundation for their ogg container. They did this so you can seperate audio/video (theora with vorbis etc) files from audio only (vorbis, flac, speex) files. It just a different name and nothing else. Just rename your file to .ogg and it will work just fine.

As a sidenote I have already suggested to Mnemonic that it would be good if wme could recognize the new official extensions. Not a big deal but just nice.

EDIT: You can find all the info (and the other various extensions) here.
Logged
fl*p

Baron

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 37
    • View Profile
    • Portfolio
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #6 on: December 08, 2008, 06:29:28 AM »

I'm having a little trouble myself with playing video.
I used the converter and renamed the file ending from .ogv to ogg the file plays alright in the player.
When I use Game.PlayTheora in the game I just get a black screen.
has anyone else had the same problem?

-Edit-

I was just missing the file location in the command

Game.PlayTheora("SacredIntro.ogg");

Game.PlayTheora("scenes\Entrance\SacredIntro.ogg");

I added is and its playing fine.  ::rock
« Last Edit: December 08, 2008, 07:58:03 AM by Baron »
Logged

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #7 on: April 02, 2009, 01:50:30 PM »

thank you for the information seems to play the .ogv extension file perfectly well.
Logged

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #8 on: September 13, 2010, 12:33:56 PM »

very tk for the guide.. :-*
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #9 on: September 14, 2010, 02:59:17 PM »

i have a question but why use blink or virtual dub? for convert not need only drag the .avi in ffmpeg2theora.exe
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #10 on: September 14, 2010, 03:47:20 PM »

Please note the post date of the original post.
Logged
fl*p

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #11 on: September 14, 2010, 03:58:49 PM »

Please note the post date of the original post.

y i have seen the oringal post^^

if y can reply good if no y can ignore the post
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #12 on: September 14, 2010, 04:19:46 PM »

Original post is seriously very old and the available information isn't needed anymore afaik. ffmpeg2theora should be able to decode all ffmpeg does and that is almost everything.

I also suggest reading wme forum rules.
Logged
fl*p

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #13 on: September 14, 2010, 04:31:01 PM »

i have read the rules but y the post is very old but the "plugin" theora is not update and anyway the post is very usefull ..

for sharing thing:

the format .oga (audio) dont work  i had to download a free program  (name audioacity) and then convert. wav   in .ogg and later worked perfectly.

 Instead, video files. OGV files work perfectly.

 I did not want to be polemicl but since the plugin is the latest release seemed useful to have more info and clarification. that's all:)

and sorry for my bad english
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #14 on: September 14, 2010, 04:36:20 PM »

Please check this post available above. Just rename .oga to .ogg and it should work. Converting using audacity will reencode the file and seriously degrade quality. Never ever do reencoding of lossy audio files.
Logged
fl*p

keybone

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 112
    • View Profile
    • Lucine
Re: Ogg Theora - Or, how to convert them and have them play correctly.
« Reply #15 on: September 14, 2010, 11:14:47 PM »

i have try to rename and dont work...the file ,oga creates with the tool ffmpeg2theora.exe dont work...

Quote
Converting using audacity will reencode the file and seriously degrade quality

I am not a good  of sound and music,  but I do not feel bad  .. if not I use the wav file but some soundtracks also weigh 10 mega instead converted then 2 mega ...

 I tried using the files. oga and are not even opening them with other programs
Logged
Lucine Company http://www.lucine.it/
Tales of Lucine: The Realm of Hobdark http://www.lucine.it/TalesOfLucine
Pages: 1 2 [All]
 

Page created in 0.021 seconds with 20 queries.