Jump to content

Theora Video seems zoomed in


PaulWeston

Recommended Posts

Hi all,


Been using TheoraTextureObject to put videos on objects, works great...


However, and this is true for theora video GUI controls in my menus as well, it seems as if it kind of zooms into the video somewhat. Like the video is larger than the object it is supposed to be mapping to. This results in clipping of a lot of the frame.


The videos were originally AVI, converted to OGV using Miro Video Converter. There were not many options to choose in terms of the end result, but they play fine as OGV files in VLC Player.


I have not seen anything in Torque about how one could scale the video or the resolution, are there perhaps specific sizes/resolutions/aspect ratios that this control needs the videos to be converted to in order to display properly?


Thanks!

Link to comment
Share on other sites

Did some more testing with this...


If I set the matchvideosize to 1, then it correctly sets the extent of the video control to be the dimensions of the OGV file, but the video itself seems to be bigger.


It's as if the texture size on the object is set to a value smaller than the video, so you only see the center part of the video on the object and not the whole thing.


For example, if I make the video 320 by 240 the window will size to that correctly but will only show roughly 250 by 200. If I make the video 1024 by 768 the window will take up the whole screen which is fine, except the video again only seems to display about 800 by 600 of the video. I always lose the sides and top.


Rather than having to make videos with a hard coded black border of a couple hundred pixels, is there perhaps some way to play with the texture sizing so the whole video will show up?


Thanks

P

Link to comment
Share on other sites

  • 7 months later...

Bumping this thread...


Anyone else have success mapping Theora videos onto objects?


As noted above, everything works mechanically, however the video is not scaling properly to the object.


For example, when using a movie screen (rectangular shape), and trying to stick a video on it, the object only shows a cropped portion of the video. Even if I make the source video wide screen format, it still seems to want to texture on as a square, which doesn't fit the movie screen shape, and we lose the top and bottom of the video as well as a bit on the sides.


Is there some secret I don't know about, that lets me force the video to scale exactly to the size of the object we stick it to?


Thanks

Link to comment
Share on other sites

I'm just using the straight theora video on texture, using materials:


singleton TheoraTextureObject(WebStarTrek1_Movie)

{

texTargetName = "MyWebStarTrek1TextureName";

theoraFile = "scripts/web/video/startrek1.ogv";

};


singleton Material(WebStarTrek1_WebStarTrek1)

{

mapTo = "WebStarTrek1";

diffuseMap[0] = "#MyWebStarTrek1TextureName";

emissive[0] = "1";

};


I have a .dae object that has the material WebStarTrek1, the TheoraTextureObject calls the video file.


The settings you gave:


matchVideoSize = "0";

position = "0 0";

horizSizing = "width";

vertSizing = "height";


... would be for the Theora Gui controls, no? Can I use them in the TheoraTextureObject as well?


Thanks

Link to comment
Share on other sites

... would be for the Theora Gui controls, no?

 

Sorry, I didn't paid enough attention to notice you place it on objects as material.

Yes, it's for GUI's


UV wrap is in place?


Perhaps a guiDynamicTexture would be a solution, but don't know if that's working or not :|

Link to comment
Share on other sites

So, nobody out there is using the Theora on Object stuff?


It's a neat feature, used to be a resource way back when until it was added to stock T3D. So, I figured it should just work, the tutorial video I watched shows the video properly proportioned on the object.


What do you mean by UV wrap in place? Something specific that needs to be done to the DAE model? I thought all that was needed was any basic shape. I just used Blender to make a simple cube with one named material. Didn't know of any specific steps to making an object that will properly display Theora video, there is nothing about that in the tutorials.


I have tried many methods of converting video as well - original video is MP4, convert to MPEG2, then to AVI, then to OGV. Along the way I processed it into standard 320 X 240 size. So, it's not like it's a 16 X 9 aspect ratio widescreen video or anything, it's basic 320 X 240, so why does it no just fill the shape properly?

Link to comment
Share on other sites

So, nobody out there is using the Theora on Object stuff?

 

Theora had some issues in the past; and I recently needed to fix the looping as well. Therefore, I was cautious to use it in DeadlyMatter. There's always the image sequence function, which I think is a bit more safe to use imo (but displaying a movie could be too much for that method, I'll agree)

 

What do you mean by UV wrap in place? Something specific that needs to be done to the DAE model?

 

While working in max solely I'm not that all familiar with Blender. In a lot of cases it's good to UV unwrap your model, especially when having issues of the maps not properly positioned. However, I don't know if that's the case with your model; you'll have to try it out to know I guess.

Link to comment
Share on other sites

  • 2 weeks later...

OK, I'm not crazy!


:)


So, why only on some quality pref settings, and why does the only sample video I can find of it in use show it working fine on a cube object?


Anyhow, glad somebody else is finally seeing what I was. Because we triple-checked the model and even started over with a fresh clean plane object and still get the same issue.


Experimented with every possible resolution and aspect ratio when coverting the videos too - 4:3, 16:9, standard 320X240 up to VCD settings, nothing works.


Can't understand why nobody would have caught this when adding this support to the engine - did nobody test it or something?

Link to comment
Share on other sites

Peeked at the engine code. Can't say I understand how most of the back end works, but I figured out a temporary solution.

In gfx/video/theoratexture.cpp at line 60

GFX_ImplementTextureProfile(  GFXTheoraTextureProfile,
                             GFXTextureProfile::DiffuseMap,
                             GFXTextureProfile::NoMipmap | GFXTextureProfile::Dynamic,
                             GFXTextureProfile::NONE );

Change that to this

GFX_ImplementTextureProfile(  GFXTheoraTextureProfile,
                             GFXTextureProfile::DiffuseMap,
						  GFXTextureProfile::NoMipmap | GFXTextureProfile::Dynamic | GFXTextureProfile::PreserveSize,
                             GFXTextureProfile::NONE );

and texture scaling will be disabled.

Link to comment
Share on other sites

@PaulWeston As far as I can tell. Something to note - it seems the default behavior of zooming in the texture on low settings was intended. I don't know if it behaved that way to fix a problem, or if that problem is still here. It could also just be a quirk of some old code no one really uses or pays attention to, so it might not be a big deal. The change works fine for me in any case.

Link to comment
Share on other sites

That may be why it has not been noticed - most people run better computers than I do I guess, I'm only using a dual-core and it doesn't like anything other than everything set to Low for the video options.


Anyhow, am eager to try this out tonight when I get home from work, thanks again!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...