Output landscape video from devices in portrait

In my app, I have videos arranged in a grid system, so having the orientation of videos is important to the look of the app. Is someone uses a mobile device in portrait, it seems to switch between 640x480 and 480x640.
How do I output a landscape video regardless of the input orientation? What I’m thinking of is cropping the top and bottom of portrait video input to achieve a landscape video. Is this done by changing the input properties so that a landscape video is sent to the server, on the output properties or through some fancy CSS in the view that hides some of the video?
I’ve read Mobile recording is saved in cropped landscape mode. How to record portrait video? but this seems to apply to recording only, and they’re trying to avoid the cropping of video, opposite to me.

It is always better to do things with CSS. It gives you more freedom, different possibilities in differentclient endpoints, you can dynamically change the layout, and the “processing” power needed to do it is delegated to the client device, so it is “free” for you.

Thanks Pablo, if that’s the right method, then I’ll try that. If you have any examples or links on how to achieve this with CSS, that would be great. At the moment the height of the video divs are set by accommodating the videos in their fluid widths. There’s no explicit height set.
I’m sure I’ll figure it out, but if there are examples of responsive grids or known best practuce, it might save me some time.
Many thanks