I am creating an application to display multiple videos at the same time (say, 2-10 videos). I am mainly looking for an algorithm that can help put the video on the screen. The problem I am facing is that each video may have a different aspect ratio, and I obviously need to resize the videos so that they all fit on the screen. But I want to resize and position them so that I make the most of the screen (and minimize aspect ratio distortion). In addition, I want the user to be able to increase the size of one or more videos so that he takes up more space on the screen. Thus, the algorithm must be stable, in the sense that increasing one video does not cause all placements to move.
I ask this question in an agnostic language, and the fact that I use video does not matter, this problem applies equally to still images.
Does anyone know about the placement algorithm?
An example is provided to help clarify here. I have three videos with the following sizes. I want the first video to occupy about 50% of the screen, and the last two videos to occupy about 25% of the screen.
(464, 336) 50%
(624, 480) 25%
(608, 336) 25%
How would I put them on the screen (1024x800) to achieve this? I decided that I would first split the screen in half and best place the first video in the upper half. Then I would split the bottom half into two and put both of the remaining videos as far as I could.
early
bramp source
share