0

I am interested in using videos directly on my website instead of loading them from YouTube using the <video> tag.

However, I am concerned about large files slowing down load times for users with slow connections.

How does loading work? I just inspected this video and noticed that it is loading as it plays... does this resolve the loading time problems for larger videos?

Alex Banman
  • 526
  • 1
  • 6
  • 20
  • 1
    there are a bunch of optimisations you can do, but if working with MP4 making sure the MOOV atom is at the start of the file and your server supports byte range requests, to using a fragmented mpeg format (HLS or Dash) – Offbeatmammal Sep 09 '20 at 22:42

1 Answers1

0

I think you area saying that you want to host your own videos rather than hosting them on a service like YouTube.

Video streaming is quite a specialised domain and if you want to get good quality and allow for different devices and network conditions then it is often easiest to use a speciality video streaming server to host the video.

Examples of solutions include:

These are all commercial solutions but they usually have free trails.

All support HLS and DASH, which are the most common ABR protocols to stream videos - these support multiple bit rates with the video broken into chunks allow the client choose the best bit rate for the device and network conditions (https://stackoverflow.com/a/42365034/334402).

There are also some open source media frameworks which you could explore streaming examples or tutorial for - a good place to start would be:

Video streaming is complex and if you want to support at scale you need to consider the ongoing support effort also. If it meets your needs it may be worth looking at some of the commercial video hosting services also, like Vimeo etc, which can take care of that complexity for you and provide you a simple interface, typically some code to embed on your website.

If you simply want to host the mp4 files on your site yourself, then a key thing to note is to move the 'Mood" atom to the start of the video as noted in the comments above.

Mick
  • 24,231
  • 1
  • 54
  • 120
  • I am trying to get away from using 3rd party services for hosting videos on my site, I would rather load the video files directly. What is a "moov" file and how do I move it to the start of my file? Also, how do I use a fragmented video format? – Alex Banman Sep 14 '20 at 14:23
  • The Moov atom (or sometimes called Movie Atom) is a header field in an MP4 file containing info like duration, timescale, pointers to track info etc. There are several methods to move it to the start, e.g.: https://stackoverflow.com/a/14706197/334402. ABR and fragmented video is quite an involved subject but you will find guides if you search for 'HLS' or 'MEPG DASH' overview. Here is one example at the time of writing: https://www.coursera.org/lecture/ar-technologies-video-streaming/5-3-youtube-mpeg-dash-part-1-ntnci – Mick Sep 14 '20 at 14:36
  • Sounds good, I will look into these and let you know what I find! – Alex Banman Sep 14 '20 at 22:51