Audio and Subtitles
Two things are often worth more than the video itself: its sound, and its words. yt-dlp extracts both. Items the lab could not run are labelled documented only where they appear.
Just the sound
yt-dlp -x --audio-format mp3 \
--audio-quality 0 -f 240p <URL>
-x says "extract the audio": the video
downloads, ffmpeg writes the sound out as
an MP3 (--audio-quality 0 is the
encoder's best setting), and the video
file is deleted afterwards — add -k to
keep it. The lab ran exactly this against
chapter 4's film (transcript t09):
[download] Destination: audio2/Big Buck Bunny.mp4
[ExtractAudio] Destination: audio2/Big Buck Bunny.mp3
Deleting original file audio2/Big Buck Bunny.mp4 (pass -k to keep)
Check, with ffprobe: a 17,702,452-byte
MP3, 9 minutes 56 seconds — the film's
full length — stereo at 48 kHz. Note the
choice of the small 240p format: for
audio work the picture is ballast, but
pick a format whose audio is good; on
sites with separate audio formats (chapter
5's second shape) -f ba takes the best
sound directly and skips the conversion.
The failure worth learning from is transcript t08. Pointed at a 10-second archive.org clip, the same operation ended:
ERROR: Postprocessing: WARNING: unable to obtain file audio codec with ffprobe
The clip is silent — ffprobe shows a lone video stream and no audio at all. There was nothing to extract, and no setting fixes that. When extraction fails, probe the source first: the honest answer is sometimes "this file has no sound".
Subtitles
yt-dlp --list-subs <URL>
yt-dlp --write-subs --sub-langs en \
--skip-download <URL>
The lab's TED talk lists subtitles in
dozens of languages, every one offered
as WebVTT (transcript t06). The second
command saved the English track on its
own — --skip-download because the words
were all that was wanted:
[info] Writing video subtitles to: subs/Do schools kill creativity?.en.vtt
Check: a 33,594-byte .vtt file whose
first real cue reads "Good morning. How
are you?" — the talk's actual opening
line. Subtitle files land beside the
video (or instead of it, as here), named
title, language, extension.
Just as instructive are the runs where
the answer was none: --list-subs on
two Blender films and on a media.ccc.de
conference talk each ended "… has no
subtitles" (transcript t07). That is a
fact about the material, not an error —
much published video simply has no
subtitle tracks.
Documented only in this guide:
--write-auto-subsfetches a site's automatically generated captions where a site offers them; quality varies with the generator, and the lab's material offered none to test.--embed-subswrites the subtitles into the video file itself, and--convert-subs srtconverts between subtitle formats; both are ffmpeg postprocessing of the kind verified above, but the lab did not run them.