retain aspect ration in fullscreen?
I searched, I promise. I totally thought there would already be an answer to this, but I could not find one.
I have 4 videos of essentially 3 different dimensions- widescreen HD, widescreen SD, and 4:3 SD.
I want to project these videos and have them all retain their respective aspect ratios and fill the screen as optimally as possible.
I can get the video onto the second display (projector) and full screen no problem. What I can’t do is prevent stretching. It will be an XGA projector, so ideally the widescreen videos would have black bars on top and bottom.
The best answer I found had to do with making the desktop black on the second display and setting a new jit.window size and position for every video. Seems like there should be an easier way?…
It’s not clear how you’re sending the videos to jit.window. Are you using jit.gl.videoplane? Sending them directly? The easiest way to retain the proper aspect ratio is with jit.gl.videoplane.
I’m just using jit.qt.movie.
I’m a beginner at this…
"Mapping video to a plane in 3d space" just sounds so extreme…
I’ve already set up the various size/position messages, but for future knowledge, I was still curious about "real" solutions to this problem.
Now my videos are stuttery, even though it’s not maxing CPU… Is it because they’re mp4’s encoded in H264?
It may sound extreme at the start, but it will be well worth your time to use the jit.gl object for video processing and display. It’s hardware accelerated and provides a lot more control. H264 requires a lot of computation to decompress. Ideally you could use a code like mjpeg which doesn’t have inter-frame compression. This can be a real bottleneck.
Here’s a basic video display patch with videoplane and a black background:
----------begin_max5_patcher---------- 590.3oc0VF0aaBCDG+Y3SwI+bFBvPBcOs84XpJx.WotCroFmlzU0u6CaHor1 DR5ZBqSQBTNN66+8SmOeO45PRkavFB7U3GfiyStNNVSFCN8+2gTw1jUxZrtQ xjUUnPSl08MMtQasuAXhb3QnIiUhvMREvZpwLMnXZtbq62HE5F9uPyRBB876 MKVUwEkn1FhfWLJWo2Zcqq0Lc1sbQwRU6l2I7nvf1cBBhSrulO27Jz2yGtte Q7bqFko28k.5PsHXUVsP9thyJIlO7rqq4wrOHORKYY+DRaeTnjqD4WTBDDEY S8jEcfveTBDddIf.W2tsuA.2w0dEkdOvyQYcISfPat.eqq9HviRoPvGGJg8V 6LoerF6HhI7KqXZEeCYFPH6.wdnGMbw.5E5ON87OuzqBaZXE3avmBYuqZlv8 hmfCgmwARD0KdFjXOHQi6fy9wwUSVsz8ZuJ4Cb7yUMSGclmLVIyhIiQq4hb4 ZyAsKHkRYhhixm1JHCQn1yRIzwvy7orcjBE4npqUDpXM3xLYY6kU91eA+qwV +gssWgMZYU7jvMMjBVPMAnoKNm.e5tvOdwX3IZRvy8UnVIAJ8B1q1hmiSkD6 L.yiGCJm4gezxhhxcUFmPIvAyQd6HTGOEi10H4vo3toapYp1DTipknfkVZij +fjztXRIW75Afsg2X+Oy7F4JU1V812WGdQB4XilKLC6JF3iYbgANcKOOGECm lKm2XDW9qU2r2sbZK3gfiHm3IUM9+WolESlZt5SkZnmfZhlL0DdBpg9WpF3Z 2mc+MvhF5QJ -----------end_max5_patcher-----------
There are a million ways to do things in Max. When you say things like your videos are stuttery, it’s really not possible for anyone to help you without seeing your patch because there are any number of ways to play and display a video. You can post a patch to the forum by selecting the objets in the patch and going to Edit > Copy Compressed. You can then paste this in the forum.
Yeah, I’m new to Jitter, but definitely not new to Max. I should certainly know better by now to be more specific!
I need to go to bed at this point, but I will say this:
I dropped an extra jit.pwindow into the patch so that I could monitor the frame rate. All of the videos are h264 mp4.
The 1280X720 video plays smoothly, averages above 30 fps 100% of the time.
The 640X480 video dips into the teens!
I used quicktime to convert the video to .mov, still h264. Now it plays smoothly, but has some sever flickering present in Jitter that’s not present when just playing in quicktime.
Obviously, you won’t be able to test playback without my specific videos, but here’s my patch:
----------begin_max5_patcher---------- 1125.3ocyYs0baxCD8Y6eEZ3YWOnKb6aluYR+WzYZ5zAajsoAjnfHIsc5+8p K3aIAvDaT3g.FIYxYO6tGsq7elOyYE+YZkC3+.eELa1elOaldH0.yZddlSd7 yqyhqzKy4GohkaJp1Vm5rvL8FNSTk9apZZHZoayvr57TVFUn+ZviCxqE6GE0 LZQrX8tT11uWRWKLfAFgkuI.A5ptEpuh8W5B9Vy2IMQCG9pe7IxdjXd0heUP MuDGmEx+N7UT.kEmqmz4ykowYNpI9674pKKF.AT7TJKg+jyswTC0lJFFczT8 ceaSE1mo9NLn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cccX+oGjHWfxwKnRqfody57sJlTMlCv845hrOl5amKTf8wTewSun9Mqfo dS6rbwYvImTfVetWWGz9Xp2MVBmfEwZ4BqwStvoKgkrbvzkTf4UfH4C+c9+v YZYwv -----------end_max5_patcher-----------
Thanks for your help.
jit.window uses OpenGL for displaying matrices by default, you you’re already benefiting from hardware acceleration. The jit.pwindow will cause a but of a performance hit because it has to downscale the input matrix to it’s dimensions on screen. One thing you can do to boost performance is use @colormode uyvy on both jit.qt.movie and jit.window. Otherwise, the only other thing you can do is convert your movies to a codec that doesn’t have interframe compression and uses less computation to decompress.
I don’t totally understand why the computation involved would be a problem when Jitter is only using about 25% or less of my cpu while running these videos (according to activity monitor), but I’m totally new to this and I’m sure there’s a lot I don’t understand.
In any case, I appreciate your help. I’ll try the color mode attribute and, failing that, will find a format that plays smoothly. Do you have a recommendation?
I won’t pester you anymore after this. :)
Edit: I forgot to mention that I’m on an 11" Macbook Air with a 1.6ghz i5.
The i5 shouldn’t have any trouble doing something like this, but maybe it’s the integrated graphics that are the culprit?
A lot of people have good luck with mjpeg codec at 75% quality. There have been a lot of posts about good codecs in the past. I haven’t checked to see if they show up on a search, but definitely give it a shot since there’s good info to be found.
Forums > Jitter