Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Theora questions  (Read 7305 times)

0 Members and 1 Guest are viewing this topic.

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Theora questions
« on: September 24, 2006, 08:15:06 AM »

After doing the prerequisite searches, I still have a few questions. It appears that theora using the VLC player conversion is pretty bad. So that isn't an option. Using ffmpeg2theora results in a beautiful, clean looking file that blends perfectly where it matches but its resized wrong and doesn't exactly match up everywhere with the backgrounds. So am I stuck then? Using this theora video from ffmpeg2theora reduces file size immensly over sprites and it actually looks better with what I am using. If I couldnt use it because of a silly bug in the conversion process I would be quite disappointed...

Also the video entity appears on top of the actor no matter where it is located in the scene editor.
Logged

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Theora questions
« Reply #1 on: September 24, 2006, 08:59:04 AM »

Upon closer examination it doesnt appear to be resized. It appers that a black strip is being added almost at the very bottom of the video. This video does not appear this way if you watch it on its own. It appears to match up with the regular video just fine, and everything around it matches it up when put into the scene. It appers to only do this in WME. I have a screen grab of this if you would want to see Mneumonic. Also still having the problem with the video appearing on top of everything.
Logged

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Theora questions
« Reply #2 on: September 24, 2006, 10:17:55 AM »

One more update. The video is size 464x608 while the scene is 1280x1024. Not sure if that helps.
Logged

Finn

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • View Profile
Re: Theora questions
« Reply #3 on: September 24, 2006, 01:46:06 PM »

This may not be ideal but it is one way around your resize problem with ffmpeg2theora (which can only resize to output dimensions that are multiples of 8 even if you specify other dimensions). Try using an AlphaImage mask of the entity PlayTheora method to remove the unwanted extra borders due to the resizing limitation of ffmpeg2theora.

Open your favourite art package and create your alpha mask to the same 'oversized' dimension of your video (i.e. with it's unwanted black border). Use black for the video area you want to keep and leaving whatever area you want removed as the transparent alpha channel (possibly the very bottom and/or very right pixels). Save your image as a png and then specify it as the AlphaImage in your video entity's PlayTheora method.

Yeah, you might have a few extra pixels that are never seen but it shouldn't be a huge overhead (less that 8 pixels in width and height).

Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Theora questions
« Reply #4 on: September 24, 2006, 05:48:19 PM »

WME is using the frame size reported by Theora. I'm not sure how can this happen, other than the video reporting other dimensions than it actually contains. Nevertheless, the trick suggested by Finn should work fine.
As for the z-order within scene, the videos work exactly like normal entities, that is, their Y position on screen determines the order in which they are drawn. Also their base point must be within some scene region (see this thread).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Theora questions
« Reply #5 on: September 24, 2006, 06:55:40 PM »

Thanks for the tips guys. Unfortunately the alpha mask is not applying at all. Not sure why at the moment. I should have thought of that myself too.  ;) But anyway it's still got the black bars. Plus my video resolution is a multiple of 8 as Finn said.

I still can't get the item to draw behind the floor. It was my understanding that the drawing order for entities is based on the order in which they appear in the scene list? I thought the Y position was only for free entities. Does the video need to be a free entity?
Logged

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Theora questions
« Reply #6 on: September 24, 2006, 07:06:01 PM »

If I move the video entity behind the background of the entire scene, listed as the first thing in the list, it still draws on top of everything.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Theora questions
« Reply #7 on: September 24, 2006, 07:56:22 PM »

That's strange. I suppose you are using Entity.PlayTheora(), not Game.PlayTheora(), right?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Theora questions
« Reply #8 on: September 24, 2006, 08:02:12 PM »

Yeah. This is the code for it.

var video = Scene.CreateEntity();
video.X = 403;
video.Y = 184;
video.PlayTheora("somepath\waterfallcolor2.ogg",true, "somepath\waterfallmask.png");

I used that somepath to avoid spoilers. ;-)

The alpha mask doesn't work nor the draw order as I stated before. This code is in a script attached to a region entity. I've tried sprite entities as well.
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: Theora questions
« Reply #9 on: September 24, 2006, 10:38:12 PM »

but you have created this entity dynamically, so it has no z order predefined.

Either create the entity in Scene Edit and modify your code to read:

var video = Scene.GetNode("your scene edit entity name goes here");
video.X = 403;
video.Y = 184;
video.PlayTheora("somepath\waterfallcolor2.ogg",true, "somepath\waterfallmask.png");

or use StickToRegion().
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Theora questions
« Reply #10 on: September 24, 2006, 10:51:22 PM »

but you have created this entity dynamically, so it has no z order predefined.

Either create the entity in Scene Edit and modify your code to read:

var video = Scene.GetNode("your scene edit entity name goes here");
video.X = 403;
video.Y = 184;
video.PlayTheora("somepath\waterfallcolor2.ogg",true, "somepath\waterfallmask.png");

or use StickToRegion().

I had just figured this out before you posted actually. I figured I must be creating a new entity and throwing it on top of the entire scene. I just changed it to this.X this.Y etc...and it worked. But thanks for your help!  :)

Except for the alpha thing which still doesn't work.
« Last Edit: September 24, 2006, 11:06:16 PM by DocBass »
Logged

Finn

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 11
    • View Profile
Re: Theora questions
« Reply #11 on: September 24, 2006, 11:36:45 PM »

What colour depth have you saved the AlphaImage in? Try increasing it and see if that works any better (e.g. 32 bit depth). The AlphaImage definitely does work.

Yes, it's a wee bit odd that you're still getting borders with multiples of 8. I guess ffmpeg2theora is a bit finicky. I think it's a matter of playing around until you get something that works. It shouldn't really matter that much about the exact size because the good thing about using the mask is that you don't have to stick to the multiple of 8 for the video size - the mask can edit out the unwanted extra pixels.
Logged

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Theora questions
« Reply #12 on: September 25, 2006, 04:07:56 AM »

I was using a PNG-24. I'll try a different format. Been working on so much stuff that if I get stuck I usually move on until someone can help with the answer.  ;D
Logged

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Theora questions
« Reply #13 on: September 25, 2006, 06:06:51 AM »

Thank you gents, a 32 bit TGA file did the trick. All is well and everything is looking fantastic. Thanks all!
Logged
 

Page created in 0.12 seconds with 24 queries.