Appium2 recording stretched and not rotaded

Before updating to latest appium and xcuitest driver, recordings were not stretched / rotated when opening apps (see before update video). After updating recordings are stretch out / don’t rotate as soon as the app starts (see appium2 recording video).

Both have identical code with the following options:

args = dict(
            forceRestart=True,
            timeLimit=60 * 30,
            videoType='libx265',
            videoScale="320:-2",
            pixelFormat="yuv420p",
            videoFps=4
        )

Logs before update: https://gist.github.com/Mr-Ples/ac6f4b7f10f54d25cc6abdd3b25adc79
Logs after update: https://gist.github.com/Mr-Ples/abddca6d89269fb0a65beca73897f0b8

Before update:

2022-10-05 06:43:09:319 [XCUITestDriver@c1d2 (1133b664)] Starting screen capture on the device 'bc0949990263122a45436ddc7e411df11a3792cb' with command: 'ffmpeg -f mjpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 1801 -i http://127.0.0.1:4832 -vf scale=320:-2 -pix_fmt yuv420p -vcodec libx265 -y /Users/gitlabrunner/Documents/temp/iPhone_02/202295-7212-1ereft1.y7w1/appium_f79b6e.mp4'. Will timeout in 1800000ms

After update:

2022-10-05 10:20:22:197 [XCUITestDriver@daf8 (cf506a51)] Starting screen capture on the device '2d7ed2ecd07a267c883226f7cc14bbf0f9688fc1' with command: 'ffmpeg -f mjpeg -reconnect 1 -reconnect_at_eof 1 -reconnect_streamed 1 -reconnect_delay_max 1801 -i http://127.0.0.1:4831 -vf scale=320:-2 -pix_fmt yuv420p -vcodec libx265 -y /Users/gitlabrunner/Documents/temp/iPhone_01/202295-32276-1plb5nu.mvcbi/appium_4ba1fa.mp4'. Will timeout in 1800000ms

Settings also seem to be the same before and after update.

So it seems like appium or the driver is no longer detecting the active app rotation as it did in the past or something?

applied workaround: https://github.com/appium/appium/issues/17562