HTML 5 <video> tag vs Flash video. What are the pros and cons?

FlashVideoHtml

Flash Problem Overview


IMPORTANT UPDATE

This question was made over 9 years ago. It made sense then, it doesn't make it now. Flash is hard on its way out; <video> support is ubiquitous, including mobile devices. Almost anything that Flash could do, HTML can now do too. HTML won, Flash lost. If you're pondering on how to embed video in your page, just use <video> and don't give it a second thought. This question is only preserved for historical value.

Original question

Seems like the new <video> tag is all the hype these days, especially since Firefox now supports it. News of this are popping up in blogs all over the place, and everyone seems to be excited. But what about?

As much as I searched I could not find anything that would make it better than the good old Flash video. In fact, I see only problems with it:

  • It will still be some time before all the browsers start supporting it, and much more time before most people upgrade;
  • Flash is available already and everyone has it;
  • You can couple Flash with whatever fancy UI you want for controlling the playback. I gather that the

The only two pros for a <video> tag that I can see are:

  • It is more "semantic" - which probably holds no importance to a whole lot of people, including me;
  • It is not dependent on a single commercial 3rd party entity (Adobe) - which I also don't see as a compelling reason to switch, because free players and video converters are already available, and Adobe is not hindering the whole process in any way (it's not in their interests even).

So... what's the big deal?

Added:

OK, so there is one more Pro... maybe. Support for mobile devices. Hard to say though. A number of thoughts race through my head about the subject:

  • How many mobile devices are actually able to decode video at a decent speed anyway, Flash or otherwise?
  • How long until mainstream mobile devices get the <video> support? Even if it is available through updates, how many people actually do that?
  • How many people watch videos on web pages on their mobile phones at all?

As for the semantics part - I understand that search engines might be able to detect videos better now, but... what will they do with them anyway? OK, so they know that there is a video in the page. And? They can't index a video! I'd like some more arguments here.

Added:

Just thought of another Cons. This opens up a whole new area of cross-browser incompatibility. HTML and CSS is quite messy already in this aspect. Flash at least is the same everywhere. But it's enough for at least one major browser vendor to decide against the <video> tag (can anyone say "Internet Explorer"?) and we have a nice new area of hell to explore.

Added:

A Pro just came in. More competition = more innovation. That's true. Giving Adobe more competition will probably force them to improve Flash in areas it has been lacking so far. Linux seems to be a weak spot for it, cited by many.

Flash Solutions


Solution 1 - Flash

Imagine if there was no img tag. If you want images, you have to use a 3rd party plugin, that is really slow and has no standard way to embed it in a page. You can't easily copy images in this way, and search engines basically have no clue what if it's an image or a game or anything.

Without this, no images were available.

Then imagine that a browser was released that just let you use this fancy new img tag.

The video (and audio) tag are a logical sensible way for things to work. We shouldn't need a third party plugin to use a completely standard media format.

Solution 2 - Flash

The biggest benefit of <video>? It's easy. Crazy easy. Ridiculously easy. Your-grandma-can-code-a-video-tag easy. <video src="myfile.ogv"></video> and you're done.

<video> also has clear benefits for your users. They get a browser-native video player, which can potentially be very efficient. They get a consistent UI that won't change from site to site. Mobile browsers that may not implement flash can still implement <video>.

The only con is a temporary one, and that is compatibility. IE8 doesn't support <video>, and it will be some time before IE9 is widely installed. As well, there's some fight over which codecs to support for the videos - Firefox, Chrome, and Opera all support both Ogg Theora and WebM, while Safari and IE are shipping H.264 (though either can support Theora/WebM with proper codecs). For now, this just means that you have to post your video in two formats and provide them both with the source element, i.e.:


<video>
<source src='video.webm' type='video/webm'>
<source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
</video>

To add support for IE 8 and earlier, and other downlevel clients (like older versions of FF/Safari/Opera/etc), just put your standard video embed code inside the <video> tag, below the <source> elements. If the browser supports <video>, it'll ignore the embed. If it doesn't, it'll ignore the <video> and run the embed instead.

Solution 3 - Flash

Flash is slow and inefficient on non-Windows platforms. It has potential security flaws. It stores "flash cookies" on your computer that you don't know about. There is no flash on the iPhone and unlikely ever will be (as a result of its being proprietary and its high CPU consumption).

HTML 5: Could it kill Flash and Silverlight? is an article that might answer your question.

There are probably more reasons out there.

Solution 4 - Flash

There are many good points here, and like a Martial Arts fighting style, each point has its thrust, and each can be defended; but each can be defeated with the proper moves.

Anyone standing on arguments about "propietary" plugins will fall quickly. Microsoft, Apple, and Adobe all bear the guilt, but that's just BUSINESS. You won't change business overnight, and each layer of complexity added by a new tag such as <video> which supports a very technical interface will result in * slightly * different implementations by each browser.

HTML 5 works now, and so does Flash. How it is implemented, the skill it requires- this defines each resource, whether it's an employee's performance, a webmaster's power, or a domain's influence.

Although I'm only 40, I began programming when orange or green monochrome monitors were the color choice, and hardware installation came with prayer books instead of instruction manuals. Maybe you could figure out AT commands for the modem when it wouldn't configure with your hardware, and 64K RAM was like, WOWWWWW!

HTML 5/Flash is a minor nuisance compared to that crap. Let's all learn how to collaborate in community toward a better resource. There is an Open Source Flash Project, it will have bugs. So will HTML 5...

Every argument here is true, but not necessarily productive. Use that energy toward a solution.

Solution 5 - Flash

Flash is a real headache on non-Windows platforms. Not only is it slow and inefficient (as someone else pointed out), but it isn't very stable, either. As we learned at the most recent Apple WWDC, "browser plugins" (read: Flash) account for the majority of all application crashes across all of Mac OS X (and by "majority", I mean some absurdly high number like 80% or something, can't remember the exact figure offhand). This is such a problem on Mac OS X that for Snow Leopard, Apple has re-engineered Safari so that Flash runs, not just sandboxed, but in fact as an entirely separate process, so that when (not if) Flash crashes, Safari as a whole remains unaffected.

The instability of Flash on OS X, coupled with its poor performance, is why...

  • ...Flash is not now, nor unlikely to be soon, available for the iPhone. I disagree with the premise that people don't want to watch video on their mobile devices -- this is why Apple made a special arrangement for YouTube to serve their content in h.264 for the purposes of allowing it to play on the iPhone. I, for one, happily paid the $10 for MLB 2009 exactly because I could watch video on my iPhone, and if they made every game available for live viewing, I'd pay much much more.
  • ...so many Mac OS X users (like me) are installing Flash blockers for their browsers. By my choice, Flash content no longer even loads in my browser without my explicit permission. Since installing it, my CPU usage has dropped considerably, and my browser crashes have basically gone away. This is great news for me, of course, but it's bad news for any advertisers hoping to serve me Flash-based ads.

As far as users having to know anything about codecs is concerned, you can avoid this issue and serve them the appropriate codec (including Flash, if their browser doesn't support OGG or h.264) by using the simple non-Javascript html code found in this article.

Solution 6 - Flash

Pros:

  1. You can easily use the without using javascript.
  • Doesn't need a proprietary plug-in
  • Is platform-independent while flash is not (see nr. 2)
  • Using it will encourage other browser vendors to implement it (read as IE)
  • The
  • Comes built into the browser.
  • No vendor lockin

Cons:

  1. It's a part of an unfinished standard.
  • A very small percentage of installed browsers support it <-- not an issue (See pro nr. 1)
  • Browser vendors have yet to agree on a standard codec <-- not an issue either, see link in nr. 1)

Solution 7 - Flash

It's also an advantage the video-tag is native to html, so it integrates nicely. This sounds like a non-issue, but it's not. You can for example overlay the video with some HTML caption. And the HTML caption can use the same styles as other captions on the same page.

You also can apply some (future) CSS transitions to the video element: look at this demo.

Solution 8 - Flash

For me, it'd be very nice to have the computer built-in or another third party player play the video much more efficient than Flash can do. Not all platforms have Flash: iPhone and Android (for now at least), where the

Regarding the Internet being more semantic, it may be important to you. I'm not sure how search engines likes Google and Bing find videos but probably they just know about a bunch of Flash video implementations, so third party small players have no chance. If we are all using the same standard tag, then everybody is on a level playing field.

Solution 9 - Flash

Adobe's Flash player (being a plugin) does not take any of the browser's privacy settings into account, while Adobe is not actively making clear to normal users what is being stored. This alone is a good reason to stop using Flash (or any video plugin) and welcome <video>.

Some details about the privacy issues (not to be confused with security issues or vulnerabilities) can be found at How to automatically remove Flash history trail? on Super User.

Like Vilx noted in the comments: these privacy issues remain when replacing Flash-video by <video>, as Flash is used in many more ways. Still, once <video> is supported then site owners who offer video (and don't use Flash in any other way) will have a choice not to burden their visitors with this poorly documented record of visited Flash-sites.

(EDIT: I replaced the details with a link to SU, which gives some more insight; some of the comments below will only make sense with respect to a previous revision.)

Solution 10 - Flash

Pros:

  • Ogg/Theora/Vorbis is royalty-free for all parties is the chain (the H.264 grace period for hosting H.264 ends at the end of 2015 and encoding and decoding are already subject to royalty)
  • Once fallback for IE is no longer necessary, <video> will be easier than Flash
  • No need for the plug-in prison—browser vendors can fix their own bugs
  • Integrates with CSS effects
  • Integrates with SVG effects
  • Integrates with JavaScript
  • Can be ported to any platform without permission from Adobe
  • User can save the video to disk easily
  • Can be made work safely in syndication feeds (but software not ready yet)

Cons:

  • IE support for the video element has to wait until IE9; current IE-compatible Ogg fallback renderer relies on Java until the ActiveX solution or the Silverlight solution is finalized
  • Safari needs XiphQT to play Ogg, because Apple hasn't shipped Theora.
  • Royalty-encumbered format needed with the iPhone (but no worse than Flash)
  • Can't go full-screen in every desktop implementation shipping today

Solution 11 - Flash

64 bit, and Linux support will be nice. Flash still (in two thousand freaking nine) lacks in this area. Just having some real competition is always good. If the major video sites start using this along side Flash, or even in place of Flash; That will be one less proprietary program I will need. Open source means faster innovation. Give it time, people will create a way to deliver DRM protected videos with it.

Solution 12 - Flash

More pros for Flash:

  • Adobe can add new features and new codecs to video a lot quicker to a mass audience (generally under a year over 90% of users upgrade to the latest version of Flash) compared to browser vendors (there's still a large number of IE6 users out there and that browser came out in 2001).

  • Features found in Flash that I imagine will eventually make it to browsers but are not there yet:

    • full screen video (there's a Firefox add-on that supports this but none of the browser do natively yet)
    • video cam, only a small number of websites use this, but there's some really cool stuff happening these days with the video cam and augmented reality in Flash
    • peer-to-peer video, was just added in Flash Player 10 and as the penetration of Flash 10 is getting close to 90%, I think you will see more

As those who say Flash is not indexable, check out what Google has been doing lately with indexing Flash content thanks to a headless player Adobe has supplied. So if you do a google search for FLV files, you can see that Google already indexes Flash video files.

Meanwhile, Adobe Premiere CS4 has speech recognition that will output subtitles for video files in an XML format that can be easily used in Flash video. So expect video for Flash to become a lot more searchable in the future.

Solution 13 - Flash

  1. Many Mobile Devices support

  2. Mozilla Firefox, Google Chrome, Apple Safari, and Opera all support the

Solution 14 - Flash

  • The user has control of the UI: they can choose which browser they would like to download and use, and depending on how it works(I'm not sure of the details, but I'm familiar with the concept), even keep their browser and just choose the handler npapi plugin for it. How many times have you been stuck using a shitty actionscript video control interface because the devs of the site you're on were too lazy to do it right (or use flowplayer). Power to the users!, I say.

  • Its open source. Now, i'm not RMS or anything, and its nothing to do with ethics or anything else like that, but OSS is just the more efficient, better way to go. It produces better code.

  • Better platform support. Right now, Linux + flash = bad. Adobe's the only one who can do anything about it. This sucks.

  • like you said, more semantic.

Solution 15 - Flash

Seth got most of the big ones. Others I can think of:

  • the size of the test matrix blows up (I saw one bug occur only on IE7 with Flash 9.0.48 -- how many minor versions of Flash do you want to test with each browser?)
    • Even if you were to pick only one exact version to support, and force everybody else to upgrade/downgrade, it's not true that "Flash is the same everywhere": the "Flash plugin for IE" and "Flash plugin for everybody else" aren't even the same binary (and yes, it matters: they access the network in different ways, which was part of the cause of my IE7/F9 bug)
  • everybody writes their own player so UI and reliability are inconsistent
  • browsers are allowed to implement a full-screen option for HTML5 video, which means they all will soon if they don't already (many Flash video players have this but many don't)
  • no, not everybody has Flash (granted, it's more common than HTML5 video right now, but it's not all happy candy fun land)
  • scripting is a huge pain (has its own DOM, events, not-quite-ECMAscript language, etc.)
  • it has abysmal performance, if you're not on Windows (running it in a Windows virtual machine under Mac OS X uses 5-10x less CPU than running the native Mac plugin)
  • it has lousy stability (every browser crash I've seen in at least 3 years has been on a Flash page; if your video kills their whole browser, they're not coming back, even if it's really Adobe's fault)
  • it doesn't run at all in many places, e.g., in a 64-bit process (if your users happen to launch "Internet Explorer (64-bit)" instead of "Internet Explorer" by mistake, poof, no video)

In short, the only reason to use Flash is "most people have it installed today" -- which can be a pretty good reason, as long as it lasts.

Solution 16 - Flash

Since now the browser gets the video file via regular HTTP, as compared to some obscure method defined in the SWF file (which would need to be parsed), you can now have web proxies that can also cache video files! As well as have the very browser be able to cache a video file.

Solution 17 - Flash

HTML5 Pros:

  1. It supports whole new DOM API for video objects, you can write script which can interact with new HTML5 tags.
  2. You can detect different video format support play, pause, and track video playback.
  3. Its already well supported. Firefox, opera, chrome already support chrome, video , etc... Even youtube is testing some HTML5 player.

Flash Pros/ HTML5 Cons:

  1. Flash is there everywhere. So HTML5 will take lot and lots of time to catch up.
  2. Flash support extensive features, let it be HW rendering, high definition video supports, Animation features it supports are simply irreplaceable(?)
  3. DOM API would never replace AS2/AS3 feature already supported by flash.
  4. Just count the number of professional flash developers out there... they will never switch unless HTML5 answers all their questions. There are number of flash developers who haven't switched from AS2 to AS3 yet :-)

Solution 18 - Flash

Here's my pros of HTML 5 in 2012:

  1. I'm using the HTML5 trail of youtube. Now flash player doesn't crash all the time. Now my computer is stable for weeks. Now I'm happier.
  2. I don't see an "update HTML5 player" whenever I reboot my computer like I do with flash.
  3. Once embedded video everywhere works with HTML 5, I can remove flash from my computer because the only use I had for it was to play videos.
  4. This is a pro for website developers: I have a flashblocker because of how annoying flash is. I don't have an HTML5 blocker. Webmasters have a second chance to send me content.
  5. HTML5 will likely be implemented properly on browsers instead of being the #1 security hole on most computers.

Solution 19 - Flash

My belief for pros:

  • It's catching the HTML standard up to the current practical uses of the web.
  • It seems like it would be easier/better to get mobile devices to support the video/audio tag rather than porting Flash to the devices.
  • Ogg is an open standard, while Adobe controls Flash.
  • I've already seen in some places people putting up solutions to have a fall through, meaning if your browser doesn't support video/audio tags, it will use flash.
  • Easier interaction with standard HTML elements and javascript.

My biggest con would be that Ogg is a bit behind in terms of compression and quality. But I would imagine it's being worked on. More importantly, if more people start adopting it, more people will likely join the the work on Ogg to make it better.

Competition is key as well, as there is no major player forcing Adobe to really do anything with Flash. So Adobe can control the market in terms of video content on the web.

Solution 20 - Flash

You can use Flash today... it's the most realistic way to reach full-sized audiences.

(FD: I work for Adobe)

Solution 21 - Flash

I believe this will demolish Flash, as an open source standard support on iphone and android and other mobile handsets can be rapidly implemented as well as desktop OS support. The OGG format allows me to skip forward in the video file over a regular http connection. I can right click and save the file if allowed, sharing and transporting these files will be easier. As 'proper' markup it can be navigated by the literally 100's of thousands of users using specializad devices to access the Internet. As a 'proper' dom element it can communicate with javascript allowing it to fully interact with the rest of the page content, and finally, Microsoft have a track record of pretending to ignore upcoming standards while promoting their proprietary solution, as user demand peaks they throw the rudder full right and roll out an implementation to secure their user base. Flash has been the only choice for video on the web, but not for much longer, its an excellent piece of software in its own right and I see it holding some position, but for video it's only ever been an 'only choice' runner.

Solution 22 - Flash

I would say the definite pro of using <video> instead of Flash is that I will be able to watch videos in my browser without having it crash or go crazy slow. I use 64bit OpenBSD, so gnash is all I can get and I only enable it when I'm feeling really risky because most of the time I'll come across a flash banner ad and my browser(firefox 3.5) will crash.

And my mobile phone browser doesn't support flash, yet it supports the video tag(and it's not an overly "fancy" phone either).

Solution 23 - Flash

Regarding this point:

"As for the semantics part - I understand that search engines might be able to detect videos better now, but... what will they do with them anyway? OK, so they know that there is a video in the page. And? They can't index a video! I'd like some more arguments here."

if optimized properly, a video will include a transcript, which a search engine can read, and correspondingly divulge all of the information about the video. I guess they can index the video's page? as for the value of it...i guess i won't have to watch crap I don't need, to find something I need, bcz I will know exactly what's in the video

Solution 24 - Flash

My understanding is that the big deal about the

The excitement is all at that level, not down in the implementation details. Worrying about which is technically superior is sort of beside the point in the same way as concerning yourself about a fascist government's ability to make the trains run on time would be.

Solution 25 - Flash

It will be nice to use some of the HTML 5 features... in 5-10 years from now...

We still have too many visitors using Internet Explorer 6 to ignore them, it will be quite some time before we can even move on to only testing the pages for IE7+...

Solution 26 - Flash

One Con is the fact that the current html 5 spec has not been able to agree on a single codec due to browser vendor dissagreement.

From the article below:

> "After an inordinate amount of discussions, both in public and privately, on the situation regarding codecs for

Browser vendor squabble

Ultimately, even if you do use the video tag, your video codec may not be supported in all browsers, even if they do support the tag.

As others have mentioned, this may not pose any real issue, but I believe having to make multiple versions of the same file available certainly negative.

Solution 27 - Flash

I think the large majority of these answers condense to this: Flash is engineered mostly for the mass market, so it provides the easiest way to cover the bulk of the market, but it is deficient in covering less common and emerging platforms (i.e. shaky Linux and no iPhone). This has been the story with Flash pretty much from day one. It's practically a case study of how proprietary and OS software differ (and complement each other).

On the other hand, I think most answers are seriously underplaying the codec angle. There is one primary reason why Flash video dominates the web today: it's the only way to publish a single version of a video and expect it to be viewable by more than about half your audience. Even though the video tag looks to be designed well, as far as matching up multiple source files to the user's installed codecs, it's still difficult to know how many codecs are needed to cover what percentage of an audience, and impossible to know whether people will upgrade as new codecs emerge. Flash video has more known quantities, and a reasonably good expectation of upgrades for the large bulk of the audience.

I also kind of think that the performance angle is overstated in most answers, as well. It's true that Flash uses more CPU than any other player I have, but it also starts up more quickly - by orders of magnitude. When I come across a web page with an embedded MPG, my browser is frozen for 15+ seconds while QuickTime boots, or perhaps only 5 seconds if it was already running. (Almost as bad as PDF ;) ) Obviously Flash is less efficient in some ways, but from where I stand it's more efficient in others; like any software solution tradeoffs are involved.

Solution 28 - Flash

I've been reading around this recently for a site I'm building now. I've gone with Flash video for now, because the launch is pretty soon. Also, we're on a shared hosting environment, so all video conversion has to be done before the video is uploaded. I don't want to ask the client to upload two versions of each video.

But, ultimately, I do want to switch to open video. It looks pretty cool. I've seen a demo which uses javascript to overlay subtitles on a video, degrading gracefully in the absence of javascript to a text transcript below the video. (I think that was on A List Apart.) And Mozilla have some fun demos up. http://arstechnica.com/open-source/news/2009/05/google-dailymotion-endorse-html-5-and-standards-based-video.ars

Solution 29 - Flash

Flash is controlled by a single company. That company can decide exactly what to do with the future of Flash and nobody else can affect it. Let's say, for example, that they (Adobe) suddenly decide charging a license fee for using Flash. What would happen to all the millions of web sites depending on it?

We need taking action, and that is now. We must use open standards, and we do need it badly. That's the only thing that makes the

(Licensing fee for Flash might or might not seem like a realistic move from Adobe, but that does not matter. My point is that they are in control. Another thing that could happen is that Adobe decide to cancel Flash. Imagine what would happen then, if there were no

Solution 30 - Flash

Current state of Flash is:

Flash Desktop platforms:

  • IE
  • Microsoft Edge
  • Safari (Mac)
  • Chrome
  • FF
  • Opera

Mobile browsers:

  • No

So you can't use Flash video on mobile browsers because Flash Player is not pre-installed by default.

Optimal way - using HTML5 video with Flash fallback for those browsers where HTML5 video is not supported.

Solution 31 - Flash

No one seems to have addressed the pure technical specs. According to "A study of video performance analysis between Flash video and HTML 5 video" [1].

"Streaming video with Flash video using wired network is the best way to have a high video FPS and less CPU usage." It also breaks it down per type of connection and computer.

[1]

Ilias, I. S. H. C., Munisamy, S. B., & Rahman, N. A. A. (2013, January). A study of video performance analysis between Flash video and HTML 5 video. In Proceedings of the 7th International Conference on Ubiquitous Information Management and Communication (p. 30). ACM.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVilx-View Question on Stackoverflow
Solution 1 - FlashRich BradshawView Answer on Stackoverflow
Solution 2 - FlashXanthirView Answer on Stackoverflow
Solution 3 - FlashSeth JohnsonView Answer on Stackoverflow
Solution 4 - FlashMax BellasysView Answer on Stackoverflow
Solution 5 - FlashAlex BassonView Answer on Stackoverflow
Solution 6 - FlashhannsonView Answer on Stackoverflow
Solution 7 - FlashdoekmanView Answer on Stackoverflow
Solution 8 - FlashpupenoView Answer on Stackoverflow
Solution 9 - FlashArjanView Answer on Stackoverflow
Solution 10 - FlashhsivonenView Answer on Stackoverflow
Solution 11 - FlashNULLView Answer on Stackoverflow
Solution 12 - FlashMatthew FabbView Answer on Stackoverflow
Solution 13 - FlashJustin HaygoodView Answer on Stackoverflow
Solution 14 - FlashJoeView Answer on Stackoverflow
Solution 15 - FlashKenView Answer on Stackoverflow
Solution 16 - FlashPaggasView Answer on Stackoverflow
Solution 17 - FlashPuttarajuView Answer on Stackoverflow
Solution 18 - FlashJJCJView Answer on Stackoverflow
Solution 19 - FlashBenView Answer on Stackoverflow
Solution 20 - FlashJohn DowdellView Answer on Stackoverflow
Solution 21 - FlashtudorView Answer on Stackoverflow
Solution 22 - FlashEarlzView Answer on Stackoverflow
Solution 23 - FlashRonView Answer on Stackoverflow
Solution 24 - FlashT.E.D.View Answer on Stackoverflow
Solution 25 - FlashGuffaView Answer on Stackoverflow
Solution 26 - FlashDarien FordView Answer on Stackoverflow
Solution 27 - FlashfenomasView Answer on Stackoverflow
Solution 28 - FlashTRiGView Answer on Stackoverflow
Solution 29 - FlashJohanView Answer on Stackoverflow
Solution 30 - FlasheeKat88View Answer on Stackoverflow
Solution 31 - Flashjohn ktejikView Answer on Stackoverflow