Skip to content

Commit

Permalink
✨ Embed subtitle tracks if provided by uploader
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelange committed Jan 19, 2023
1 parent 084fe27 commit 3d227f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Download music or video from e.g. YouTube, Soundcloud, Instagram, Facebook. For
- HDR video (MKV)
- Playlist mode (currently each playlist is download sequentially)
- Custom audio bitrate, video resolution, destination folder
- Embedded subtitle tracks
- Embedded metadata like chapter information and description

The audio streams in converted (video) files from `yt` will generally be of higher quality compared to [online alternatives](https://www.google.nl/search?q=youtube+to+mp3+online), while maintaining a comparable file size. This is achieved by preferring WAV/OPUS source streams, and by converting using the [Fraunhofer FDK AAC codec library](https://trac.ffmpeg.org/wiki/Encode/AAC#fdk_aac) at a bitrate of 256kbit/s (sufficient to encode a full 44.1kHz stream using `libfdk_aac` without losing detail at higher frequencies).
[![yt vs online](https://user-images.githubusercontent.com/14880945/62381156-246feb80-b54b-11e9-8445-3890c091d0c3.gif)](https://github.com/alexkay/spek)
Expand Down
5 changes: 1 addition & 4 deletions yt/yt
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ All rights reserved."
# TODO
# Support playlists in parallel https://github.com/ytdl-org/youtube-dl/issues/3746#issuecomment-446694257

# TODO
# Support CC / subs (ffmpeg install using --with-srt)
# --write-auto-sub --sub-lang "en,nl,de" --sub-format "srt/best" --embed-subs --convert-subs "srt"

if [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
set -- "-h"
fi
Expand Down Expand Up @@ -297,6 +293,7 @@ All rights reserved."
else
local DOWNLOAD_OPTIONS=(--merge-output-format mkv -f "(${default_video_selector})+(${audio_selector})/${fallback_video_selector}")
fi
DOWNLOAD_OPTIONS+=(--all-subs --sub-format "srt/best")
else
local DOWNLOAD_OPTIONS=(--embed-thumbnail --audio-format m4a --audio-quality ${AUDIO_BITRATE}k --postprocessor-args "-ar ${AUDIO_SAMPLING_RATE}" -x -f "${audio_selector}/best")
if $KEEP_AUDIO; then
Expand Down

0 comments on commit 3d227f3

Please sign in to comment.