Skip to content

Instantly share code, notes, and snippets.

@MartinEesmaa
Forked from AgentOak/youtube_formats.md
Last active November 6, 2024 14:19
Show Gist options
  • Save MartinEesmaa/2f4b261cb90a47e9c41ba115a011a4aa to your computer and use it in GitHub Desktop.
Save MartinEesmaa/2f4b261cb90a47e9c41ba115a011a4aa to your computer and use it in GitHub Desktop.
Youtube Format IDs

Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.

See the credits and also special thanks in below.

Last updated: November 2024

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

Resolution AV1 HFR High AV1 HFR AV1 VP9.2 HDR HFR VP9 HFR VP9 H.264 HFR H.264 VP8
MP4 MP4 MP4 WebM WebM WebM MP4 MP4 WebM
4320p 702 402/571 272 138
2160p 701 401 337 315 (313) (305) (266)
1440p 700 400 336 308 (271) (304) (264)
1080p 699 399 335 303 248/616 299 137/216 170
720p 698 398 334 302/612 247 298 136 169
480p 697 397 333 244 135 168
360p 696 396 332 243 134 167
240p 695 395 331 242 133
144p 694 394 330 278/598 160/597
  • HFR stands for "High Framerate", which means up to 60 FPS, whereas non-HFR is limited to 30 FPS
  • Non-HFR 1080p+ H.264 and VP9 variants are not provided for HFR videos anymore
  • Same IDs are reused for 360° videos
  • 1440p+ H.264 variants are only provided for 360° videos anymore
  • At the moment, AV1 variants are only provided for popular videos
  • All AV1 variants can be HDR (no separate non-HDR AV1 variants are offered)
  • AV1 HFR High: High refers to the bitrate. These variants have ~3-4 times the bitrate of their normal counterparts. Additional side effect is providing AV1 HFR variants for low resolutions (<=480p). These variants are rare even among videos with AV1 variants. Found on this video.
  • AV1 HFR 4320p: Format 571 has roughly 50% higher bitrate than 402. Sometimes only one of them is offered, sometimes both. Can be seen on this video.
  • VP8 can be found this video.
  • At format 616, it is the only YouTube premium video format.

Duplicate video IDs

Those duplicate video IDs of m3u8 as Apple Native HLS are linked to common numbers, not a rare numbers.

270 (m3u8) == 137 (https) are same video quality, but different protocol.

Thanks, dtlnor for explanation of equalation video IDs.

602 mp4   256x144     12    │ ~  9.28MiB    87k m3u8  │ vp09.00.10.08    87k video only
269 mp4   256x144     24    │ ~ 18.55MiB   175k m3u8  │ avc1.4D400C     175k video only
603 mp4   256x144     24    │ ~ 16.62MiB   156k m3u8  │ vp09.00.11.08   156k video only
229 mp4   426x240     24    │ ~ 34.72MiB   327k m3u8  │ avc1.4D4015     327k video only
604 mp4   426x240     24    │ ~ 30.72MiB   289k m3u8  │ vp09.00.20.08   289k video only
230 mp4   640x360     24    │ ~ 86.22MiB   812k m3u8  │ avc1.4D401E     812k video only
605 mp4   640x360     24    │ ~ 60.27MiB   567k m3u8  │ vp09.00.21.08   567k video only
231 mp4   854x480     24    │ ~144.25MiB  1358k m3u8  │ avc1.4D401E    1358k video only
606 mp4   854x480     24    │ ~ 98.31MiB   926k m3u8  │ vp09.00.30.08   926k video only
232 mp4   1280x720    24    │ ~280.39MiB  2640k m3u8  │ avc1.4D401F    2640k video only
609 mp4   1280x720    24    │ ~181.03MiB  1705k m3u8  │ vp09.00.31.08  1705k video only
311 mp4   1280x720    60    │ ~  1.14GiB  4842k m3u8  │ avc1.4D4020    4842k video only
270 mp4   1920x1080   24    │ ~498.55MiB  4694k m3u8  │ avc1.640028    4694k video only
614 mp4   1920x1080   24    │ ~312.21MiB  2940k m3u8  │ vp09.00.40.08  2940k video only
617 mp4   1920x1080   60    │ ~  1.52GiB  6443k m3u8  │ vp09.00.41.08  6443k video only
312 mp4   1920x1080   60    │ ~  1.89GiB  7987k m3u8  │ avc1.64002A    7987k video only
620 mp4   2560x1440   24    │ ~928.71MiB  8745k m3u8  │ vp09.00.50.08  8745k video only
623 mp4   2560x1440   60    │ ~  3.85GiB 16287k m3u8  │ vp09.00.50.08 16287k video only
625 mp4   3840x2160   24    │ ~  1.94GiB 18661k m3u8  │ vp09.00.50.08 18661k video only
628 mp4   3840x2160   60    │ ~  8.27GiB 35007k m3u8  │ vp09.00.51.08 35007k video only

Examples of two videos:

30 fps video

60 fps video

DASH audio

Code Container Audio Codec Audio Bitrate Channels Still offered?
139 MP4 AAC (HE v1) 48 Kbps Stereo (2) Yes, YT Music
140 MP4 AAC (LC) 128 Kbps Stereo (2) Yes, YT Music
(141) MP4 AAC (LC) 256 Kbps Stereo (2) No, YT Music*
249 WebM Opus (VBR) ~50 Kbps Stereo (2) Yes
250 WebM Opus (VBR) ~70 Kbps Stereo (2) Yes
251 WebM Opus (VBR) <=160 Kbps Stereo (2) Yes
256 MP4 AAC (HE v1) 192 Kbps Surround (5.1) Rarely
258 MP4 AAC (LC) 384 Kbps Surround (5.1) Rarely
325 MP4 DTSE (DTS Express) 384 Kbps Surround (5.1) Rarely*
327 MP4 AAC (LC) 256 Kbps Surround (5.1) ?*
328 MP4 EAC3 384 Kbps Surround (5.1) Rarely
338 WebM Opus (VBR) ~480 Kbps (?) Quadraphonic (4) ?*
380 MP4 AC3 384 Kbps Surround (5.1) Rarely
599 MP4 AAC (HE v1) 30 Kbps Stereo (2) Yes
600 WebM Opus (VBR) ~35 Kbps Stereo (2) Yes
774 WebM Opus (VBR) ~256 Kbps Stereo (2) Some, YT Music*
  • Surround audio can be found on some demo videos
  • YT Music: These formats are offered on Youtube Music. Format 141 is only available to Premium users with High Quality option
  • Format 327, 338: These have been found on this Stereo 3D video
  • Format 325: You can find out one video link here
  • Format 774 at YT Music: Some music have available high quality of Opus up to 256 kbps to Premium users, music link here and also bypassing is no longer possible to download for non premium users unless you're subscribed to YouTube Premium and can download format available by extra arguments of cookies from browser or the authentication.

Legacy (non-DASH)

Code Container Video Codec Video Res. Audio Codec Audio Bitrate Channels Still offered?
5 FLV H.263 (Sorenson Spark) 240p (4:3) MP3 64 Kbps Mono (1) No
6 FLV H.263 (Sorenson Spark) 270p (4:3) MP3 64 Kbps Mono (1) No
13 3GP MPEG-4 (Simple, L0) 144p AAC (LC) Unknown Mono (1) No
17 3GP MPEG-4 (Simple, L0) 144p AAC (LC) 24 Kbps Mono (1) No*, old mobile phones
18 MP4 H.264 (Main, L3.0) 360p AAC (LC) 96 (most) / 128 Kbps (some) Stereo (2) Yes, GDrive
22 MP4 H.264 (High, L3.1) 720p AAC (LC) 128 Kbps Stereo (2) No*, GDrive
34 FLV H.264 (Main, L3.0) 360p AAC 128 Kbps Stereo (2) No
35 FLV H.264 (Main, L3.0) 480p AAC 128 Kbps Stereo (2) No
36 3GP MPEG-4 (Simple, L0) 144p AAC (LC) 24 Kbps Mono (1) Rarely, old mobile phones
(37) MP4 H.264 (High, L4.0) 1080p AAC (LC) 128 Kbps Stereo (2) No, GDrive
38 MP4 H.264 3072p AAC 192 Kbps Stereo (2) No
43 WebM VP8 360p Vorbis 128 Kbps Stereo (2) No
44 WebM VP8 480p Vorbis 128 Kbps Stereo (2) No
45 WebM VP8 720p Vorbis 192 Kbps Stereo (2) No
46 WebM VP8 1080p Vorbis 192 Kbps Stereo (2) No
(59) MP4 H.264 (Main, L3.1) 480p AAC (LC) 128 Kbps Stereo (2) No, GDrive
78 MP4 H.264 480p AAC 128 Kbps Stereo (2) No
  • Format 17: Allows for old mobile phones (eg. cell phones) to watch all videos. The video can have 7.5 & 12 fps only.
  • Format 18: Some videos are encoded with audio bitrate of 128 kbps for shorter lengths, most of them are with 96 kbps if most lengths or less views.
  • Always limited to 30 FPS
  • GDrive: These formats are offered for Google Drive video previews. Note that the video player on GDrive displays incorrect codecs on rightclick -> stats
  • Format 22: Available for most videos, except music and music videos (not limited to official music channels!)
  • Starting since May 2024, the Format 17 and Format 22 is removed for every YouTube videos uploaded.

Livestreams (non-DASH)

Code Container Video Codec Video Res. Audio Codec Audio Bitrate Still offered?
91 MPEG-TS (HLS) H.264 (Baseline, L1.1) 144p AAC (HE v1) 48 Kbps Yes
92 MPEG-TS (HLS) H.264 (Main, L2.1) 240p AAC (HE v1) 48 Kbps Yes
93 MPEG-TS (HLS) H.264 (Main, L3.0) 360p AAC (LC) 128 Kbps Yes
94 MPEG-TS (HLS) H.264 (Main, L3.1) 480p AAC (LC) 128 Kbps Yes
95 MPEG-TS (HLS) H.264 (Main, L3.1) 720p AAC (LC) 128 Kbps Yes
96 MPEG-TS (HLS) H.264 (High, L4.0) 1080p AAC (LC) 128 Kbps Yes
300 MPEG-TS (HLS) H.264 (Main, L3.2) HFR 720p AAC (LC) 128 Kbps Yes
301 MPEG-TS (HLS) H.264 (High, L4.2) HFR 1080p AAC (LC) 128 Kbps Yes
  • Non-HFR variants are limited to 30 FPS, HFR to 60 FPS
  • Non-HFR variants for 720p and 1080p may not be offered if HFR is available
  • Livestreams are also offered through DASH video (H.264, VP9) and DASH audio (AAC) streams
  • Both audio codecs of MPEG-TS are limited sample rate to 44.1 Khz for streaming a live broadcast.

Template youtube-dl formats

For archiving videos: Only choose combinations that fit WebM (VP9+Opus) or MP4 (H.264+AAC)

bestvideo[ext=webm]+251/bestvideo[ext=mp4]+(258/256/140)/bestvideo[ext=webm]+(250/249)/best

For archiving audio: Choose any format that's best

AAC Surround 384 / Opus 160 / AAC 192 / AAC Surround 192 / AAC 128 / Opus 70 / AAC 96 / Opus 50 / AAC 48

258/251/22/256/140/250/18/249/139

For streaming videos: Allow any combination

bestvideo+bestaudio/best

yt-dlp usage example

Archive videos

yt-dlp --download-archive yt-dlp.list --ignore-errors --write-info-json --add-metadata --write-sub --sub-lang en,de,ja --write-thumbnail --embed-subs -f "<format>" "<URL>"

Archive audio

yt-dlp --download-archive yt-dlp.list --ignore-errors --write-info-json --add-metadata --write-sub --sub-lang en,de,ja --write-thumbnail --embed-thumbnail --extract-audio -f "<format>" "<URL>"

Complete archive video with audio, comments, subtitles, thumbnail and everything about YouTube ID:

yt-dlp --write-description --write-comments --write-link --write-auto-subs --embed-subs --embed-thumbnail --embed-chapters --sponsorblock-mark all https://www.youtube.com/watch?v=WhWc3b3KhnY

Credits and special thanks

AgentOak (original owner) made YouTube list formats of video and audio ID especially with tips.

MartinEesmaa (forked owner) updated YouTube list formats for up to date.

Special thanks for finding/fixing by:

qzmtch for finding missing 616 format

dtlnor for little interesting explanation of duplicate formats same

r8420 for finding missing 612 format

Ciancy28 for finding high quality of Opus 256 kbps (format 774) in YT Music

joaquinito2070 for renaming youtube-dl to yt-dlp and fixing incorrect bitrates. Some commits were on it.

@hanubeki
Copy link

RSS podcasts in YouTube Music has "Codecs: 15".
YouTube doesn't host these podcasts so 15 might means "Unknown / External".

@r8420
Copy link

r8420 commented Jan 25, 2024

Missing format 612 for High video quality of video only:
#EXT-X-STREAM-INF:BANDWIDTH=4026389,CODECS="vp09.00.40.08,mp4a.40.2",RESOLUTION=1280x720,FRAME-RATE=60,VIDEO-RANGE=SDR,AUDIO="234",CLOSED-CAPTIONS=NONE
Example vid with this format: 3EoPDusNsoE

@MartinEesmaa
Copy link
Author

Hello, @r8420!
I added for format 612 to VP9 HFR in DASH video information.
Thank you!

Sincerely

  • Martin Eesmaa

@Prototaxis
Copy link

itag 15 is what google cloud services offer as the source file sometimes. Refer to this: https://gist.github.com/Sauerstoffdioxid/2a0206da9f44dde1fdfce290f38d2703

@Ciancy28
Copy link

format ID 774 webm audio is starting to roll out for music uploads, this seems to be 256 kbps Opus for ytm premium (which was previously mentioned here https://support.google.com/youtubemusic/answer/9076559?hl=en but not actually available), despite that, yt-dlp seems to download it just fine at the moment without any preimum cookies
https://youtu.be/1QWiYk3nnWk this song for example has it, seems to be available on <5% of ytm uploads so far, they're probably transcoding the whole library as we speak

@MartinEesmaa
Copy link
Author

Hello, @Ciancy28. The format of 774 audio of Opus 256kbps has been added to DASH audio and putted your example music link.
Thank you for providing this link. :)

  • Martin Eesmaa

@MartinEesmaa
Copy link
Author

@joaquinito2070, thanks for some fixes, I might have look for later why the old mobile phones that claimed no. :)

  • Martin Eesmaa

@vbooka1
Copy link

vbooka1 commented Jun 27, 2024

Starting from May 2024 videos in format 22 (1280x720) are not anymore offered.

@MartinEesmaa
Copy link
Author

Hello, @vbooka1! Thanks for providing information to me! :)

Starting from May 2024 videos in format 22 (1280x720) are not anymore offered.

I can confirm this and I verify that I checked my YouTube videos of format 22 are not there, so you're right.

Thank you, I will update gist right away! :)

  • Martin Eesmaa

@TyMaott
Copy link

TyMaott commented Jul 5, 2024

The resolutions aren't technically fix for each format.
The easiest way to check this is looking at the format_id '18' which is on of the most common (and i think maybe available for every video?)

here are examples with four (4) video IDs (namely: PwEKy4dFw6c , L_jfCrJG82U , 5I69DCxYbBg , rYv2a_VF328)
where the first one has a resolution of 360x360, annotated 360p
second one is 288x360, annotated 240p
third is 640x360, annotated 360p
and forth 640x266, annotated 360p

@MartinEesmaa
Copy link
Author

Hello, @TyMaott! Thank you for the info! :)

Hm, that's weird about second one of 240p instead of format 18. If width is 640 which is like always uses 360p quality for any decrease of height size which is aspect ratio.

You said first one is 360x360, that is 1:1 aspect ratio which is square like used by Instagram.
Third is just normally like 16:9 aspect ratio used by most social medias.
Fourth is 2:40.1 aspect ratio used by some movies.

But second one is 240p, so that's why went into format 18 and also aspect ratio is 0.80:1 with portrait and no landscape.

Do you want me to add if portrait and width decreased for 240p to format 18, if necessary? Thanks! :)

  • Martin Eesmaa

@kr0hng
Copy link

kr0hng commented Jul 11, 2024

There is one music video I found as a YouTube Premium subscriber that is in 774 audio ID. I checked the same song on YT Music with audio quality on Always High but the audio ID was 141.

@MartinEesmaa
Copy link
Author

MartinEesmaa commented Jul 11, 2024

Hi, @kr0hng! Thanks for the link.

Unfortunately, I can't find about format 774 with music video, reported on yt-dlp latest:

[youtube] wufUX5P2Ds8: Downloading webpage
[youtube] wufUX5P2Ds8: Downloading ios player API JSON
[youtube] wufUX5P2Ds8: Downloading ios music player API JSON
[youtube] wufUX5P2Ds8: Downloading web music client config
[youtube] wufUX5P2Ds8: Downloading player 9ed4a7e1
[youtube] wufUX5P2Ds8: Downloading web music player API JSON
[youtube] wufUX5P2Ds8: Downloading m3u8 information
[youtube] wufUX5P2Ds8: Downloading m3u8 information
[info] Available formats for wufUX5P2Ds8:
ID  EXT   RESOLUTION FPS CH │   FILESIZE    TBR PROTO │ VCODEC           VBR ACODEC      ABR ASR MORE INFO
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb3 mhtml 48x27        1    │                   mhtml │ images                                   storyboard
sb2 mhtml 80x45        1    │                   mhtml │ images                                   storyboard
sb1 mhtml 160x90       1    │                   mhtml │ images                                   storyboard
sb0 mhtml 320x180      1    │                   mhtml │ images                                   storyboard
233 mp4   audio only        │                   m3u8  │ audio only           unknown             Default
234 mp4   audio only        │                   m3u8  │ audio only           unknown             Default
139 m4a   audio only      2 │    1.03MiB    49k https │ audio only           mp4a.40.5   49k 22k low, m4a_dash
249 webm  audio only      2 │    1.13MiB    54k https │ audio only           opus        54k 48k low, webm_dash
250 webm  audio only      2 │    1.48MiB    70k https │ audio only           opus        70k 48k low, webm_dash
140 m4a   audio only      2 │    2.74MiB   130k https │ audio only           mp4a.40.2  130k 44k medium, m4a_dash
251 webm  audio only      2 │    2.88MiB   136k https │ audio only           opus       136k 48k medium, webm_dash
602 mp4   256x144     12    │ ~  1.84MiB    87k m3u8  │ vp09.00.10.08    87k video only
269 mp4   256x144     24    │ ~  3.56MiB   169k m3u8  │ avc1.4D400C     169k video only
160 mp4   256x144     24    │    2.19MiB   104k https │ avc1.4D400C     104k video only          144p, mp4_dash
603 mp4   256x144     24    │ ~  3.56MiB   169k m3u8  │ vp09.00.11.08   169k video only
278 webm  256x144     24    │    1.68MiB    80k https │ vp9              80k video only          144p, webm_dash
229 mp4   426x240     24    │ ~  6.55MiB   311k m3u8  │ avc1.4D4015     311k video only
133 mp4   426x240     24    │    4.77MiB   226k https │ avc1.4D4015     226k video only          240p, mp4_dash
604 mp4   426x240     24    │ ~  6.70MiB   318k m3u8  │ vp09.00.20.08   318k video only
242 webm  426x240     24    │    3.52MiB   167k https │ vp9             167k video only          240p, webm_dash
230 mp4   640x360     24    │ ~ 16.91MiB   801k m3u8  │ avc1.4D401E     801k video only
134 mp4   640x360     24    │    9.66MiB   457k https │ avc1.4D401E     457k video only          360p, mp4_dash
18  mp4   640x360     24  2 │   15.21MiB   720k https │ avc1.42001E          mp4a.40.2       44k 360p
605 mp4   640x360     24    │ ~ 15.37MiB   728k m3u8  │ vp09.00.21.08   728k video only
243 webm  640x360     24    │    7.94MiB   376k https │ vp9             376k video only          360p, webm_dash
231 mp4   854x480     24    │ ~ 28.36MiB  1344k m3u8  │ avc1.4D401E    1344k video only
135 mp4   854x480     24    │   14.68MiB   695k https │ avc1.4D401E     695k video only          480p, mp4_dash
606 mp4   854x480     24    │ ~ 25.37MiB  1202k m3u8  │ vp09.00.30.08  1202k video only
244 webm  854x480     24    │   12.04MiB   570k https │ vp9             570k video only          480p, webm_dash
232 mp4   1280x720    24    │ ~ 39.22MiB  1859k m3u8  │ avc1.4D401F    1859k video only
136 mp4   1280x720    24    │   22.22MiB  1052k https │ avc1.4D401F    1052k video only          720p, mp4_dash
609 mp4   1280x720    24    │ ~ 44.42MiB  2105k m3u8  │ vp09.00.31.08  2105k video only
247 webm  1280x720    24    │   23.37MiB  1107k https │ vp9            1107k video only          720p, webm_dash
270 mp4   1920x1080   24    │ ~ 98.92MiB  4688k m3u8  │ avc1.640028    4688k video only
137 mp4   1920x1080   24    │   72.90MiB  3452k https │ avc1.640028    3452k video only          1080p, mp4_dash
614 mp4   1920x1080   24    │ ~ 71.35MiB  3381k m3u8  │ vp09.00.40.08  3381k video only
248 webm  1920x1080   24    │   39.19MiB  1856k https │ vp9            1856k video only          1080p, webm_dash
620 mp4   2560x1440   24    │ ~201.74MiB  9561k m3u8  │ vp09.00.50.08  9561k video only
271 webm  2560x1440   24    │  164.11MiB  7772k https │ vp9            7772k video only          1440p, webm_dash
625 mp4   3840x2160   24    │ ~404.71MiB 19181k m3u8  │ vp09.00.50.08 19181k video only
313 webm  3840x2160   24    │  372.41MiB 17636k https │ vp9           17636k video only          2160p, webm_dash

Is there any thing to find about format 774 by screenshot, cookies file from browser or to inspect webpage by looking network if you're YouTube Premium subscriber?
Thanks! :)

  • Martin Eesmaa

@kr0hng
Copy link

kr0hng commented Jul 20, 2024 via email

@vbooka1
Copy link

vbooka1 commented Jul 25, 2024

A lot of videos are not anymore offered in format 18 (360p + embedded audio), however some are still not deleted yet.
Google ran into economic problems and has to clean up servers now?

@MartinEesmaa
Copy link
Author

Hello, @kr0hng! I don't see the screenshot, you sent via email. Could you try use on GitHub Web with screenshot attachment or file upload such as OneDrive, Google Drive, Mega, file.io or any your favorite cloud file sharing by creating a message again?

  • Martin Eesmaa

@MartinEesmaa
Copy link
Author

MartinEesmaa commented Jul 25, 2024

Hi, @vbooka1! Thanks for little update.

A lot of videos are not anymore offered in format 18 (360p + embedded audio), however some are still not deleted yet.

I looked up my first short film on my YouTube channel to report list encoded:

[youtube] Extracting URL: lmb47hKpjBI
[youtube] lmb47hKpjBI: Downloading webpage
[youtube] lmb47hKpjBI: Downloading ios player API JSON
[youtube] lmb47hKpjBI: Downloading player 3400486c
[youtube] lmb47hKpjBI: Downloading m3u8 information
[info] Available formats for lmb47hKpjBI:
ID  EXT   RESOLUTION FPS CH │   FILESIZE   TBR PROTO │ VCODEC          VBR ACODEC      ABR ASR MORE INFO
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
sb2 mhtml 48x27        0    │                  mhtml │ images                                  storyboard
sb1 mhtml 80x45        0    │                  mhtml │ images                                  storyboard
sb0 mhtml 160x90       0    │                  mhtml │ images                                  storyboard
233 mp4   audio only        │                  m3u8  │ audio only          unknown             [en] Default
234 mp4   audio only        │                  m3u8  │ audio only          unknown             [en] Default
139 m4a   audio only      2 │    1.78MiB   49k https │ audio only          mp4a.40.5   49k 22k [en] low, m4a_dash
140 m4a   audio only      2 │    4.72MiB  129k https │ audio only          mp4a.40.2  129k 44k [en] medium, m4a_dash
251 webm  audio only      2 │    4.97MiB  136k https │ audio only          opus       136k 48k [en] medium, webm_dash
269 mp4   256x144     30    │ ~  6.84MiB  187k m3u8  │ avc1.4D400C    187k video only
160 mp4   256x144     30    │    2.41MiB   66k https │ avc1.4D400C     66k video only          144p, mp4_dash
230 mp4   640x360     30    │ ~ 28.97MiB  794k m3u8  │ avc1.4D401E    794k video only
134 mp4   640x360     30    │    9.74MiB  267k https │ avc1.4D401E    267k video only          360p, mp4_dash
18  mp4   640x360     30  2 │ ≈ 14.42MiB  396k https │ avc1.42001E         mp4a.40.2       44k [en] 360p
605 mp4   640x360     30    │ ~ 17.94MiB  492k m3u8  │ vp09.00.21.08  492k video only
136 mp4   1280x720    30    │   35.44MiB  973k https │ avc1.64001f    973k video only          720p, mp4_dash
311 mp4   1280x720    60    │ ~107.31MiB 2942k m3u8  │ avc1.640020   2942k video only
298 mp4   1280x720    60    │   51.07MiB 1402k https │ avc1.640020   1402k video only          720p60, mp4_dash
312 mp4   1920x1080   60    │ ~204.36MiB 5602k m3u8  │ avc1.64002A   5602k video only
299 mp4   1920x1080   60    │  100.16MiB 2749k https │ avc1.64002A   2749k video only          1080p60, mp4_dash

It seems YouTube removed VP9 forced encoded of my original video 1080p 60fps and all other resolution sizes, some videos may remain still.
I don't know why YouTube removed it for an unknown reasons.

Google ran into economic problems and has to clean up servers now?

I think wants to clean up like reason to cut high cost and remove encoded videos by solving economic problem.
I might not sure why Google removed encoded videos of most videos low views... might contact to Google by Media inquiry.

And also for Web Archive (archive.org) after removed 720p non-DASH by Google, now it takes 360p low video quality available one non-DASH format remaining.

  • Martin Eesmaa

@AMTPROD
Copy link

AMTPROD commented Sep 15, 2024

@MartinEesmaa would you happen to know from working with all these codecs, which is "best" for audio quality? I am running a MacMini for streaming high res audio and watching Youtube TV/Movies via Safari, FireFox, or Chrome and I notice they all use different video AND audio codecs. Been trying to decipher which one would be best, but I think I'm more confused!! Thank you for your time. ~alan

@MartinEesmaa
Copy link
Author

Hi, @AMTPROD known as Alan! Thank you for the questions! :)

would you happen to know from working with all these codecs, which is "best" for audio quality?

Well, the best audio quality I would say is Opus 128kbps (format 251) and for YouTube Music also Opus 256kbps (format 774).
Opus was initially released in 2012 and it is higher quality of bandwidth than AAC, MP3, Vorbis and more... which can be beaten by audio blinding test by comparing audio codecs, so Opus won.

When you're running your Mac Mini for streaming and watching YouTube videos via browsers. Like Firefox, Safari and Chrome supports AVC decoding, which is most compatible and also supports AAC too, but Firefox partially supports AAC for MP4 container and has native codecs installed on operating systems.

Let's say you're running Safari browser latest and you're watching random video of transcoded AV1 (some videos), VP9 (can be forced up to 2K or sometimes) and AVC (always all videos).
When YouTube detects your browser and device for support AV1, VP9 and AVC before fallback down... AV1 does not support due no native software decoder support for your Mac Mini, so it switches to VP9 and plays fine.

Fallback structure for Safari browser:
AV1 (partial support, not playing) --> VP9 (supported, playing) --> AVC (supported, not playing after VP9 is supported and the video is encoded)

Some macOS and iOS users uses Safari browser, but it came late full support for Opus and WebM (VP8 and VP9) in 2020s and for AV1 is partial support which can be used by new Apple devices with built in native hardware decoder for Safari with WebKit.

YouTube provides currently formats to support video & audio codecs:
Video codecs:

  • H.264/AVC (most compatible)
  • VP9 (alternative to HEVC, supports 2013 browsers and later, Apple native support came late)
  • AV1 (more efficiency 30% than HEVC/VP9, less compatible for native older devices)

Audio codecs:

  • AAC (most compatible)
  • HE-AAC (still most compatible, but it is compatible backwards with AAC, but sometimes low quality for low bitrates)
  • Opus (best possible audio quality)

If you want to play high res audio and with video, the best possible you can take is Chrome or Firefox for full support.

Learn more:
https://en.wikipedia.org/wiki/Opus_(audio_format)
https://caniuse.com/opus
https://caniuse.com/webm
https://caniuse.com/av1
https://www.apple.com/ci/newsroom/2023/10/apple-unveils-m3-m3-pro-and-m3-max-the-most-advanced-chips-for-a-personal-computer/

If you have any questions or issues, feel free to let me know! Thanks! :)

Sincerely

  • Martin Eesmaa

@AMTPROD
Copy link

AMTPROD commented Sep 28, 2024

Morning @MartinEesmaa !
Thank you so much for the very thorough and complete reply, and for keeping it very laymen level!!
This is brilliant information and exactly what I was wondering about for years now.

I tend to use the FireFox Web Browser on my MacMini, mainly simply due to beliefs that it is as fast as anything else but 'safer' and seems more stable and less interwebs crud. Yet, I also wondered if I should be using Youtube via Chrome and YouTube TV program instead-since they are the originator of the content and are 'maximized' for their own codecs etc. Unfortunately, when I do use them at the full resolution the GPU fans on the Mac crank up fairly loudly. Therefore, I tend to just default to FireFox.

As I write this, the codecs from FireFox (watching an IMSA 6hour race at Indianapolis in 1080p 60fps on YT) are:

  • vp09.00.51.08.01.01.01.00 (303)
  • opus (251)

So if I am reading your intel and linked info properly, the video uploaded and hosted on Youtube is the highest both video AND audio bitrate and data, and is being 'broadcast' and received by my MacMini in the highest quality/data/bitrate and decoded properly using the best audio/video codecs currently available for both the Computer and for the Browser.

I think one of your links mentions that the broadcast sample rate for Opus (251) is approx 48khz? Is that correct?
Though Opus is the 'best' format used/implemented for audio/video content and browsers and OS, I noticed on Wiki is states that it is considered "lossy", assuming this is obvious due to needing to compress for broadcast at Xmbps along with higher video rates, etc. Is there one that is 'lossless', at least for audio components?
Are stand alone applications/music companies like Apple or Tidal or Qobuz using their own 'lossless' audio codecs?

Is there anything that you are aware of that I could be doing to increase or extract the best performance of the audio in my system as far as the 'digital' side of things go, either computer, program, audio cards, GPC/CPU etc?
Everything is playing into my stereo thru a modified BelCanto DAC 2.5 (192hkz 24bit)

  • BelCanto DAC connected to Mac via USB
  • The MacMini (2014) is connected to the internet thru ethernet
  • The modem and router are newer-ish ARRIS

Thank you so much for your time and expertise! I am passing this info onto my fellow Audiophile nerds. We -LOVE- geeking out on this sort of thing!
Wishing you a great weekend,
~alan

@jack980517
Copy link

Format 18 for https://youtu.be/bFBfSlkXDJk has 128kbps audio instead of 96kbps. This might be because it's a music video.

@MartinEesmaa
Copy link
Author

Hi, @AMTPROD (as Alan)! Thanks for much information, sorry for a late response with my busy working in my real life. Anyway...

Unfortunately, when I do use them at the full resolution the GPU fans on the Mac crank up fairly loudly. Therefore, I tend to just default to FireFox.

Well putting full resolution like 4K VP9 on your mac mini may slow down and drop frames... Still welcome to use Firefox for your trick :)

I think one of your links mentions that the broadcast sample rate for Opus (251) is approx 48khz? Is that correct?

Yes, that's correct. YouTube uses 48khz Opus at all times, not 44.1 kHz.

Though Opus is the 'best' format used/implemented for audio/video content and browsers and OS, I noticed on Wiki is states that it is considered "lossy", assuming this is obvious due to needing to compress for broadcast at Xmbps along with higher video rates, etc. Is there one that is 'lossless', at least for audio components?
Are stand alone applications/music companies like Apple or Tidal or Qobuz using their own 'lossless' audio codecs?

They want to compress from uncompressed/audio source to best lossy Opus audio as possible and even AAC & HE-AAC too for compatibility.
YouTube doesn't encode and won't give lossless to users, but only YouTube stores original video with lossless (like format 15) for non-users, which is accessible to administrators and IT workers... not available to users unless a person of the uploader can request to get original video copy and not sure about that...

Apple is using their own default ALAC (Apple Lossless Audio Codec), which was introduced in 2004 and all iOS devices supports ALAC, even macOS too version of 2004 and later... but Tidal and Qobuz don't use their own lossless audio codecs, which they are streaming services and they use third party. Apple Music uses ALAC to produce music for premium users.

Is there anything that you are aware of that I could be doing to increase or extract the best performance of the audio in my system as far as the 'digital' side of things go, either computer, program, audio cards, GPC/CPU etc?
Everything is playing into my stereo thru a modified BelCanto DAC 2.5 (192hkz 24bit)

  • BelCanto DAC connected to Mac via USB
  • The MacMini (2014) is connected to the internet thru ethernet
  • The modem and router are newer-ish ARRIS

Just reviewing your details that did you performance.

Your ethernet network is stable and can go up to maximum 1000 mbps, which is a little faster internet than wireless, but router with internet speed is different.

For your BelCanto DAC (Digital to Analog Converter) 2.5, they claim for to enhance audio quality said in User Guide:

All digital input sources benefit from the new 2Hz digital PLL stage that rolls off incoming jitter by more than 10X at 10Hz
frequencies and greater than 10,000X by 100 Hz. Any incoming jitter at frequencies above 10Hz is reduced to levels that have
no effect on measured or sonic performance

ARRIS router is okay for HD streaming (if you purchased HD internet subscription), but sometimes higher bitrates of 2K/4K/8K videos may be buffer slow.

To get best performance for watch a YouTube videos, you can:

  • Close the programs and background services (if necessary)
  • Digital to Analog Converter can go up to 96kHz and 24bits, but with no sound playing may hear little bit static sound when you're closest to speakers... digital is maximum frequency than 48kHz and no static sound if sound is no playing...
  • You can upgrade subscription internet to get more faster or you can wait at 19:00-23:00 / 7-11 PM to increases speed for late night, but it's your choice or reduce network devices to disable Wi-Fi on your home network :/

Feel free to ask or reply again to me. Thanks! :)

Sincerely,
Martin Eesmaa

@MartinEesmaa
Copy link
Author

Hi, @jack980517! Thanks for info! :)

Format 18 for https://youtu.be/bFBfSlkXDJk has 128kbps audio instead of 96kbps. This might be because it's a music video.

Thanks for providing me link, I fixed it and updated it from 96 kbps to 128 kbps, also profile from Baseline to Main. Checked on MediaInfo. 👍

  • Martin Eesmaa

@jack980517
Copy link

No, not all videos' format 18 are 128kbps. https://youtu.be/FAyKDaXEAgc (not a music video) is also 128kbps, but https://youtu.be/laFY-8vD9ig is 96kbps. Maybe it depends on video length.

@MartinEesmaa
Copy link
Author

@jack980517,

No, not all videos' format 18 are 128kbps. https://youtu.be/FAyKDaXEAgc (not a music video) is also 128kbps, but https://youtu.be/laFY-8vD9ig is 96kbps. Maybe it depends on video length.

Hmm, yeah you're right. Gimme a sec, I'll fix for a moment sec... do you prefer to add another line or update this line of format 18?

  • Martin Eesmaa

@jack980517
Copy link

I prefer to add a footnote like formats 17 and 22.

@MartinEesmaa
Copy link
Author

Thanks, @jack980517! :) Added a footnote of format 18. If you're unsure or something is mistake, feel free to fix the words.

  • Martin Eesmaa

@aokin1999
Copy link

aokin1999 commented Nov 4, 2024

Format 774 seems to be removed from the example video. IdK if 774 isn't available for any video or if it's something of that specific video.
Btw I'm not sure if 3GP is offered anymore. At least it isn't available for modern videos, maybe for some very old ones it's still being offered.

@Ciancy28
Copy link

Ciancy28 commented Nov 4, 2024

Format 774 seems to be removed from the example video. Idk if 774 isn't available for any video or if it's something of that specific video.

It's only available for premium users now I think

@MartinEesmaa
Copy link
Author

MartinEesmaa commented Nov 5, 2024

Hi, @aokin1999 and @Ciancy28!

YouTube administrators forbids premium formats for YouTube Music only due bypassing reason and not paying to YouTube Premium of Music. So yt-dlp can't access premium format of music cover art with video covered after YouTube blocked bypassing without Music Premium subscription.

The only way is only can work by passing cookies file from your browser when you subscribed to YouTube Music Premium.

EDIT: I will have to update gist anyway then...

Feel free to reply me back. Thanks! :)

  • Martin Eesmaa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment