Forums > Jitter

retain aspect ration in fullscreen?

November 16, 2011 | 3:37 am

Hi.
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?…


November 16, 2011 | 4:05 am

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.


November 16, 2011 | 4:17 am

Hmm.
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?


November 16, 2011 | 4:46 am

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:

– Pasted Max Patch, click to expand. –

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.


November 16, 2011 | 4:55 am

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:

– Pasted Max Patch, click to expand. –

Thanks for your help.


November 16, 2011 | 6:50 am

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.


November 16, 2011 | 8:00 pm

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?


November 16, 2011 | 8:11 pm

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.


Viewing 8 posts - 1 through 8 (of 8 total)