amichaeltm / BDSup2SubPlusPlus

Port of the original BDSup2Sub to C++ and Qt.
Apache License 2.0
30 stars 6 forks source link

BD/SUP -> BD/SUP creates broken subtitles #23

Open an3k opened 3 years ago

an3k commented 3 years ago

I tried it with many different sources and the result is always the same. In MPC-HC the subtitles aren't shown at all and in Plex the subtitles are in the top left corner (even thought they should centered be at the bottom.

BDSup2Sub 5.1.2 and BDSup2Sub 5.2.0 do not have that problem.

I took a subtitle (directly from the Blu-ray) as a source, "moved all captions" including cropping to 2.40:1 and exported as sup(BD) using BDSup2Sub 5.2.0 and BDSup2Sub++ 1.0.3. After creation I opened both resulting subtitles in BDSup2Sub 5.2.0 and compared them.

BDSup2Sub 5.2.0: screen size: 1920x800 image size: 947x149 pos: (486,639) - (1433,788)

BDSup2Sub++ 1.0.3: screen size: 1920x800 image size: 948x150 pos: (486,778) - (1434,928)

The move all captions settings I used where: keep X position Offset X 10 move inside bounds Offset Y 12 Aspect Ratio 2.40 Crop Offset Y 140

I also used the command line and it created the same broken result. "bdsup2sub++1.0.3_Win64.exe" --resolution keep --filter lanczos3 --palette-mode create --move-in-ratio 2.40 --move-y-offset 12 --crop-y 140 --output "D:\test_exported.sup" "D:\test.sup"

Looks like it's first moving the subtitle (12 pixels from the inside of 1920x1080) and then cropping (to 1920x800).

an3k commented 3 years ago

Using command line I found out that cropping and moving at the same time is not working. To get a proper result you have to process the subtitle twice.

1) "bdsup2sub++1.0.3_Win64.exe" --resolution keep --filter lanczos3 --palette-mode create --crop-y 140 --output "D:\test_exported.sup" "D:\test.sup" 2) "bdsup2sub++1.0.3_Win64.exe" --resolution keep --filter lanczos3 --palette-mode create --move-y-origin up --move-y-offset 12 --output "D:\test_exported_again.sup" "D:\test_exported.sup"

I tried to run both combined (with the crop function as the first option) but it again moves the subtitle based on the uncropped frame and then crops afterwards. ("bdsup2sub++1.0.3_Win64.exe" --resolution keep --filter lanczos3 --palette-mode create --crop-y 140 --move-y-origin up --move-y-offset 12 --output "D:\test_exported.sup" "D:\test.sup")

an3k commented 3 years ago

This is working: including the amount of pixels to crop in the move-y-offset option.

"bdsup2sub++1.0.3_Win64.exe" --resolution keep --filter lanczos3 --palette-mode create --crop-y 140 --move-in-ratio 2.40 --move-y-offset 152 --output "D:\test_exported.sup" "D:\test.sup"

I tested with --move-y-origin up and --move-in-ratio 2.40 and both options do their job ... but based on the uncropped frame, so you either crop first and then process that intermediate subtitle again or you include the crop amount into the offset.

Interestingly --move-OUT-ratio 2.40 --move-y-offset 152 creates the same result as --move-IN-ratio 2.40 --move-y-offset 12