Maxstupo / ydl-ui

A UI for the command-line video downloader "youtube-dl"
MIT License
347 stars 34 forks source link

Option to merge video & subtitles into one mkv? #84

Closed smithmarci closed 3 years ago

smithmarci commented 3 years ago

Hi Maxstupo!

Would it make sense and/or would be possible to add an option for merging the downloaded video and the subtitle file(s) into one '.mkv' (or into any other container with the same capabilities (by drop-down selection, maybe))? And, without re-encoding the video, of course.

I am uninitiated in things like this. Although, the following problem/solution seems to fit the suggestion in question: https://superuser.com/questions/958680/ffmpeg-mp4-and-multiple-srt-into-mkv

As I understand, the subtitles would need to be converted to '.srt' format first, but - according to several forum sources - 'youtube-dl' does not seem to handle the conversion properly. However, and if I am not mistaken, for that purpose 'ffmpeg' again should do the trick. I could imagine this mode of operation to leave the standalone '.vtt' files as well, for safekeeping.

Do you think that such function could be useful? Or it is beyond the aim of the software?

Maxstupo commented 3 years ago

Ideally I would like YDL-UI to only interact with youtube-dl. However, youtube-dl does have the --embed-subs flag.

Embed subtitles in the video (only for mp4, webm and mkv videos)

From a quick test it seems like vtt subs will get embedded into mkv.

smithmarci commented 3 years ago

That's great news! If this result can be achieved with one component - plus, that component is 'youtube-dl' -, then all the better. Thank you for taking the time and looking into that!

smithmarci commented 3 years ago

However, youtube-dl does have the --embed-subs flag.

Are you planning tho add this flag via check-box option (in the 'General' / 'File system' section, perhaps)? Or the new 'Custom arguments' option on the 'Preview' tab is there exactly for this kind of individually preferred parameters?

Will this new option & tooltip localizable (?) later?

Maxstupo commented 3 years ago

@smithmarci I was planning to use a check-box option. The Custom Arguments option is for flags that haven't been implemented as a control yet, or for edge cases when you need flags like --no-check-certificate

When added the option & tooltip should be localizable.