mantas-done / subtitles

Subtitle/caption converter
https://gotranscript.com/subtitle-converter
MIT License
142 stars 48 forks source link

Vtt Cue settings are parsed as new lines #64

Closed vnali closed 1 year ago

vnali commented 1 year ago

For vtt subtitles, the Cue settings are added to the right of the cue timings like: 00:00:05.000 --> 00:00:10.000 line:63% position:72% align:start

The problem is when fileContentToInternalFormat of vttConverter parse $file_content via preg_match_all, it adds these settings as new lines.

Is it possible if fix for this issue does not remove this cue settings when generating internal format and keep it in internal format somehow? -maybe destination format is vtt again and we load subtitle only for adding new lines and we want new subtitle back as vtt again.

i totally understand that you have limited time as you mentioned here, -to be clear, i am not asking if this class should do something about cue setting saved in internal format, only let us as developer to process it later-

mantas-done commented 1 year ago

@vnali Hi, if you want, you can add a $internal_format['vtt_settings'] variable that would hold styles. No other class would use this variable except VttConverter when generating again VTT file. If you would make such changes, I would merge them. (I hope I understood the problem correctly)

vnali commented 1 year ago

Thanks @mantas-done I can see there are new commits and open PRs related to the vtt parsing. i will test it on the new tag and check how changes affect vtt parsing and see if i am able to make a PR.