0
votes

I am converting the video into mp4(H.264 and aac codec) using ffmpeg in linux and try to run the video from server using HTML5. It doesnt work.But if I run the video in local, using wamp server its playing smoothly.

FFMpeg comment

ffmpeg -i inputfile.avi -sameq -acodec libfaac -ab 128kb -vcodec libx264 -b 1157kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 312×176 -title X outputfile.mp4

HTML 5 Coding

<!DOCTYPE HTML>
<html>
<body>

<video width="320" height="240" controls="controls">
<source src="testfile_mov.mp4" type="video/mp4" />
Your browser does not support the video tag.
</video>

</body>
</html>

I tested the content type with web sniffer.It gives the text/html.How can I play the HTML5 from my webserver.

In chrome I get the blank screen(Chrome from other sites HTML5 videos are playing.Chrome downloaded and installed today).And In safari its working.(Safari version 5.0.3)

2
Yeah infact you could just send a PHP header (not complying with standards in this case) but you could see if that would help?DarkMantis

2 Answers

2
votes

I imagine that configuring the web server to send the correct content-type for video files might be a good start. Video is not "text/html".

0
votes

HTML5 video has major issues with format compatibility. Different browsers support different video codecs. There's no common ground between them, and they've been arguing about it for ages. There's a lot of politics involved.

There are ways of getting it to work in all browsers, but it does require saving the video in multiple formats and writing some extra HTML markup to allow it to fall back to the correct format for each browser.

A good article on this can be found here: http://www.robwalshonline.com/posts/tutorial-serving-html5-video-cross-browser-including-ipad/ (but since it's a fairly common issue, there are plenty of other articles around the web which deal with the same problem, so if this one doesn't help, a quick visit to google should give you plenty more)

Hope that helps.