-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue about using BDSup2Sub #5
Comments
I'm aware that BDSup2Sub has limitations, it's just the only option I found at the time that could be easily exported/imported as images. |
If my idea about modifying the palette make sense i can make a dll for you, but from what i can see from your code you are more that capable of doing that by yourself, but if you need help with the sup file structure i've just uploaded a kaitai descriptor in my repo. |
I had looked at other existing projects that dealt with subs and never really understood how this color change would be done. I just need to look more into this. |
Hi, last day i've implemented this functionality inside my application, you can see the commit here MonoS/SupMover@079f738 |
Assuming the matrix is fixed, you could always round trip to RGB, set color and convert back to YCbCr. |
hey quietvoid, I'm having lots of issues with BDSup2Sup (primarily because I'm on Mac), have you seen this rust solution for exporting images: |
I'm not sure if the actual issue is the images exporting or also the re-importing into a SUP file. |
hey quietvoid... the issue was me. I kept receiving the error "BDSup2Sub should be in the same directory as this executable." on the release build. Turns out I was putting the .jar in the wrong spot, and also using the wrong jar (I was using a Mac BDSup2Sup; but actually using the windows BDSup2Sup.jar is what worked. FWIW, here's how I solved my issue: I built a release of subtitle_tonemap and installed it to my path using cargo. I edited // Make sure jar file exists in the same directory
let mut java_jar = env::current_exe()?;
java_jar.pop();
java_jar.push("BDSup2Sub512.jar");
println!("Searching for java jar at {:?}", java_jar);
if !java_jar.exists() {
let current_dir: PathBuf = env::current_dir()?;
println!("Java jar file does not exist in {:?}", current_dir);
return Ok(());
} Realized I needed to add the BDSup2Sup512.jar to Got a few imagex errors using the Mac .jar, swapped it with a windows .jar and poof, everything worked. So for Mac users, this may be helpful. And in general printing the path something is searching is helpful for newb users when using external dependencies. Apologies for being vague above with my Mac bdsup2sup issues and it appears everything works fine now. Thank you for making this! |
Easy fix...use the new beta version of BDSup2Sub and export the subtitle as it will have no warnings or issues. Open the new exported SUP in the old version and you will see there are no more warnings. Now you can tone map the subtitle without issues. |
Hi quietvoid, i want to inform you that in the past i had quite some problem using BDSup2Sub resulting in cropped output, wrong colors/shade and missing subpic, that is one of the reason why i developed SupMover.
I was also thinking about if it could be a good idea to change the luminance/color value at a palette level instead at the image level so that the functionality of your tool would be a less lossy transformation, from what i can read from your code (i'm not experienced in rust) it seems you lower the color of all the RGB channel by the specified percentage, or with a fixed color, and save it, am i right?
Just for information PGS/Sup subtitle use a YCbCrA palette (from SubtitleEdit's code it seems that the matrix is determined from the video) in tv level (16-235/240) so do you think we could achieve the same effect multiplying the value from the Y channel in every paletted color with a percentage and then clamping to 16-235 range? Do you think we should take into account the Alpha value?
The text was updated successfully, but these errors were encountered: