Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Manually add subtitles to download videos #111

Merged
merged 4 commits into from
Jan 13, 2023

Conversation

bytedream
Copy link
Member

Until now, Crunchyroll always provided videos with subtitles burnt-in. But it seems that they starting to shutdown this kind of videos, at least for some languages. Italian for example has no hardsubbed videos for some series (#81 (comment)). To prevent such errors as in #81, this PR removes the logic to download the pre hardsubbed videos and burns in the subtitles itself via ffmpeg.

This includes some major changes:

  • ffmpeg is now required for download too. Adding subtitles to a video cannot be done without it.
  • The default file extension will change from .ts to .mp4. Mp4 is one of the few container formats which supports subtitles to be added as a separate stream which can be turned on and off (and not directly be burnt into the video as it's the only choice for most other formats). This has the advantage over .ts that the whole video doesn't need to be re-encoded which takes some time, especially with higher quality videos. All other formats will burn the subtitles into the video which consumes much time and cpu. It's now highly recommended to use mp4 as format for download. The subtitles in a mp4 file will have the ffmpeg forced flag/disposition which should show them in the most video players automatically but you might activate them manually in players which does not recognize this flag.
  • Piping to stdout (with the -o - flag) ([Request] Add option to pipe download to stdout #69) isn't so fast anymore. In the past when the actual video download started, the piping process started immediately. But now this isn't possible anymore b/c ffmpeg requires the output file to be seekable in order to add subtitles (at least for mp4, which is the format which will be piped). To have this guaranteed when piping, download will create a temporary file which gets piped to stdout if the video content was fully written to it. This makes piping less powerful than before.

@bytedream bytedream linked an issue Jan 13, 2023 that may be closed by this pull request
@bytedream bytedream force-pushed the fix/download-no-hardsub-videos branch from 8e627f5 to 3d145b0 Compare January 13, 2023 19:25
@bytedream bytedream merged commit b5bc36c into master Jan 13, 2023
@bytedream bytedream deleted the fix/download-no-hardsub-videos branch January 13, 2023 23:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No matching stream found also if available
1 participant