simply put, I've been working at this problem and I can't seem to find a solution that works. I have been trying to locate a way to play live video from our Wowza server's MPEG dash streams with no luck. We're trying to stick to html5 's video tag since flash player doesn't work for our ARM based systems.
anyone have any clue on sources so I can actually get the foot in the door with this one? Feel like I've been charging at a brick wall all week.
As Szatmary already mentioned MPEG-DASH using only the HTML video tag and feeding the .mpd to it won't work in web-browsers. However, you do not have to implement a player on your own, as there are solutions available which also support live scenarios, like dash.js or bitdash. For a playout with dash.js, MSE support in browsers is mandatory, whereas bitdash uses also a Flash fallback. Both are working on Chrome on Android and can handle live streams.
the video tag will not work with DASH. Your browser needs to support Media Source Extensions (Many newer browsers do). Then each DASH segment needs to be downloaded and passed into MSE. DASH.js can do that for you. iOS does not support MSE. Nor does most android devices. for iOS you must use HLS in the <video> tag.
Related
I want to be able to play videos in my website. From what I understand there are only like 4 formats supported in HTML5 amongst the browsers. I can't seem to find any straightforward tutorial on how to play a wider array of formats. How can I play, let's say an mkv file?
I believe from what I've read so far, there's a way to setup vlc or ffmpeg to serve and simultaneously convert the file to a usable format. Is this right? How can this be done?
My current solution is to run a node http-server in the video directory and play it via:
<video autoplay controls class="player">
<source src="http://127.0.0.1:8080/movie.mkv" type="video/webm" />
</video>
This gets me picture but no sound. Volume control is disabled.
html5 has a <video> tag and you are using it correctly. This tag, and its attributes, is standardized so every browser should follow this spec, in theory.
In practice not every browser follows the spec and supports every aspect of html5 video capability. Think of other OSes, or handeld devices that must be capable of stream a video too.
Here you can find a compatibilty table and you can explore wich file types are supported by each browser:
http://caniuse.com/#search=video
As I see, mkv is not included in this spec so the browsers that can play this video are already doing something that is not required by the spec.
Last but not least, I would not suggest you to use plugins because they're not cross-OS compatible, nor cross-browser (including mobile) compatible.
Is there any way to make .mp4 video work in all major browsers? I heard that videojs can help me but I am not sure. Will this library automatically set the flash as a callback if the video format is not supported for the browser? Has any used it before? Please help.
At one level you could probably say that mp4 will already work in most major browsers, but, unfortunately, things are not that simple.
mp4 is a 'container' and the video and audio in it may be encoded with various codecs which you will need to check your browser supports (most support h.264) and even the same codec using different settings (e.g. baseline vs mainline profiles).
There are also techniques to move the metadata to the start of the mp4 file to allow it stream immediately before the whole file has downloaded - without this it may appear that your video will not play (or it may even not play). See: http://multimedia.cx/eggs/improving-qt-faststart/
In fact it is probably possible to create an mp4 which will not play in any major browser.
As Keizom say's best current practice is to provide multiple sources of a video in formats that are known to work with current major browsers.
It's also worth nothing that the playing field keeps changing as browsers and video format evolve - for example a video player which used or fell back to Silverlight just a short time ago will now no longer work on some of the most popular browsers as they no longer support Silverlight.
To see the current picture you need to check some of the sites that are updated regularly in line with browser changes. Two good examples are:
http://camendesign.com/code/video_for_everybody/test.html
https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats
You can still achieve this while allowing your users to upload just one format (this is what popular video hosting site do). You simply need to convert their uploaded video into the minimum set of formats you need to support the browser set you want to hit.
Note that if you are worried about quality of playback on different devices and with different network conditions then you may actually have to provide multiple bit rate versions of each video format (so the client can switch between bit rates as network conditions change).
Of course, this makes your server side more complicated and also uses a fair amount of computing power, so you need to decide if your use cases justifies this investment/effort.
Whether the .mp4 will "work" or not depends on the OS & browser. Cross-OS/browser support is achieved by supplying multiple sources.
<video>
<source src="foobar.mp4" type="video/mp4" />
<!-- some other alternative sources -->
<source src="foobar.ogv" type="video/ogv" />
</video>
I understand that the best bet when streaming a video as a source in an HTML5 tag would be .mp4. But let's say that I have a source that only outputs fragmented to an ism/manifest.
Is there any way at all, whether through other libraries or messy hacks, that I can bring this video into something rendered as a tag onscreen? The closest I have found is Walkthrough: Building Your First HTML5 Smooth Streaming Player because it allows this to be done - but I neither have Windows 8, or want to have this running a server capable of .NET. I was hoping there was something, messy or not, that I could achieve this with entirely within javascript and executable locally without a deploy.
Thanks
Firstly, W3C does not provide a standard for adaptive bitrate streaming, yet. So for the time being most browsers only support simple progressive download playback.
Hence, there is no JS implementation of a Smooth Streaming player and Microsoft is not working on one, as far as I know.
The example you provide uses the "Microsoft Smooth Streaming Client SDK Beta 2 for Windows 8" which is a C++ library and is only available for Windows Store Apps development. It has nothing to do with browsers.
So, unfortunately this is not yet possible. Even more, I doubt that this will ever happen, because everybody is waiting for MPEG DASH to be finalized.
UPDATE.
Please, notice that you always can use Siverlight application for playing SmoothStreaming. The referenced HTML5 Player framework is capable of falling back to Silverlight.
no luck for Microsoft Smooth Streaming, but regarding MPEG-DASH which is similar (see http://blog.johndeutscher.com/2013/06/10/mpeg-dash-preview-from-windows-azure-media-services):
"Dash.js is permissively licensed (under the BSD license) and can therefore be studied and reused by anyone seeking to provide their own DASH-AVC/264 compliant player. The goal is to make it easier for third-parties to build adaptive streaming video players."
http://msopentech.com/blog/2013/06/20/ms-open-tech-contributes-to-open-source-adaptive-streaming-video-player/
also see:
https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html
which is required for Dash.js
I have an .mov file that is too long to upload to YouTube. I want to put it up in essentially a YouTube player but have the video be self-hosted. Can anyone recommend an easy way to do this and make it cross-browser compatible?
Sublime Video is going to be an awesome HTML5 player someday!
A flash player is okay, flowplayer and jwplayer are usable.
Vimeo also hosts videos!
.mov just isn't that friendly for the web.
YouTube already has a HTML5 mode (which you have to opt into though) which I assume means they convert the videos themselves. It's worth checking out, but as I mentioned, each user has to opt into using the HTML5 mode so it's probably not worth it.
If you're going to host it yourself, I'd suggest converting it to OGG and MP4 (and possibly WEBM) and playing it through the MediaElementJS player.
I am a little new to embedding videos on a website. What is the best way to go about it? I just started reading up on it.
I read that I should use HTML5 and the browser's native player. -- Does anyone know of a javascript library that will use the browser's player and detect if the browser is not using HTML5 to downgrade to a flash player?
As far as encoding what is the best approach? I am planning on writing a little console app to use FFMPEG to convert the videos. But what encoding should I use? I heard H.264 is promising? But
This is what you're looking for: http://videojs.com/
Encoding wise, I think H.264 and WebM is a wise choice. That way you'll satisfy all modern browsers and mobile devices (incl. iOS and Android), and only fall back to Flash for older, pre-HTML5 browsers (and FF 3.6, which only supports Theora.)
The DIY approach would be to use the Video For Everybody embed code. That will lead with HTML5 video and fallback to flash.
Then for video encoding, you can use FFmpeg like you said.
To make your life easier, you should check out VideoJS for your HTML5 video player. It handles a lot of cross browser issues and some extra features that browsers don't support yet.
For video encoding, if you're planning to use FFmpeg specifically for automating encoding, you should check out Zencoder's video encoding API. It could save you some set up time and compatibility issues.
For codecs, #1 priority should be h.264, specifically using the baseline profile so it will work on smartphones. After that, ogg and webm are both good choices. WebM is higher quality for file size, but Ogg can be viewed by way more users because older version of Firefox support it. And just to note, if you only do h.264, the Video For Everybody code won't fallback to Flash in Firefox and Opera (that don't support h.264) so you'll need to use a player like VideoJS.
Use Handbrake for video encoding, especially for HTML 5 support.
HTML 5 is an awesome way of embedding video, however it hasn't been standardized yet. You definitely want to use it if you're supporting iOS devices, as they of course don't support Flash which is the most mainstream way of embedding video.
HTML5 is pretty awesome because this is how simple it is:
<video src="video.m4v" />
Here is a fantastic link you will find useful:
http://www.robwalshonline.com/posts/tutorial-serving-html5-video-cross-browser-including-ipad/
I read that I should use HTML5 and the
browser's native player
Which idiot told you that? Given that you will loose out on a significant portion of the client population you either run a monoculture of HTML 5 browsers, of whoever said that should be serving burgers at McDonalds, not give advice to people. HTML 5 and the integrated player are nice, but not there yet for the general public. In a couple of years, yes. Now - if I hire a web company for putting videos on a website and they do that, they get sued for gross neglect and incompetence.
Today, playback is mostly flash - that has a high penetration. A flash video player is also what sites like youtube currently use. If you go for less (penetration), Silverlight is very good and has the complete backend infrastructure.
I heard H.264 is promising?
So what? FIRST you need to fix the playback side, then you use whatever format is most efficient given your playback decision.