How to change the resolution of a video without transcoding?

I have been trying to just change the resolution of a video and I don’t want to re-compress or transcode the video, is there any way in which I can simply change the resolution?

Changing the resolution of a video without transcoding is not possible because changing resolution involves a scaling operation in which source video frames are decoded first and their dimensions are changed according to your resolution requirements. Now newer video frames have less information content and pixel values are also changed so you have to encode it using a particular video encoder.

Any thoughts on how to preserve the video aspect ratio while scaling a video with new dimensions?

Same here, I have a video with a width of 800 and a height of 480 pixels. The video aspect ratio is 5:3. What should I set as the new width and height if, I want to convert it to 240p while keeping the same aspect ratio?

For your use case, you have to consider 240 pixels as your new height and calculate the new width with the following formula.
new_width = 5 / 3 * 240 = 400
So your new width and height will be 400 and 240 pixels accordingly.
Or you can look into the list of common resolutions.

Thanks