0

I thought when streaming a mp4 file on a browser, the browser needs to download the whole MP4 file before playing, because the player needs to know metadata like video codec, audio codec, etc. and MP4's metadata can only be known only after downloading the whole file.

But today when I uploaded a 2 Gigabyte MP4 video on AWS S3, it plays instantly on Microsoft Edge (actually there is 1 or 2 seconds' delay, but still obviously the browser did not download the whole MP4 file before playing). By the way I have CloudFront (CDN) before S3, so Microsoft Edge first request the video url to CloudFront, then CoudFront request the MP4 file in S3.

How is it possible? What is the magic behind AWS S3? Don't we have to download the whole MP4 file before knowing MP4's metadata then streaming?

1
  • 3
    I’m voting to close this question because it is about web streaming technologies (S3) and not about video production. Commented Jul 1, 2021 at 17:10

1 Answer 1

1

Mp4 files store all the metadata in the moov box of the file. The browser can download the moov box, then perform byte range requests to pull the rest of the file on demand as needed. the moov box is usually only a few hundred kilobytes.

Don't we have to download the whole MP4 file before knowing MP4's metadata then streaming?

No

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.