Skip to content
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

ASS Sub BUG #506

Closed
Snipy2k4 opened this issue Nov 19, 2024 · 13 comments · Fixed by #509
Closed

ASS Sub BUG #506

Snipy2k4 opened this issue Nov 19, 2024 · 13 comments · Fixed by #509
Labels
bug Something isn't working

Comments

@Snipy2k4
Copy link

Snipy2k4 commented Nov 19, 2024

As I wrote above, the problem is solved by manually extracting the ASS subtitles and adding them without changing them with the MKVTool and recreating the file.

For a large collection, this would mean, in my case, several 10,000 files that would have to be edited manually although it was once fixed and worked. With the update to version 10 this was broken again.

To be honest, I have no desire to edit 10,000+ files manually as there is obviously another way.

If this is the wrong section, I would ask you to move this so that the error can be addressed. Thank you

Originally posted by @Snipy2k4 in #267

@Snipy2k4 Snipy2k4 added the bug Something isn't working label Nov 19, 2024
@cchristchurch
Copy link

Indeed I can confirm I see this issue too.

This seems to be a regression. The "random null character in the middle of the extracted subtitle file" problem was reported in multiple places more than a year ago (jellyfin issue, upstream issue), and then apparently fixed, but now re-ocurring.

I am currently running:

  • jellyfin: 10.10.3+deb12
  • jellyfin-ffmpeg7: 7.0.2-7-bookworm

I suspect this started happening again when upgrading to jellyfin 10.10x / jellyfin-ffmpeg7

@cchristchurch
Copy link

@nyanmisaka sorry to bother you directly here -- I noticed you looked into the original issue there and followed up with upstream, do you have any clue why this is suddenly re-ocurring on recent versions of jellyfin?

@gnattu
Copy link
Member

gnattu commented Nov 24, 2024

I think the upstream “optimized out” the fix in FFmpeg/FFmpeg@7bf1b9b

It is interesting that the author of the patch is also the maintainer of libass, the de-facto standard standard implementation of the ass spec.

Let me see if I can fix this, can you provide an mkv example that can reproduce this issue?

@cchristchurch
Copy link

Ufortunately I'm not quite sure how to create a small file to reproduce this. Many files in my library have the issue but cannot be uploaded here as they're several GBs.

I have tried to create smaller sample files using handbrake (my understanding from this is that the issue was first identified on files created with handbrake).

However it seems that my version of handbrake (1.6.1) no longer does that and once I re-encode something with it, ass subtitles can be extracted with ffmpeg without the null character in the middle.

@Snipy2k4
Copy link
Author

Snipy2k4 commented Nov 25, 2024

I don't know if this is specific to HandBrake versions or not, but I use version 1.8.2 (2024081000) for Windows. Unfortunately I don't see this NUL position in Notepad++ and I'm not so well versed in whether or how I can reproduce it correctly.

What I do know is that if I have a video file with this problem, an “annoying” workaround for me is to extract the subtitles with gMKVExtractGUI and insert them again with MKVToolNix, replacing the “old subtitles” and virtually recreating the file. Then it works as it should in Jellyfin. - But that can't be the solution, because :

As I said, I could also help myself, but if you have a large collection of 10,000 files and more like me, it's a lot of work and actually, as I said, this has already been fixed, but with version 10 of Jellyfin it has been reinserted or the former fix has been undone.

For copyright reasons I would not like to upload one of my backup copies.

@gnattu
Copy link
Member

gnattu commented Nov 26, 2024

I literally tried handbrake from the very first version supports ASS subtitle (0.9.6) all the way to 1.3.0, and I cannot reproduce this. It would be extremely hard for me to fix this if I cannot verify my theory if nobody is willing to help me. I just modified one of my sample MKV with hex edit to manually insert a null char after the header and it seems to work with my draft patch where this null char will no longer be carried over. I will make a PR soon and I beg you to test with the action builds to see if it fixed your files as well.

@Snipy2k4
Copy link
Author

Snipy2k4 commented Nov 26, 2024

Hello,

Doesn't the original problem and its fix help you to identify, reproduce and fix the problem? I mean, it has been successfully fixed before.

You could start there and see what has changed with the version updates.

Here is the original problem:

jellyfin/jellyfin#9344

The point here is not that nobody “WANTS” to help you, but that I don't want to illegally upload movies or series to the Internet. I hope you understand that. If I had a harmless file, I would make it available to you immediately.

@nyanmisaka
Copy link
Member

FF 6.0 (fixed with a custom patch)
FF 6.1 (fixed in upstream, confirmed by the original poster, we skipped this version)
FF 7.0 (upstream broke this again, and the link to the sample has expired)

https://fftrac-bg.ffmpeg.org/ticket/10203

A small test file that exhibits the problem may be found here:
​https://0x0.st/oFTT.mkv

Install the potential fix from https://github.com/jellyfin/jellyfin-ffmpeg/pull/509/checks and see if it works for you.

@nyanmisaka
Copy link
Member

@Snipy2k4 @cchristchurch @Andreas-76 @seeseemelk
Can anyone install and try out ffmpeg with the fix included to see if it solves the problem?

https://github.com/jellyfin/jellyfin-ffmpeg/pull/509/checks

@cchristchurch
Copy link

Sorry I got distracted away from all this and not at home for now, but I will be back and should be able to test this next weekend if no one had a chance yet.

@Andreas-76
Copy link

@nyanmisaka
I'm using docker image jellyfin/jellyfin so if you have put it in any of these
jellyfin/jellyfin:unstable
jellyfin/jellyfin:2024120205
then I can try
or notify when you put it in docker.

@rekom

This comment has been minimized.

@cchristchurch
Copy link

A bit late to the party, but I can confirm the bug is now fixed when using jellyfin-ffmpeg7 version 7.0.2-8-bookworm on debian.

When extracting ASS subtitles from the same problematic MKVs that caused the issue before, I no longer see the infamous null character in the extracted file, and things work as expected 🎉

Thanks a lot @gnattu @nyanmisaka for looking into this 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants