According to your information, there may be one of these two problems:
- Failure to decode MP4 video by the browser; or
- 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:
- Download and install My Mp4box GUI
(http://www.videohelp.com/software/My-MP4Box-GUI).
- Open My Mp4box GUI and select "Options -> Hint For RTP/RTSP" (is
this option that enables rebuilding the metadata index in the
file front).
- Click "Add" and select the MP4 video you want to make
compatible for streaming via server (WAMP).
- Click "Save As..." and choose a folder and a name to save the
filing cabinet.
- 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:
- 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.
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!
See if this link can help you: http://stackoverflow.com/questions/10328401/html5-how-to-stream-large-mp4-files.
– Giancarlo Abel Giulian
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?– Guilherme Nascimento
@Guilhermenascimento updated the question, the error is occurring in the http protocol as well...
– MarceloBoni