Answers.Body: <p>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.</p>
  <blockquote>
  <p>Don't we have to download the whole MP4 file before knowing MP4's
  metadata then streaming?</p>
  </blockquote>
  <p>No</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-02T01:28:23.820Z
Answers.Text: Thanks! By the way I found another similiar topic on this which says there are some limitation on playing large mp4 file through browser: https://stackoverflow.com/questions/10328401/html5-how-to-stream-large-mp4-files
Answers.UserDisplayName: shintaroid
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-01T22:48:32.137Z
Answers.LastActivityDate: 2021-07-01T22:48:32.137Z
Answers.UserDisplayName: SlimSCSI
Body: <p>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.</p>
  <p>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.</p>
  <p>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?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-07-01T17:10:26.707Z
Comments.Text: I’m voting to close this question because it is about web streaming technologies (S3) and not about video production.
Comments.UserDisplayName: Saaru Lindestøkke
Tags: <streaming><mp4>
Title: A 2 Gigabyte MP4 file on AWS S3 can be played on Browser instantly (no need to download the whole file before streaming), why?
UserDisplayName: shintaroid
ThreadText: # A 2 Gigabyte MP4 file on AWS S3 can be played on Browser instantly (no need to download the whole file before streaming), why?
  
  (Asked by: username_0 on 2021-07-01)
  
  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?
  
  **Tags:** streaming, mp4
  
  > **Comments:**
  > **username_1**: I’m voting to close this question because it is about web streaming technologies (S3) and not about video production.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2021-07-01. Score: 1 | Accepted answer
  
  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
  
  > **Comments:**
  > **username_0**: Thanks! By the way I found another similiar topic on this which says there are some limitation on playing large mp4 file through browser: https://stackoverflow.com/questions/10328401/html5-how-to-stream-large-mp4-files  
  
  ---
  
  