mirror of
https://codeberg.org/postscriptum/gemlog.git
synced 2026-02-18 22:12:40 +00:00
add example to download video with multiple audio streams
This commit is contained in:
parent
439086b93f
commit
e456e391b7
1 changed files with 36 additions and 0 deletions
|
|
@ -18,6 +18,42 @@ yt-dlp CHANNEL_URL|PLAYLIST_URL|VIDEO_URL -S res:1080
|
||||||
yt-dlp CHANNEL_URL/playlists -o '%(uploader)s/%(playlist)s/%(title)s.%(ext)s'
|
yt-dlp CHANNEL_URL/playlists -o '%(uploader)s/%(playlist)s/%(title)s.%(ext)s'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Download video with multiple audio streams
|
||||||
|
|
||||||
|
* tested on yt-dlp v2025.12.08
|
||||||
|
|
||||||
|
### Download best video, best audio (original + uk) and subs
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
yt-dlp -f "bv+ba+ba[language=uk]" \
|
||||||
|
--audio-multistreams \
|
||||||
|
--embed-metadata \
|
||||||
|
--embed-subs \
|
||||||
|
--all-subs \
|
||||||
|
--merge-output-format mkv \
|
||||||
|
URL
|
||||||
|
```
|
||||||
|
* it's important to provide the `--embed-metadata` flag to prevent all audio options from being marked as 'English'
|
||||||
|
* the `--merge-output-format mkv` argument is recommended, as the MKV container provides the necessary features for built-in audio and subtitle options
|
||||||
|
|
||||||
|
### Fix audio stream names using post-processing
|
||||||
|
|
||||||
|
If the `--embed-metadata` argument is missing, you can fix the names for audio options after by using ffmpeg:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
ffmpeg -i input.mkv \
|
||||||
|
-map 0 -metadata:s:a:0 language=en -metadata:s:a:1 language=uk \
|
||||||
|
-c copy output.mkv
|
||||||
|
```
|
||||||
|
* it's important to keep the previous `-f` order
|
||||||
|
|
||||||
|
or just inline:
|
||||||
|
|
||||||
|
``` bash
|
||||||
|
yt-dlp ... \
|
||||||
|
--exec "ffmpeg -i {} -map 0 -metadata:s:a:0 language=en -metadata:s:a:1 language=uk -c copy output.mkv" URL
|
||||||
|
```
|
||||||
|
|
||||||
## Extract audio
|
## Extract audio
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue