PaulWeston Posted May 27, 2015 Share Posted May 27, 2015 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! Quote Link to comment Share on other sites More sharing options...
PaulWeston Posted May 31, 2015 Author Share Posted May 31, 2015 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?ThanksP Quote Link to comment Share on other sites More sharing options...
PaulWeston Posted January 7, 2016 Author Share Posted January 7, 2016 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 Quote Link to comment Share on other sites More sharing options...
marauder2k9 Posted January 10, 2016 Share Posted January 10, 2016 can u post a screenshot Quote Link to comment Share on other sites More sharing options...
PaulWeston Posted January 10, 2016 Author Share Posted January 10, 2016 Sure... Taking this video clip:http://indelta.com/files/uploads/st-uncropped.jpgAnd putting it onto a Theora video object, will result in this:http://indelta.com/files/uploads/st-cropped.jpg Quote Link to comment Share on other sites More sharing options...
Nils Posted January 12, 2016 Share Posted January 12, 2016 Hey Paul, perhaps you should post the script (GUI)try this if it's different then yours:matchVideoSize = "0"; position = "0 0"; horizSizing = "width"; vertSizing = "height"; Quote Link to comment Share on other sites More sharing options...
Nils Posted January 12, 2016 Share Posted January 12, 2016 You could also try ffmpeg2theora, getting good results with this converter (lots of parameters) Quote Link to comment Share on other sites More sharing options...
PaulWeston Posted January 13, 2016 Author Share Posted January 13, 2016 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 Quote Link to comment Share on other sites More sharing options...
Nils Posted January 13, 2016 Share Posted January 13, 2016 ... 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'sUV wrap is in place?Perhaps a guiDynamicTexture would be a solution, but don't know if that's working or not :| Quote Link to comment Share on other sites More sharing options...
PaulWeston Posted January 13, 2016 Author Share Posted January 13, 2016 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? Quote Link to comment Share on other sites More sharing options...
Nils Posted January 14, 2016 Share Posted January 14, 2016 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. Quote Link to comment Share on other sites More sharing options...
newaged Posted January 16, 2016 Share Posted January 16, 2016 This is probably a model issue like the others said. I tested TheoraTextureObject on a properly mapped plane and it worked fairly well. Quote Link to comment Share on other sites More sharing options...
newaged Posted January 27, 2016 Share Posted January 27, 2016 Turns out it might not be a model issue after all. After changing some quality prefs, my theora test object was zoomed in as well. Could be an engine problem that requires some dirty work to fully fix. Quote Link to comment Share on other sites More sharing options...
PaulWeston Posted January 27, 2016 Author Share Posted January 27, 2016 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? Quote Link to comment Share on other sites More sharing options...
newaged Posted January 27, 2016 Share Posted January 27, 2016 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. Quote Link to comment Share on other sites More sharing options...
PaulWeston Posted January 27, 2016 Author Share Posted January 27, 2016 OMG wow, you're a saint... that's awesome :)So, with this fix and a recompile, any size video I make will correctly pop on to the object and fit? Quote Link to comment Share on other sites More sharing options...
newaged Posted January 27, 2016 Share Posted January 27, 2016 @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. Quote Link to comment Share on other sites More sharing options...
PaulWeston Posted January 27, 2016 Author Share Posted January 27, 2016 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! Quote Link to comment Share on other sites More sharing options...
Nils Posted January 28, 2016 Share Posted January 28, 2016 That makes sense! Nice this one is getting fixed :-)Good luck with your project @PaulWeston Quote Link to comment Share on other sites More sharing options...
PaulWeston Posted February 2, 2016 Author Share Posted February 2, 2016 Thanks again, this trick works great! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.