Skip to content

Fix duplicate subtitles with different extensions - #37

Closed
asardaes wants to merge 1 commit into
klementng:mainfrom
asardaes:contrib
Closed

Fix duplicate subtitles with different extensions#37
asardaes wants to merge 1 commit into
klementng:mainfrom
asardaes:contrib

Conversation

@asardaes

Copy link
Copy Markdown
Contributor

Hi, I noticed some subtitle file duplicates after extraction, which happened because of the loop over the desired extensions:

  • If srt was desired, every supported subtitle stream was extracted and saved with that extension.
  • If ass was also desired, the same happened, overlapping with the subs extracted previously but now with a different extension.

I did a quick fix with a dict of extensions to supported codecs, but I only included the ones that still seem relevant, not sure what you think about that.

@klementng

Copy link
Copy Markdown
Owner

That's actually the intended behaviour. What I meant by 'desired' is the behaviour you are describing where all subtitles streams are extracted then saved/converted to the desired format. I intended it that way as I meant for this tool as an standardisation tool for subtitles (i.e. all in same srt format) regardless of the original format.

Perhaps what you're proposing or fixing could be a separate feature / flag where only targeted formats will extracted? I think it may be better implemented that way?

@asardaes

Copy link
Copy Markdown
Contributor Author

But it's not really doing conversion, is it? At least I don't do any post-processing, and just extracting an ASS subtitle stream and saving it with an .srt extension results in a file that is not correctly recognized in the media player, I think.

@klementng

klementng commented Jul 15, 2026

Copy link
Copy Markdown
Owner

There's conversation being done by ffmpeg during extraction process even without postprocessing. However, an possible issue I noticed in the past when converting ass to srt is that ffmpeg often leaves behind some positioning tags which I theorized is causing issues for some players in your case.

The postprocessing step for srt actually cleans it out and I personally never had any issues with player not recognizing the srt file afterwards.

The only issues with ass to srt is that some very complex ass files (i.e. multi-line texts) simply just can't be put in srt format without subtitles taking up the whole screen.

@asardaes

Copy link
Copy Markdown
Contributor Author

Got it, then I think the behavior I added would need more changes to be a separate feature. I'll close this PR because it won't fit as it is then.

@asardaes asardaes closed this Jul 15, 2026
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