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

fix: vlc expect 10 columns #90

Closed
wants to merge 2 commits into from
Closed

fix: vlc expect 10 columns #90

wants to merge 2 commits into from

Conversation

firodj
Copy link
Contributor

@firodj firodj commented Aug 5, 2023

Hi @asticode nice package. I've issue when writing to SSA/AAS file then loading it into VLC. The VLC could not render it. It seems VLC want Text field after 9th commas.

@asticode
Copy link
Owner

asticode commented Aug 7, 2023

How did you figure out this was the problem? it seems really weird to me 🤔 Could you send a sample file?

@firodj
Copy link
Contributor Author

firodj commented Aug 10, 2023

Sorry for late responds. I think you may try to reproduce it yourself, what I did: extract the subtitle (ssa/ass) from mkv file using ffmpeg -i <video.mkv> -an -vn -c:s copy <video.ass>. Then I opening the subtitle with go-astisub, change the text by translate it, then write the output.

The saved subtitle didn't show when playinng using VLC, both by separating the subtitle file with the movie or muxing them with ffmpeg. Then I tried another tools to mux using mkvtoolnix then the subtitle shown, but with preceding comma. I dont know exactly what happen but it seems related to number of columns.
The extracted subtitle has 10 columns but the written one by go-astisub has 9 columns.

I also found here: http://www.tcax.org/docs/ass-specs.htm, that on 5. Dialogue event lines, [Events] section,

Field 10:    Text
Subtitle Text. This is the actual text which will be displayed as a subtitle onscreen.
Everything after the 9th comma is treated as the subtitle text, so it can include commas.

@asticode
Copy link
Owner

Can you share the files:

  1. generated by go-astisub that fails in VLC?
  2. generated by mkvtoolnix that succeeds in VLC?

@firodj
Copy link
Contributor Author

firodj commented Aug 17, 2023

Here are these files:

  1. en.ass - original
  2. id.ass - the en.ass re-saved by go-astisub. (without any modifications)
  3. fr.ass - the id.ass muxed by mkvtoolnix.

Kimetsu no Yaiba - Katanakaji no Sato-hen - 06.zip

@asticode
Copy link
Owner

asticode commented Aug 18, 2023

OK thanks for sharing the test files 👍

What you've done is not sufficient to fix this problem properly. What you need to do is add Layer as the first field but you need to make sure there's a value actually written. Here's what you need to do:

  • First you need to remove your branch and create a brand new one since I had to force push on master and therefore there's a conflict with this PR
  • you can remove func (e ssaEvent) updateFormat()
  • here for Marked and all *int you need to make sure there's a default value (and v is not empty): astikit.IntPtr(0) for *int and Marked=0 for Marked
  • you can remove formatMap here
  • you can update format exactly like you did
  • you can simplify this for loop content to events = append(events, newSSAEventFromItem(*i))
  • finally you need to fix tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants