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

I get a lot of "\h\h\h" when using closed captions subtitles (formatting error) #833

Closed
edge261 opened this issue Jan 15, 2025 · 24 comments
Closed
Labels
bug Something isn't working

Comments

@edge261
Copy link

edge261 commented Jan 15, 2025

Describe the bug
According to ChatGPT, it happens often on subtitles with ASS format, and tries to prevent line breaks.

To Reproduce
Steps to reproduce the behavior:

  1. Put a stream with closed captions.

Expected behavior
Clean and nice subtitles without those letters.

Screenshots
image
image
image

@edge261 edge261 added the bug Something isn't working label Jan 15, 2025
@kingslay
Copy link
Owner

可以提供url给我吗?我测试下

@edge261
Copy link
Author

edge261 commented Jan 15, 2025

可以提供url给我吗?我测试下

Hey @kingslay , I just emailed you with a couple of links.

@kingslay
Copy link
Owner

改好了。半个小时之后,你可以用最新的testflight包试下。你遇到的cc字幕有时没有出现的问题,是因为走了异步硬解导致的,你需要把asynchronousDecompression 设置为false才可以。

@edge261
Copy link
Author

edge261 commented Jan 15, 2025

Thanks @kingslay !

Now it looks perfect, however, the subtitles appears and disappears way too quickly, making them impossible to read and follow.

Also, would be possible to make them follow my own configuration instead of their own regarding appearance?

@kingslay
Copy link
Owner

  1. 你可以试下iina。看下是不是也会有这个字幕消失的很快的问题。
  2. 字幕设置那边有一个开关 Strip Subtitle Style 。你把他设置为true。就可以用自己的样式了

@edge261
Copy link
Author

edge261 commented Jan 18, 2025

I don't know what IINA means, sorry haha.

However, deactivating the option "Is ASS using image render" solved the problem about disappearing too quickly. It would be good to check that option for the people who prefer to use it.

I found another problem. Subtitles do not clear when the stream stops giving subtitles (usually on commercials), and it waits until the next line appears to change... it should clear when no subtitles are given.

Also, in TracyPlayer, even with the Strip Subtitle Style enabled, changing the positioning parameter does not work. Only italics, bold and text size (this option requires you to close and open the app again). It should also have the option to have a background (with opacity options).

I had an idea, and it was to read in some way the options that I already configured in the OS globally and apply them to the video. (or maybe using the Apple engine for subtitles... less trouble maintaining this option)

@kingslay
Copy link
Owner

  1. iina是一个在macOS上的mpv播放器。就是想看下mpv会不会也有这个问题
  2. 这个我改好了。你过半个小时用最新的testfligh包试下
  3. 这个是因为字幕只有开始时间没有结束时间,所以需要等待下个字幕出现了。才能消失。
  4. 字体大小需要重启的问题,我改好了。目前是有位置和背景色可以配置的,但是不能打开开关“Is ASS using image render”,并且要打开“Strip Subtitle Style ”

@edge261
Copy link
Author

edge261 commented Jan 18, 2025

Just tested the new build. The options to change the color of the font and background are in the iOS version, but not in the tvOS version. And I need to configure that in tvOS.

I still don't manage to increase the margin in the bottom... in the tv the subtitles appear too low.

Neither the align X/Y option or changing the margin vertical value appears to do nothing :(

@kingslay
Copy link
Owner

  1. 因为tvos不支持ColorPicker。所以tvOS上没有配置
  2. 间距无法调整的问题,我刚修复了。需要开启“Strip Subtitle Style ” ass字幕才能生效。因为ass字幕一般都自定义间距大小。

@edge261
Copy link
Author

edge261 commented Jan 19, 2025

I understand that tvOS does not support ColorPicker. However, I think it could be done from a series of hardcoded colors (and in the case of the background opacity, hardcoded percentages), just like the native options of tvOS regarding subtitles... just a list of colors and percentages.

Regarding positioning, nothing changed, sadly... (neither iOS or tvOS)

image

image

It's supposed to appear in the middle of the screen... (I changed that just to test the options) although what I really wish is to increase the bottom margin/padding.

@kingslay
Copy link
Owner

要增加底部间距的话,不能用center。你需要把它设置为bottom。然后把垂直间距设置大一点看下效果, 例如 50 。

@edge261
Copy link
Author

edge261 commented Jan 19, 2025

要增加底部间距的话,不能用center。你需要把它设置为bottom。然后把垂直间距设置大一点看下效果, 例如 50 。

Thank you! It worked.

I hope you could consider adding the options about font color and background in tvOS using the ideas I mentioned.

One last doubt... It is possible to change the font from arial to the default one on tvOS (SF Pro Text Regular) to keep consistency across the OS?

@kingslay
Copy link
Owner

默认系统字体 和tvos支持选颜色 都支持了。你可以试下

@edge261
Copy link
Author

edge261 commented Jan 19, 2025

Amazing. Thank you very much!

Could you add pure yellow to the color selection? Currently the closest color there is orange.

Also, for some reason it does not show the system font (tvOS) but something like times new Roman 😅

image

@kingslay
Copy link
Owner

  1. 我增加了yellow了。
  2. closed captions 字幕一般会是ass字幕。里面一般是会指定要用那个字体。我是对srt字幕支持了系统默认字体。你是想要ass字幕用图片渲染的时候也要改成是用系统默认字体吗?

@edge261
Copy link
Author

edge261 commented Jan 26, 2025

No, because I think the option "rendering with pictures" is an option to get closed captions like a traditional TV.

I'd just like to get that font when the option "strip subtitle style" is enabled, so in that case, even the closed captions looks the same as SRT (and of course, emulating tvOS subtitle style)

@kingslay
Copy link
Owner

kingslay commented Jan 27, 2025

你是把 ”Is ASS Use Image Render“ 这个开关打开了吗?如果把这个开关关了。那字幕就会用文字的方式进行渲染。这样的话,在 "strip subtitle style" 打开的情况下,就会使用系统默认字体。

@edge261
Copy link
Author

edge261 commented Jan 27, 2025

你是把 ”Is ASS Use Image Render“ 这个开关打开了吗?如果把这个开关关了。那字幕就会用文字的方式进行渲染。这样的话,在 "strip subtitle style" 也关闭的情况下,就会使用系统默认字体。

Yeah, with both options deactivated I get the system font. But then I lose all other customizations... it is not possible to add the system font to work when "strip subtitle style" is enabled? That's the only thing it would need to make this perfect.

@kingslay
Copy link
Owner

我说错了。应该是要在”Is ASS Use Image Render“ 关闭、 “strip subtitle style” 打开的情况才会显示系统默认字体吧。

@edge261
Copy link
Author

edge261 commented Jan 27, 2025

我说错了。应该是要在”Is ASS Use Image Render“ 关闭、 “strip subtitle style” 打开的情况才会显示系统默认字体吧。

Got it. But is not showing the system font, instead it's showing another one... can you check on that? It should be SF Pro Text but not sure how to reference it correctly on the code.

@kingslay
Copy link
Owner

  1. 你的系统使用的是什么语言呢?是英语吗?
  2. 现在字幕显示的字体跟我的app上面其他的文字显示的字体,你认为是一样的吗?

@edge261
Copy link
Author

edge261 commented Jan 30, 2025

  • 你的系统使用的是什么语言呢?是英语吗?
  • 现在字幕显示的字体跟我的app上面其他的文字显示的字体,你认为是一样的吗?
  1. Yes, english.
  2. No, at least on ASS subtitles (unable to check SRT subs) it looks like the image posted before.

image

@kingslay
Copy link
Owner

kingslay commented Feb 2, 2025

改好了 麻烦你在试下最新的test flight包

@edge261
Copy link
Author

edge261 commented Feb 2, 2025

改好了 麻烦你在试下最新的test flight包

Perfect. Now it uses the system font. Thank you very much.

For tvOS, the tone of yellow can be #FEFD55 instead of the current one? That's the tone that tvOS uses. And since tvOS doesn't let me personalize the color beyond the pre-selected colors, I ask you to add/change it.

As a suggestion, the Apple font (and the vertical spacing in 60) should be added as default inside the KS engine... so people can benefit from a streamlined appearance between your engine and tvOS.

I'll close this as solved. Again, thank you very much for this.

@edge261 edge261 closed this as completed Feb 2, 2025
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

No branches or pull requests

2 participants