Change maximum video size supported by server

Asked

Viewed 303 times

1

I was testing a video on my page, only I came across a problem....

The line of my code is basically just that:

<video id="video" src="arquivo.mp4" controls="true" />

The video resolution is the size of each frame set in 1920w x 1080h. The video is in format .mp4. That is, the video is considerably large.

I tested in the following browsers:

Firefox

inserir a descrição da imagem aqui

No sound, no video, and I get the following message:

The media http://localhost/.mp4 file could not be decoded.

Chrome

Runs the sound, but the video itself does not appear.

Opera

inserir a descrição da imagem aqui I reduced the view by 50% to fit the entire video on the screen Performs both sound and video.

Safari and Explorer I didn’t even test... My question is whether there is a maximum requirement (and what is it?) for video size to run on these browsers. Or if it goes from the server configuration, and if it is, how to change so it can be run?


Edit

As commented by @Giancarloabelgiulian, an additional piece of information: I’m using the wamp server v. 2.5.


Edit(2)

At the time was testing only locally, I forgot to play on the server, the problem occurs in http also.

  • 1

    See if this link can help you: http://stackoverflow.com/questions/10328401/html5-how-to-stream-large-mp4-files.

  • Marcelo there are several codecs, It may not even be the size, but yes the encoding, I’m not sure, It may even be problem in audio. Strange that you said you use wamp, but the error presented was with protocol file:///. The problem occurs at http as well?

  • @Guilhermenascimento updated the question, the error is occurring in the http protocol as well...

1 answer

2


According to your information, there may be one of these two problems:

  1. Failure to decode MP4 video by the browser; or
  2. Failure to transfer video from the server due to the size of the filing cabinet.

So I’ll come up with two possible solutions:

HYPOTHESIS 1 - CORRECTING THE DECODING OF THE VIDEO FILE

Before going through your WAMP server settings, we have to make sure that there are no coding issues in the video file itself.

Every compressed video (AVI, MPG, MP4) always generates within itself an "index" of metadata for searching and synchronizing audio and video. This "index" serves to allow players to fast and efficiently forward and rewind the video, without crashing or losing sync between streams during playback. When this "index" does not exist, or it has faults, programs crash when trying to display the file or try to create a temporary "index" for the file’s metadata, only running it after completing this task. The bigger the file the longer it will take for the video to run.

MP4 videos have the problem of generating this "index" of metadata only at the END OF THE FILE causing most browsers to have to download ALL multimedia content to start displaying it (this if they don’t crash).

To solve this problem, we will use a small program called "My Mp4box Gui" that can adjust the MP4 files for transmission via internet, creating the "index" of metadata at the beginning of the video. Just follow the steps below:

  1. Download and install My Mp4box GUI (http://www.videohelp.com/software/My-MP4Box-GUI).
  2. Open My Mp4box GUI and select "Options -> Hint For RTP/RTSP" (is this option that enables rebuilding the metadata index in the file front).
  3. Click "Add" and select the MP4 video you want to make compatible for streaming via server (WAMP).
  4. Click "Save As..." and choose a folder and a name to save the filing cabinet.
  5. Finally, click "Mux" and wait for the new optimized MP4 video to be generated. The program takes about 1 minute to recreate the index of a video with 150MB.

HYPOTHESIS 2 - SETTING UP THE WAMP SERVER TO ACCEPT LARGER VIDEOS

If the above hypothesis has no results, then the problem must be in relation to the transmission of the video by the server.

Generally, WAMP Server limits by default the size of video files accepted for upload and transmission in order to ensure their efficiency in displaying files.

To configure the WAMP Server to accept videos larger than standard, follow these steps:

  1. Go to the folder where Wampserver is installed (usually at C:/Wamp/bin/apache/Apache2.4.4/bin) and open the file "ini.php" via notepad.
  2. Open the file, Ctrl + F to find the following lines:

    post_max_size = 8M and changes to: post_max_size = 750M and

    upload_max_filesize = 2M and changes to: upload_max_filesize = 750M

With these tips, I hope I’ve helped you!

  • I tested your solutions, but neither worked...

  • Gee... I’ll see if I can suggest some other way. However, I need more information: you said you tested this video first by loading it directly into the browsers via an HTML5 page, right? If you simply drag the video to the browsers' address bar (http://... or file://...) does it also give this error? I saw that in Firefox there is a warning that "the file is corrupted" but in Opera runs normal. It is almost certain that it may be a problem in the video itself. You recorded with which equipment (iPhone, Canon camera...)? What is the video CODEC (Mediainfo)?

  • Ah... if you can post the video (or an excerpt from it) for me to download I could check on my own system, to give you more accurate information.

  • Puts, I managed to solve, had to do with the codec even.... , I will accept your answer because it helped me find the problem, but I will create a more succinct answer as to which solution I used

Browser other questions tagged

You are not signed in. Login or sign up in order to post.