Hi, I need some help on this.i made a simple upload video but the problem is i cannot display the video that i uploaded.I have no idea on this on how to display the video that I uploaded and play on it....million thanks in advance.
First, can you please let us know the format of these videos? Depending on the format, requires different player.. e.g. flash for flv and mp4/h264, divx player for divx and avi, and the list goes on...
The format of the video is WMV...i have no idea in using an third party like diafol said.I never tried to play or to display the video.I uploaded the video in folder and the name of my video is in the database..i just followed the w3schools.
html5 players does not support wmv, because it is a browser based player. So, the most commonly supported video formats or extensions are mp4/h264, ogv or ogg, webm.
If you are wondering which format is the most useful, without the burden of having too many duplicates of the same video encoded in different formats? My choice would be the mp4/h264.
Why mp4/h264 ? Because it is supported in html5 and apple gadgets.
Will all the browsers wil be able to render mp4/h264 video? the answer is yes and NO. Yes, because it supports many mobile browser. No, because firefox and apple only supports it. However, you can always write a fallback player codes, so that whenever a browser is not supporting mp4/h24 video, we can fallback to regular flash player like flowmotion or jwplayer. That should make everyone happy. The most important about using mp4/h264 encoded video is that it can be encoded in the very minimum bitrate and still the quality is far superior than any other video formats.
Downside of mp4/h264? The downside is that you cannot pseudostream this type of video, because the moov atom of this video is located at the tip of the video file. Ok..ok. yes, we can pseudo stream mp4/h264 video by using php script written by some video afficionados like myself. I will not be providing the script for it, because I am relying on it heavily to pay for my coffeee.
How do you encode mp4/h264 videos? I can show you how to do it windows using the commandline, or just download a readily available for free at cnet. The only thing I cannot show you is how to encode this in php, because the encoder class I wrote for the mp4/h264 + mp4box moov relocator class is considered as propriety script. Thats the one paying for my starbucks coffee card every week. Not a lot, but I am getting my coffee everyday and it is pretty generous.. ( I think :)).
Just for the fun of encoding video from windows command line, here is a simple instruction of doing it. I strongly suggest using at least a multicore cpu. Else, this process is going to be slow as snail.
Download ffmpeg here. WARNING! DO NOT GO TO **For fresh FFmpeg builds for Windows go to ** link. I know this guy, but his build has been buggy lately.
Select your operating system flavor. If you are running a multi-core cpu, download the win64 static or whatever fits to your system, but make sure it is the STATIC distro.
Unzip the zip file.. open the unzipped directory. Copy all of the files.
Direct your file browser to your c drive. In C drive create a new directory called ffmpeg. Paste the copied files from step 3.
Create video directory inside the ffmpeg directory. Open video directory, and create input and output directories.
Move your video to the input directory.
Open your regular notepad, copy, paste command line code below. Codes below has been adjusted to work with the ffmpeg version provided above.
Change the value for yourVideo.wmv and video.mp4 above to your own video. Once you are done editing the values. Copy the entire code.
Open the windows command prompt, and paste the edited codes above.
ffmpeg should start encoding and high quality mp4/h264 encoded video can be viewed in the output directory.
After the video has been encoded, move the encoded video from the output directory and move it to your xampp server.
Use the html5 player as suggested by Diafol (ardav).
I apologize and I hope people will understand the reasons why I would not provide a php script for video encoders. It is not that it cannot be done. I just decided to make this as my coffee cow. I have been doing this for a long time, and some other developers would pay a lot of money to decrypt my encoder class, but no one even came close .
@veedeoo,i tried the steps above but i got error...i tried to use a coverter video converter from xilisoft.
i convert my video.wmv to mp4/h.264...and then i tried Diafol videojs but unfortunately i was not able to display or play the video...please help me on this.