Video codecs. Split from "A bit of constructive critics"

Video codecs. Split from "A bit of constructive critics"

by David Scotson -
Number of replies: 17
Hi Matt, fully agree that media servers are often entirely unnecessary, sticking the video file on a server is the simplest and easiest solution (other than, putting it on Youtube, anyway).

But, the codec wars are over. I personally would have prefered Theora or VP8 to win but H.264 video with AAC audio in an MP4 container won this decisively a while ago. There's no good reason to use anything else, and putting a link to that file in a video tag solves the basic problem for almost everyone. The only tricky bit is setting up a Flash fallback for IE8 and older Firefoxes, but it's getting to the stage where even a direct file link would be a sufficient fall-back for those platforms.

Regarding handing off files from Apache, I believe Moodle can use the x-send-file-for extension for this, but Googling for some info on that support didn't really bring up anything useful. It's almost certainly in there in some form though.
Average of ratings: Useful (2)
In reply to David Scotson

Re: A bit of constructive critics

by Matt Bury -
Picture of Plugin developers

To be blunt, I think this attitude could be an example of why Moodle's multimedia handling is so poor:

"But, the codec wars are over. I personally would have prefered Theora or VP8 to win but H.264 video with AAC audio in an MP4 container won this decisively a while ago. There's no good reason to use anything else, and putting a link to that file in a video tag solves the basic problem for almost everyone. The only tricky bit is setting up a Flash fallback for IE8 and older Firefoxes, but it's getting to the stage where even a direct file link would be a sufficient fall-back for those platforms."

This is taking a "single usage scenario" and using it as justification to simply not bother with looking into what Moodlers and users actually want or need to do with multimedia. Until Moodle tackles the multimedia issue comprehensively, it will remain a mostly text based platform. This is in a world where multimedia is becoming increasingly important in education. How many potential adopters of Moodle, who'd definitely benefit from its openness and the multitude of tools available, have evaluated its multimedia capabilities and idiosyncrasies and decide to go for another LMS/VLE or platform because they see too many barriers to getting multimedia to work in the ways they want on it?

My Media Player module for Moodle 1.9 http://code.google.com/p/moodle-mplayer/ was tremendously successful because it addressed many of the issues that Moodlers faced with Moodle's built-in multimedia handling. Moodle 2.x has only added further obstacles for everything other than considerations for a "single usage scenario."

Average of ratings: Useful (2)
In reply to Matt Bury

Re: A bit of constructive critics

by David Scotson -
I'm confused by how your response applies to the section you quote.

Your link seems to suggest that your plugin only supports 2 codecs, and while it advertises iPad support, that support will only work with one of the codecs. Which happens to be the same codec I recommended, and which works in all the other scenarios too, rendering the other codec superflous, even if it didn't have lower quality/higher file size.

So are we talking about codecs, or all the other features like playlists and whatnot? Because if we're still talking about codecs then by not standardizing on the one I mention, you're just complicating matters for no gain.

I fully agree that Moodle's multimedia handling is a bit rubbish, but if anyone is planning work to make it better then it would be a very good idea to focus on getting that one codec to work well. I'd be highly surprised if any other LMS/VLE platforms are doing anything else, because outside of tightly controlled intranets*, no other codec will even work.

* and just to be clear, it's still the best choice in tightly controlled intranets.
Average of ratings: Useful (1)
In reply to David Scotson

Re: A bit of constructive critics

by Matt Bury -
Picture of Plugin developers

Hi David,

My rather harsh criticism isn't of the details but the general attitude regarding multimedia in Moodle. Something may "work" in theory according to a scenario that you've imagined or what you've experienced on your own LMS or development environment, but out there in the real world with a variety of users and usage scenarios, I can assure you that it's not that simple.

In reply to David Scotson

Re: A bit of constructive critics

by Jonas Nockert -

I don't see how Moodle could standardize on one codec/container when it is not standardized among browsers/OSs yet.

Today, to support the majority of use cases, I'm fairly sure one needs to provide at least two encodings/containers for video (h.264/mp4 and VP8/webm) to support html5 video. One also needs to provide a flash fallback player.

At the company I work for, since we started using Moodle last year, providing reliable video to students has been our biggest hurdle. Our teachers and students are, at least in some regards, free to pick their own devices so we can't standardize. To be honest, we don't really want to standardize even if it would be practical. If students love the devices they have, we believe they will participate more actively in the courses we provide and thus, in the end, learn more.

Eventually, I felt I had little choice but to create a video plugin for local files. It uses Videojs for playback and lets teachers quite easily provide multiple format videos with flash fallback. Now, it can't transcode from, say, h.264 to VP8 but from reading this discussion, I can see that being a huge improvement.

From my experience, standardize on an html5 video player with flash fallback rather than a format. The number of variations and issues with different devices and browsers are huge.

In reply to Jonas Nockert

Re: A bit of constructive critics

by David Scotson -
Hi Jonas,

standardizing on H.264 will work on any device your students or teachers choose to use. That's why I'm recommending it, it's a single codec with as close to 100% support as you'll ever get. The browsers that don't play it natively (notably IE8 and Firefox on XP) can play the exact same file with Flash.

There is nothing you can do to make "providing multiple format videos" easy, it's a fundamentally difficult task to produce multiple copies of a video, which 9 times out of 10 will already be in H.264 format. And when it's not necessary to do something tricky, you shouldn't really try. This is a thread about user interfaces after all, and asking a user to create and upload two (or three) files when the extra files don't actually provide any benefit is not a good user interface. Even if they ignore the advice, it adds worry and complexity to the process.
Average of ratings: Useful (2)
In reply to David Scotson

Re: A bit of constructive critics

by Matt Bury -
Picture of Plugin developers

Hi David,

In HTML5, for regular, "vanilla" video and audio playback, it's easy to provide multiple media files and let the browser select the media container that it supports with the source tag. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/source and Flowplayer's docs: http://flowplayer.org/docs/#multiple-formats

Similarly, Flash supports multiple files, streams, resolutions, capture, etc.

BTW, it's not just about playing back files from a server. There's a variety of different use cases that require different protocols and types of interaction between the client and server; think of web conferencing, media capture, syncronised playback, bandwidth detection and adjustments, etc.

With playlists, users sometimes want to display combinations of mixed media; still images/slides, video, audio, and animations. Moodle doesn't currently support playlist formats such as SMIL XML, MPEG7, ASX, M3U, and many others. I still come across Moodle 3rd party sites with multiple video players embedded on the same page which is a sure fire recipe for browser crashes and/or horrible user experiences

Don't get me started on something as useful in education as captioning!

For a few simple demos, see: http://matbury.com/strobe/

In reply to Matt Bury

Re: A bit of constructive critics

by David Scotson -
Hi Matt,

You missed my meaning when I described this as complicated, it's not the HTML that's tricky. I meant that if a teacher or lecturer came to you with a video they took on their camera, what would your simple instructions be for providing it in multiple media formats?

I don't think any such simple instructions exist, because it's a fundamentally hard task. And asking people to complete a hard task, particularly a task that provides no benefit to them or their students, isn't really helpful if you're trying to get them excited about the potential benefits of video in education.

Your other examples are all fundamentally hard too, and would be made harder still if you're really expecting people to e.g. provide the playlists in multiple codecs. I think you'll find people get much more excited about things like captions when you make it easy for them.

Talking of getting excited about captions, are you aware that Youtube will let you upload a transcript of a video and then it'll use speech recognition technology to automatically match up the subtitles to the relevant part of the video? That's pretty cool. Youtube is my real first answer when anyone asks about video in Moodle, it does almost all the complicated stuff for you, it even makes the video available in VP8 as well as H.264 and will convert from basically any input file format so makes it all pretty easy as well. But privacy is a big thing for certain topics so Moodle really needs something for those cases too.
In reply to David Scotson

Re: A bit of constructive critics

by Matt Bury -
Picture of Plugin developers

Hi David,

In many cases, organisations that produce their own videos do so with DSLR cameras or (semi) pro video cameras. The rushes will be in a high bit-rate, usually proprietary media container and CODEC. They already have the desktop software to edit together the rushes, author and apply titles, captions, credits, effects, etc. (e.g. Premiere + After Effects, Vegas, Lightworks, or Final Cut). They sometimes have dedicated compression software (e.g. Sorenson) and so can output to a variety of formats and resolutions at optimum levels of compression.

On a less involved level, tutors may record videos with a DSLR or consumer digital camera, convert the video file with consumer software and upload it to Moodle. It's not that difficult to find software that'll output to a variety of formats.

OK, so it's easy to produce decent quality video in a range of resolutions and formats. How easy is it to embed those resolutions and formats in Moodle pages and get them to behave in the way you want to? After discovering the rather limited options built into Moodle, they then try direct embedding with HTML, JS, and Flash... and we all know what Moodle tends to do with users' HTML, JS, and Flash embed code, don't we? (It's not actually possible for users to input W3C compliant and best practices Flash embed code in Moodle. I learned this from developing the SWF Activity Module for Moodle 2.5).

So what advice are you going to give them about using video in Moodle?

A note on transcoding, i.e. decompressing from one highly lossy compressed video file and applying a different lossy compression algorithm to compress it again... if you've done much of it, you'll know that the results can be very poor; artefacts, skipped and/or garbled frames, muffled audio, unreadable rendered text, etc. In other words, a very poor UX.

Average of ratings: Useful (1)
In reply to Matt Bury

Re: A bit of constructive critics

by David Scotson -
Hi Matt,

It looks like we're going to have to agree to disagree. You keep describing things that in my opinion (although I personally can do them) are not simple, and then claiming they're simple e.g.

"It's not that difficult to find software that'll output to a variety of formats." and
"OK, so it's easy to produce decent quality video in a range of resolutions and formats."

I simply can't agree with those statements, and think the paragraph that precedes them would scare off most users of Moodle, even most users of video in Moodle, so we're clearly going to disagree about anything else that starts from that assumption. Just using the phrase "rushes" places you in a different category from these users, never mind the technical stuff.

I want users to be able to easily upload a single H.264 video file and have it viewable everywhere. I have veteran ITN and BBC cameramen in the next office and it's all they really need too. Everything else is a bonus, and should be added in a way that doesn't make the basic stuff harder or more confusing. Possibly in a completely different activity module if the two use cases diverge sufficiently.

On transcoding, H.264 (and AAC for audio) is a good enough codec that you can make visually/audibly lossless conversions of any other format, even if you use a sub-optimal encoder. Certainly anyone capable of using the tools you mention in your first paragraph will have no problem, and I'd assume it would "just work" for most other people too. One step of conversion just isn't enough to make a noticeable difference when the output format is H.264 (or similarly advanced).

Look at Youtube, which isn't exactly renowned for its video quality, since it aims for broad access instead. Everything uploaded there goes through an extra encode step, and it's got video from all sorts of crazy sources (old phone cams, digitized VHS, people filming their televisions with tablet cameras) but generally if it's noticeably poor quality it's because the original was poor quality, not anything to do with the conversion Youtube does.

But, even assuming that wasn't true, what's the alternative? Putting the original MPEG-2, WMV or whatever file on the internet? It's simply not going to work. And suggesting people provide versions in multiple codecs, and multiple sizes seems to contradict warnings about conversion losses.

This conversation has gone in all sorts of directions. My original aim was to simplify life for people worried about what codec to use, with the good news that you only need one. Pushing the boundaries of tech is always going to be exciting for those that are enthusiastic about it, but some people just want to get a simple task done. We need to be careful we don't scare them off with the stuff that we find interesting.
In reply to David Scotson

Re: A bit of constructive critics

by Matt Bury -
Picture of Plugin developers
  • Re: transcoding, h.264 is not a lossless CODEC, it's very lossy, and mixing between different CODECs is even more lossy and prone to artefacts.
  • If the source file was encoded at a high bitrate, you can "get away with it" but many consumer level video recording devices record at low bitrates, using other CODECs because the licensing terms and/or the practical application of the encoding are cheaper and/or more convenient for the manufacturers.
  • Youtube is simply not an option for many users: e.g. it's blocked in China, Youtube applies and enforces US copyrights (DMCA "take-downs") even in countries where those don't apply.
  • In effect what you're saying is, "We don't do anything but the simplest, easiest to implement case scenarios so if you want to do anything else, go and get it somewhere else."
  • Moodle's video options may be sufficient for you and your colleagues and their particular needs. Can you be sure that they're the same as the other 83,000+ sites and 70+ million users?

Moodle forums may also be misleading and unrepresentative in terms of reflecting usage scenarios. Pro and semi pro video producers and IT staff may never post any questions since they can often answer them themselves and simply move on to another solution. From my understanding it would appear that the "common knowledge" among seasoned Moodlers is that to do anything that isn't very basic with video means finding solutions outside of Moodle, i.e. look for 3rd party services, plugins, and/or integrations or use another platform entirely.

Here's one of the more commonly sought applications for online video in academic settings that Moodle makes particularly awkward and difficult to implement: http://opencast.org/matterhorn/ At the moment, many university faculty find it easier to go elsewhere or to simply dump a collection of video files, transcripts, and PPT files for each lecture for learners to download and view on their desktops (That would be the awkward bit as learners try to simultaneously manually synchronise slides, transcripts, and the video playhead.

Average of ratings: Useful (1)
In reply to David Scotson

Re: A bit of constructive critics

by Jonas Nockert -

Hi David, I think we might be seeing this from two different angles.

From my perspective, not all browsers today come with Flash installed and the flash fallback fails, which is a problem. For example, using the latest OS X and latest Firefox (24.0), It doesn't have h.264 support (see attached screenshot from http://html5test.com/) and it doesn't have Flash. In most cases, I'm sure one could ask people to install Flash but then video doesn't just work for them.

I agree that transcoding is not easy (unless automated) but already having multiple format videos then it's quite easy to add them using a file area (as opposed to, say, having to work around multimedia filters and sanitization filters when entering the whole thing with flash fallback as html).

In our case, we have specialists that handle videos for our teachers so encoding in multiple formats is not as much of a problem for us as it might be for someone else.

 

Attachment Screen Shot 2013-09-26 at 4.40.03 PM.png
In reply to Jonas Nockert

Re: A bit of constructive critics

by David Scotson -
Note that they're working on changing this:

https://bugzilla.mozilla.org/show_bug.cgi?id=851290

Though they have no solution planned for XP. There Firefox users, like Firefox users on Mac OS X today and IE8 users, still need Flash.

And I really would suggest you just help them to install Flash. Even today, quite a lot of the internet doesn't work if you don't have Flash, especially the educational bits. Even things that work on iOS devices without Flash are likely to fail if your desktop browser has no Flash.
In reply to David Scotson

Re: A bit of constructive critics

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi David

When you say:
> Even today, quite a lot of the internet doesn't work if you don't have Flash,

You mean the _web_, right? I do lot of things in the Internet without Flash.
In reply to Visvanath Ratnaweera

Re: A bit of constructive critics

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

I recently tried a new version of some software that dropped the old outdated so last millennium .swf file format and offered shiny new some other format.  Which didn't work on most of the machines where I work and where I have no control or influence on what is installed. Fortunately video is not essential to what I do.

 

In reply to David Scotson

Re: A bit of constructive critics

by Stuart Lamour -
Picture of Plugin developers

mozilla made an html5 flash player.

http://mozilla.github.io/shumway/

lots of chrome devs tweeting about this right now.

that interweb hey!

bonkers...

In reply to Stuart Lamour

Re: A bit of constructive critics

by Matt Bury -
Picture of Plugin developers

Hi Stuart,

Thanks for sharing! That's an interesting project. I tried it out and poked around a bit: It's actually a JavaScript based Flash Player. It parses ActionScript Block Code (ABC) and tries to run it as if it's JavaScript. I can see this working up to a point but it'll take some interesting workarounds to address some of the shortcomings of JavaScript compared to ActionScript: namespaces, datatypes, encapsulation, strong typing, etc.

There's a nice article on cross-compiling AS to JS here: https://blogs.adobe.com/bparadie/2011/11/21/cross-compiling-actionscript-to-javascript/

Announcing an alternative way to present multimedia in Moodle: https://github.com/matbury/mod_revealjs

Demo: http://m2.matbury.com/course/view.php?id=7

When/If it's approved, it'll also be here: https://moodle.org/plugins/view.php?plugin=mod_revealjs

This gives you all the options you need to provide different formats for different OS' and browsers. It also uses the File System repo so FTP uploads only but with the advantage that you can compose and view presentations offline on your favourite HTML editor, upload them directly with all the dependent media files (which can easily run into hundreds for some presentations) with your favourite FTP client and then just deploy them in whichever courses you want. Hot-linking and iframes are also supported.

Feedback welcome! smile