I am recoding the live stream; many of them will adjust resolution because of PK.

For example, the resolution is 720x1280 when solo; after starting PK, the resolution becomes 900x720; after PK ends and go back to solo, the resolution becomes 720x1280 again.

These recorded video files are too big, and they are all h264, so I am trying to re-encode them to AV1 to reduce file size.

But after re-encoding, the resolution are fixed and won't be adjusted correctly like before.

Image
[Attachment 84260 - Click to enlarge]

For example, the original file is on the left side, and the re-encoded file is on the right side.

This video starts at 900x720, PK ends and back to solo at 00:00:06, resolution changes to 720x1280.

ffplay plays the original video file, everything seems good.

ffplay plays the re-encoded video file, after 00:00:06, the resolution still keeps 900x720 and causes graphics to stretch and cut off.

Here's the command I used:
Code:
ffmpeg -i original.flv -y -c:v libsvtav1 re-encode.mp4
I tried to re-encode using the same codec, h264, but the same problem still
Code:
ffmpeg -i original.flv -y -c:v libx264 re-encode.mp4
Have no idea how to fix this

Here's video file: https://www.mediafire.com/file/0vaxtzurwhom8bn/ReEncode_Resolution.zip/file