Hello. I just joined. I am a newbie to video editing.

I have a lot of videos recorded on mobile phone, in portrait orientation. The videos are H264 and I want to covert them to H265 to save space. I need help in setting the Dimensions tab in Handbrake.

This is what MPC-HC shows in the Properties box:

General:
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/mp42)
File size : 259 MiB
Duration : 5 min 6 s
Overall bit rate : 7 086 kb/s

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3.1
Format settings, CABAC : No
Format settings, RefFrames : 1 frame
Format settings, GOP : M=1, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 5 min 6 s
Source duration : 5 min 6 s
Bit rate : 6 991 kb/s
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Rotation : 90°
Frame rate mode : Variable
Frame rate : 30.000 FPS
Minimum frame rate : 10.834 FPS
Maximum frame rate : 59.563 FPS
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.253
Stream size : 255 MiB (99%)
Source stream size : 255 MiB (99%)
Title : VideoHandle
Language : English
Color range : Full
Color primaries : BT.601 NTSC
Transfer characteristics : BT.601
Matrix coefficients : BT.601
mdhd_Duration : 306055

If I add the video in Handbrake and click the H.265 MKV 720p30 present, Handbrake shows this in the Dimensions tab:

Source: 720x1280, PAR: 1/1
Width: 720 Height: 720
Anamorphic: Automatic
Modulus: 2

Output
Display Size: 405x720, PAR 9x16

What I want to do is keep the video the same as it is, only decrease the size. I have not been able to set the resolution at 720x1280, changing the value of one changes the other one. For example, while tinkering with the settings, this is one of the options:

Source: 720x1280, PAR: 1/1
Width: 720 Height: 720 Keep Aspect Ratio not selected
Anamorphic: Custom
Modulus: 2

Display Width: 1296
PAR: 9 x 5

Output
Display Size: 1296x720, PAR 9x5

Here's another:

Source: 720x1280, PAR: 1/1
Width: 720 Height: 720 Keep Aspect Ratio not selected
Anamorphic: Custom
Modulus: 2

Display Width: 720
PAR: 1 x 1

Output
Display Size: 720x720, PAR 1x1

I always keep the cropping as custom, with 0 for all sides. So what values should I use, so that the video appears exactly as source?

Thanks.