Frage

Ich bin ein wenig neu zu Einbetten von Videos auf einer Website. Was ist der beste Weg, um darüber zu gehen? Ich habe gerade angefangen auf es zu lesen auf.

las ich, dass ich HTML5 und der Browser des einheimischen Spieler verwenden soll. - Kennt jemand eine JavaScript-Bibliothek, die den Browser des Spieler und erkennen, ob der Browser HTML5 Herabstufung auf einen Flash-Player

verwendet wird, nicht verwenden

Was kodieren, was ist der beste Ansatz? Ich plane eine kleine Konsolenanwendung auf dem Schreiben FFMPEG zu verwenden, um die Videos zu konvertieren. Aber was Codierung soll ich verwenden? Ich habe gehört, H.264 verspricht? Aber

War es hilfreich?

Lösung

Dies ist, was Sie suchen: http://videojs.com/

Encoding klug, ich denke, H.264 und WebM ist eine kluge Wahl. Auf diese Weise werden Sie mit allen modernen Browsern und mobilen Geräten erfüllen (inkl. IOS und Android) und fallen nur für ältere auf Flash zurück, Pre-HTML5-Browser (und FF 3.6, die Theora nur unterstützt.)

Andere Tipps

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/

Downgrading is easy ...

<video ... > your browser does not support html5 video </video>

Place the downgrade code in between the opening and closing of the video tags ... non html5 browsers will ignore the video tag and render the flash or any html code between the opening and closing video tags. HTML5 browsers will render the video and ignore the html code.

This feature can also be used to let people know about chromeframe http://wsmithdesign.wordpress.com/2010/10/03/using-html5-video-tag-with-ie8/ which works with IE 6-8 and allows them to use HTML5 video.

Video format is still a problem; not all browsers support mp4, not all browsers support ogv.

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top