• Our new ticketing site is now live! Using either this or the original site (both powered by TrainSplit) helps support the running of the forum with every ticket purchase! Find out more and ask any questions/give us feedback in this thread!

Problems with video codecs

Status
Not open for further replies.

plugwash

Established Member
Joined
29 May 2015
Messages
1,990
Video codecs on the web are a mess, you have h.264 which is pushed by the media industry, but there are patent licensing issues which mean firefox does not support it. Then you have VP9 (aka webm), created and pushed by google which apple refuse to support.

The net result is if you want to make a video on the web that works in all major browsers you have to serve up different video fiiles depending on what a particular client supports. Major sites like youtube, vimeo etc do this but it doesn't surprise me that smaller sites don't.
 
Sponsor Post - registered members do not see these adverts; click here to register, or click here to log in
R

RailUK Forums

Pigeon

Member
Joined
8 Apr 2015
Messages
1,123
Video codecs on the web are a mess, you have h.264 which is pushed by the media industry, but there are patent licensing issues which mean firefox does not support it. Then you have VP9 (aka webm), created and pushed by google which apple refuse to support.

The net result is if you want to make a video on the web that works in all major browsers you have to serve up different video fiiles depending on what a particular client supports. Major sites like youtube, vimeo etc do this but it doesn't surprise me that smaller sites don't.

It was a big mistake with HTML5 that they neshed out of including in the spec a definite "thou shalt support THIS codec else thou art not compliant and shalt be cast into the wilderness".

For a time there was a straightforward way around the problem: serve only one video file, in mp4 (H264/AAC) format. Apple i-things would play that natively and everything else would play it via a flash plugin, so the server just had to test the user agent string against /\biP(hone|od|ad)\b/ and serve a wrapper page with a native HTML5 player if it did match and a flash one if it didn't. I ran a site which did exactly that and never had any complaints about it not working.

But then of course they went and broke that and never cared about the consequences so now you have to waste huge amounts of disk space storing three different versions of every video, which blows elephants. Fortunately I'd shut the abovementioned site down anyway before that hit.

On top of this underlying mess there is also the universal tendency of sites to shove in a whole bunch of unnecessary crap which does nothing but provide more different ways for things to go wrong. All web sites are put together by utter morons who can't program to save their lives and have no idea how any of the stuff they're messing with actually works, so they google something like "how do you put a video on a web page", find some wretchedly appalling rubbish of an "answer" involving several megabytes of unrelievedly faecal and completely unnecessary broken javascript in six different files, entirely lack any trace of the means of understanding why it's wretchedly appalling rubbish, copy it wholesale and grin at the result like a kid who's just done a massive fart in class. The actual answer is that you just use the HTML5 <video> tag and that's all you need, which is the whole point of the thing existing, but since none of these benighted idiots actually know what they're doing it's almost entirely unknown for any site to actually do that.

This lot is just one of the many reasons why if I watch a video at all I never try and watch it in the browser, but always download it to the hard disk and then use a standalone player to watch it.
 

Lancs

Member
Joined
22 Dec 2017
Messages
48
It was a big mistake with HTML5 that they neshed out of including in the spec a definite "thou shalt support THIS codec else thou art not compliant and shalt be cast into the wilderness".

For a time there was a straightforward way around the problem: serve only one video file, in mp4 (H264/AAC) format. Apple i-things would play that natively and everything else would play it via a flash plugin, so the server just had to test the user agent string against /\biP(hone|od|ad)\b/ and serve a wrapper page with a native HTML5 player if it did match and a flash one if it didn't. I ran a site which did exactly that and never had any complaints about it not working.

But then of course they went and broke that and never cared about the consequences so now you have to waste huge amounts of disk space storing three different versions of every video, which blows elephants. Fortunately I'd shut the abovementioned site down anyway before that hit.

On top of this underlying mess there is also the universal tendency of sites to shove in a whole bunch of unnecessary crap which does nothing but provide more different ways for things to go wrong. All web sites are put together by utter morons who can't program to save their lives and have no idea how any of the stuff they're messing with actually works, so they google something like "how do you put a video on a web page", find some wretchedly appalling rubbish of an "answer" involving several megabytes of unrelievedly faecal and completely unnecessary broken javascript in six different files, entirely lack any trace of the means of understanding why it's wretchedly appalling rubbish, copy it wholesale and grin at the result like a kid who's just done a massive fart in class. The actual answer is that you just use the HTML5 <video> tag and that's all you need, which is the whole point of the thing existing, but since none of these benighted idiots actually know what they're doing it's almost entirely unknown for any site to actually do that.

This lot is just one of the many reasons why if I watch a video at all I never try and watch it in the browser, but always download it to the hard disk and then use a standalone player to watch it.
To the technically illiterate, will they know whether that file is executable or not? Essentially you are saying, just download it and double click it....

Are you certain a .mp4 is not a .mp4.exe file when by default you don't see file extensions in windows?

{I fully agree with the concept of <video> etc, to theoretically get rid of these problems}
 

plugwash

Established Member
Joined
29 May 2015
Messages
1,990
It was a big mistake with HTML5 that they neshed out of including in the spec a definite "thou shalt support THIS codec else thou art not compliant and shalt be cast into the wilderness".
Ultimately it's the browser vendors who define what actually works on the web. Standards bodies like W3C and WhatWG can't actually force the browser vendors to implement something they don't want to. The alternative to standardizing a video tag without mandatory codecs was probably not standardizing one at all.

you have to waste huge amounts of disk space storing three different versions of every video
Who is the third version for?
 

Pigeon

Member
Joined
8 Apr 2015
Messages
1,123
To the technically illiterate, will they know whether that file is executable or not? Essentially you are saying, just download it and double click it....

Are you certain a .mp4 is not a .mp4.exe file when by default you don't see file extensions in windows?

What I was meaning to say was download it, then start the player and point it at the file. I remember the original 68K Mac trying to impose a one-to-one mapping from a file to an application that would open it so that it could encourage me to do things backwards and get the file to start the player, but even the restrictiveness of that notably restrictive system wasn't enough to conceal that the mapping is actually one-to-many, so the encouragement never "took".

Not having used Windows for years I do tend to forget what a crock it is. They really, really should have stopped trusting file extensions yonks ago, and got rid of that "hidden .exe" booby-trap. Of course starting the player and pointing it at the file means the player will simply moan that it can't play a booby-trap file, and won't try to execute it instead.

Still, when you are downloading a video from the URL that a site provides to feed to a browser-based player, this isn't going to be a problem, since if the URL pointed to something that wasn't a video file it would never play a video in anyone's browser. A sufficiently disreputable site might still try (unreliably) to sneak you a booby-trap in such circumstances, but I don't think Network Rail's safety video site is the kind of thing to try that.

Who is the third version for?

MP4, webm and ogg was the state of things when I was doing it myself, and what I saw "big" sites doing. OK, ogg seems to have faded now, but two versions is still one too many.
 

Mordac

Established Member
Joined
5 Mar 2016
Messages
2,386
Location
Birmingham
Firefox has supported H264 for a few years now, they've been shipping with a third party binary to do so which you can disable if you want, but comes enabled by default.
 

dosxuk

Established Member
Joined
2 Jan 2011
Messages
2,434
Not having used Windows for years I do tend to forget what a crock it is. They really, really should have stopped trusting file extensions yonks ago, and got rid of that "hidden .exe" booby-trap.

File extensions are irrelevant to the problem. An extensionless executable file can still make itself look like an extensionless MP4 file
 
Status
Not open for further replies.

Top