MP4 video hosting

I am trying to add three videos to my site. I am using jw-player. It works, but a simple video in 10 seconds (3 MB) takes more than one minute to download. I thought this was the problem of my hosting, but I tried to download another similar video based on the Internet longer than mine (22 MB) and it loads in a few seconds!

I cut and convert video in .avi format (MPEG4, 9280 Kbps, 640X480, 25 frames per second, 273 MB, 4 minutes without audio) with Avidemux, in .MP4 (H264, 2900 Kbps, 640X480, 25 frames per second, 3.64 MB, 10 seconds, without audio) video. I tried to change the format compression and also reduced the data transfer speed, but the download did not improve.

Online based video is .MP4 (H264, 1621 Kbps, 960x540, 25 frames per second, 22.1 MB, 30 seconds, with 48 KHz AAC audio). It loads fast, no problem.

Where am I mistaken? I can’t understand if there are any settings that I have to give during coding to adapt my video web pages.

+4
source share
2 answers

Ideally, you should use a streaming server to stream your video. You can get around it using progressive download on a regular HTTP server. For this to work, you need to prepare your video in a special way. Usually, when you encode mp4 video, the video metadata is at the end of the video file. Therefore, the player must download the entire mp4 file before he can read the metadata and start playing the video.

You need to use a program like qt-faststart to move the metadata to the beginning of the mp4 file. Then the player can start playing the video as soon as the video starts downloading, without having to wait for the entire video to download.

Essentially, as soon as you have a mp4 file, just run

 qt-faststart yourvideo.mp4 outputvideo.mp4 mv outputvideo.mp4 yourvideo.mp4 

(It is assumed that you are on a platform like Unix). Commands will be slightly different from windows, but the idea is the same. Once this is done, your video should play as you expect.

Search for qt-faststart on Google or elsewhere.

+5
source

I think you need to use a media streaming server. The Http protocol is not suitable for broadcasting video. In fact, it is intended to work only with text. I have no idea what kind of thread the server should use, but .. a little google search can help you.

0
source

All Articles