2

youtube-dl can be used to see what formats are used to store YouTube content:

youtube-dl -F https://youtu.be/??????

The above command hints that the audio and video are mostly stored separately. Is it right? Does YouTube streaming combine audio and video in real-time?

Formats for a sample YouTube content

Formats for a sample YouTube content

Megidd
  • 7,089
  • 6
  • 65
  • 142

2 Answers2

4

Most large streaming services will use ABR streaming (see: https://stackoverflow.com/a/42365034/334402).

The two most common ABR streaming formats are HLS and MPEG-DASH and both provide a manifest or index file which the player downloads first and which will contain links to the media streams, typically audio, video, subtitle tracks etc.

For encrypted content the audio and video, and even different bit rate video tracks, may all have separate encryption keys.

The player will download the audio and video tracks and synchronise them for playback.

Mick
  • 24,231
  • 1
  • 54
  • 120
2

in general streaming video and audio are sent in separate channels .... ditto for multi track audio like 5+1 ... during transport these channels are wrapped by a media container like mp4 etc

motive is partly due to distinct compression algorithms ... some algos are best for audio versus others for video and baked into these algos is the spread and sharing of data over time across video frames see B-frames for details ... these channels are not limited to video and audio ... if you own the sending and receiving sides you can send arbitrary data in many distinct channels by making up your own data protocol ... as an aside modern codec like H.256 allow data to get sent from receiver back to sender when you think you are simply viewing a movie (read the RFC)

youtube stores each of its various flavors of video and audio in separate files on its end then combines them based in desired streaming quality choices on a per download basis

Scott Stensland
  • 26,870
  • 12
  • 93
  • 104