Dirac: BBC Open Source Video Codec 523
NickFitz writes "Need To Know this week has a piece about Dirac, a BBC R&D project to produce a video codec, which has been released as an Open Source project. From BBCi: 'Dirac is a general-purpose video codec aimed at resolutions from QCIF (180x144) to HDTV (1920x1080) progressive or interlaced... Our algorithm seems to give a two-fold reduction in bit rate over MPEG-2 for high definition video (e.g. 1920x1080 pixels), its original target application. It has been further developed to optimise it for internet streaming resolutions.'"
Re:Duplicating work? (Score:2, Informative)
Re:Duplicating work? (Score:5, Informative)
Windows is most of the marketplace.
REAL codecs (Score:5, Informative)
Check out k-litecodecpack.com [k-litecodecpack.com].
Re:Duplicating work? (Score:4, Informative)
Re:Another one? (Score:3, Informative)
Re:Xvid? (Score:3, Informative)
Who modded this pile of crap as informative?
From the Xvid FAQ [xvid.org]
What is XviD? XviD is an ISO MPEG-4 compliant video codec. It's no product, it's an open source project which is developed and maintained by lots of people from all over the world.
And don't get me started on all the other crap, audio? FFS, it's a video codec! You have to include audio an either mp3/ogg/wav/whathaveyou into the stream.
Wavelet Theory (Score:5, Informative)
I went to a day at the Research and Development facility with the BBC, and saw a demonstration of Dirac.
It does look quite impressive, and for those who are interested, I believe it works on wavelet theory. Lots of information on this is provided at http://www.wavelet.org/ but I believe its scalable frequency analysis enables significantly better compression than other codecs (typically DCT based?) out there.
I think.
Re:MPEG4? (Score:5, Informative)
Re:what is the bitrate for HDTV? (Score:4, Informative)
So:
1920x1080 = 2073600 pixels per frame * 24 bits/pixel = 49766400 bits per frame * 30 frames per second =
177.98 megabytes per second, uncompressed.
Patents (Score:5, Informative)
Kjella
Re:BBC = british government (Score:5, Informative)
Er, BBC != british government
It's on sourceforge, and is entirely open. Its licenses, as stated by sourceforge are: GNU General Public License (GPL), GNU Library or Lesser General Public License (LGPL), Mozilla Public License 1.1 (MPL 1.1), so you could hardly say it's 'owned' by the BBC, let alone the british government.
Cocodude
Re:MPEG4? (Score:4, Informative)
I've heard that before too, but if you compare an equal-bitrate Mpeg2 with Mpeg4, I think you'll find that Mpeg4 wins. The optimizations were designed for low bitrates, but help at high bitrates as well.
Re:Duplicating work? (Score:5, Informative)
One thing that is interesting about wavelet based compression is that it degrades in a way that is more pleasing to the eye, that is, there aren't any "artifacts". Discrete cosine transforms (e.g. traditional JPEG/MPEG) produce artifacts because of the way the compression works on blocks: blocks are not a normal part of most video signals, and thus when they show up they are called "artifacts" because clearly they do not belong there. Wavelet transform degrades more akin to the picture being less sharp and showing less details and so there is nothing that is noticably out of place.
Re:BBC = british government (Score:2, Informative)
I confess to not knowing that much about this topic, but I still don't think you can say the codec is owned by the government. Even if it was, it doesn't really matter being GPLed etc.
Although it's not an authoritative source, I refer you to this article on Google Groups [google.co.uk] which states, amongst other things, that "The BBC is run under a Royal Charter, not by the government" and "But it was part of the Government to start with, yes? The BBC was not, and has never been, and will never been part of the British Government."
Wavelet artifacts (Score:5, Informative)
Wavelet and DCT based codecs are alike in that they both quantize in the frequency domain and thus tend to have blurring and ringing artifacts. However, wavelet ringing looks more evenly spread-out than DCT ringing and doesn't coincide with a regular 8x8 pixel grid. Compare JPEG and JPEG2000 artifacts [uni-lj.si].
Re:seems they were ahead of me (Score:2, Informative)
I wrote a similar complaint to the BBC a while back regarding a video stream that I simply couldnt play without hacking the URL out of the source HTML (under linux). The BBC have a duty to ensure that everyone is able to view its content.
Nick
Re:Patent free (Score:1, Informative)
Re:what is the bitrate for HDTV? (Score:3, Informative)
Re:Xvid? (Score:1, Informative)
Xvid releases only source because if they released binaries they would be required to pay the fees for MPEG-4 encoders and decoders each time someone downloaded a binary.
While I'm not sure exactly what the fees are, there is about a $20 royalty for MPEG-2 decompression for a hardware or software DVD player. This is why Microsoft disabled DVD playback on the Xbox unless you pay $30 for the remote kit ($20 for the fee, $10 for the plastic remote).
This is also why Chinese DVD player manufacturers wanted to make their own DVD playback standard back when because when you're making a $20 DVD player you have just as much cost in licensing as you do the player. They obviously want to eliminate that.
Re:Duplicating work? (Score:5, Informative)
Re:A bit wary (Score:4, Informative)
Re:A bit wary (Score:5, Informative)
Well, if your video compressor has notions of "8x8 blocks" and "16x16 blocks" hardwired into it, that is not exactly surprising. That's the kind of technology that current codecs use.
If they use wavelets and motion compensation correctly, there is no reason why it shouldn't scale well across a large range of resolutions.
Re:How do they do it all for free? (Score:4, Informative)
I presume that the BBC sells its stuff abroad - it also has a number of commercial outlets (videos, etc). Despite not being able to advertise, it relentlessly promotes its own material (which can get quite tiresome and repetitive sometimes).
Well, speaking as one British person, I'm quite happy to pay the license fee given the alternative. Radio 4 alone has got to be worth it. Of course, there are plenty of people who disagree with me here.
What I can't understand is that they have the manpower to fund this project, but not to keep the ogg vorbis streams online... (http://support.bbc.co.uk/ogg/ [bbc.co.uk])
Re:great now when I download a fansub (Score:2, Informative)
The BBC's digital service is massive (Score:5, Informative)
Many people, esp our american friends, many not be familar with the sheer scale of the BBC's operation. There is a lot of dressing applied to their funding but in essence almost every UK home pays a BBC tax, giving them vast cash funds and allowing them to take a 'long term' view to development.
This is very unpopular with their competition. People like Sky (NewsCorp) and ITV ('free' UK advert funded network tv) have no means of building the digital services the BBC have. Lets face it - both buy in a lot of programming from the US and that doesn't work well online.
At a recent LINX meeting (a meeting of all the major UK ISPs and many of the major european ISPs) where the BBC gave a presentation about their 'Summer of sports' coverage. They are predicting up to 12Gbps (yes Gigabits) leaving their network during the olympics. This is a huge undertaking and requires them to put Gbps direct connections into the major UK ISPs such as BT. Without private peering of this type the BBC couldn't cope, LINX couldn't cope, the target ISP couldn't cope, it'd be meltdown all round. Their presentation was aimed at heading off a potential doom of them DOSing a major ISP into the ground.
They're using Real at the moment. If they eventually move to an open codec the it will become a MAJOR player overnight. A national broadcaster using a codec to pump out Gigabits per second of content is the only case study/endorsement needed.
I've not spoken to the techs pushing this within the BBC but the feeling I have from whitepapers, presentations and rumour are:
- they need to be pragmatic. Its public money they're spending and the solution has to work. Currently the only solutions that work are propeirtary codecs.
- They are under attack from the competition, who want to cut off their r&d funding which they see as unfair.
- The intend to share their technology and want to grow the stability and performance through sharing things with their peers.
For BBC network info (and a boatload of mrtg goodness) visit the ever popular support pages [bbc.co.uk]
Re:Yes - UK government subsidizes BBC (Score:5, Informative)
The BBC is legally a corporation established by Royal Charter and operates under strict rules of editorial independence and public service, which means that almost uniquely among broadcasters its job is to deliver programmes to audiences, rather than audience eyeballs to advertisers.
In order to receive television broadcasts in the UK it's necessary to have a television licence (see the Wireless Telegraphy Act 1949 for details - in the old days you needed a licence for a radio as well, but no more). This isn't a tax, and the BBC isn't funded out of general taxation - it's a simple deal that if you want to watch television, you need a TV licence. The money from the TV licence goes to the BBC. In addition, the BBC makes a lot of money from the sale of programmes overseas and from various other commercial enterprises (magazines, DVDs, whatever). This money goes back into the BBC - there aren't any shareholders to be paid, just more programmes to be made.
If you ask me, just under a tenner a month is a bargain for what it means - some of the best quality television in the world, a bunch of excellent radio stations and value-added stuff like news.bbc.co.uk. And what the TV licence means most of all is that all this stuff goes out without commercials and without commercial or political considerations. The BBC's editorial independence regularly lands it in hot water with governments who don't like it broadcasting certain things ("Maggie's Militant Tendency", the whole Hutton business). There's a lot of stuff which would never have appeared anywhere else as the BBC can actually take risks rather than just always following the path of maximum guaranteed commercial gain.
Having recently taken a trip to the USA and tried watching television there, I really started to appreciate just how important the BBC is. Bite-size chunks of advertiser-friendly blandovision split up into five minute segments interspersed with huge amounts of commercials don't seem to educate, entertain and inform very much.
Ultimately, nobody is forcing you to pay the television licence fee unless you have a television. If you don't want to have to get a licence, the choice to not own a television is available to you!
Re:Patent free (Score:4, Informative)
The BBC doesn't NEED to worry about patents because software patents don't exist in Europe. Although we're in danger of getting them because of the US and US companies influencing the European commission
That weird shit only happens in the USA at the moment. Something as good as the BBC is doing would almost certainly be impossible in the US because of patents. When the BBC puts it's public knowledge on the net (wonderful documentaries), it will be illegal to watch/hear that info in the US as soon as a company comes out with a patent infringement claim.
The only reason the rest of the world worries about software patents is because we want the people in the US to be able to use the software we're making. This might not last, as in the case of the BBC codec.
I suggest US men-of-action types fix this situation, start with voting good guys/girls into office.
Re:Background (Score:4, Informative)
Will Dirac run under OS X?
It should, but not having tested it on an OS X system leaves me hesitant to make an absolute promises. I don't know of anything in the codec that precludes it's working on OS X.
The code compiles with GCC, and the current encoder and decoder are command-line applications. As time goes on, I suspect Dirac will gain user interfaces and connections to most popular operating systems and video applications -- including OS X.
Re:what is the bitrate for HDTV? (Score:3, Informative)
Re:Finally!!! (Score:2, Informative)
UK->US: Coupling, Red Dwarf, Dad's Army (as the Rear Guard).
US->UK: That 70's show (as Days like these). They also tried a version of The Golden Girls, but I never liked the orignial.
It seems to be only sitcoms that are a guaranteed failure. Quiz shows seem to work very well, so do lots of other formats. Junkyard Wars seems very popular, for example. Yet they keep trying sitcoms.
Re:Duplicating work? (Score:2, Informative)
While this is true in theory, Dirac is using a block-based approach to motion compensation. That means that it most certainly will have blocky artifacts.
What's more, traditional DCT-based codecs typically have sophisticated deblocking algorithms to smooth over the block boundaries. During my 2-minute peek at the Dirac source code I couldn't see any sign of deblocking at all.
That said, the source looks clean, minimal and very readable. It would be an excellent starting point for anyone looking to play around with wavelet video.
Re:MPEG4? (Score:3, Informative)
It is also used for DVD videos, but at a higher bitrate than is possible/normal for TV.
Re:Some questions (Score:3, Informative)
It's still in development.
In the end, they will be parallelised; I'm doing the analysis and design work right now. I'm a big believer in parallel code; just this week, AMD annouced that their dual-core Opterons will be drop-in replacements for current single-core Opterons. Parallel is the future.
Some of both. We're doing some profiling with different implementations to find out what works best. This is one joy of working on a research projects -- we can do research!
I don't know. The entropy encoding is lossless, but that's after quantisation which is lossy, I believe. Motion estimation/compensation is also lossy.
Not at this time.
I've done a lot of past work with data compression and wavelet analysis of photos, and Dirac has been a fascinating experience for me. My expertise is more on the optimisation/parallelisation/UI side of the coin; the theoretical work and algorithm design is the province of some very bright mathematicians and DSP experts at BBC.
Re:Where do you get this content? (Score:2, Informative)
http://www.bbc.co.uk/broadband/
Re:Patent free (Score:3, Informative)
Actually, the article says "Off the top of our heads, its mention of arithmetic coding is worrying, given how patent-encumbered that area is.".
And having talked to some of the Dirac developers, they did develop it with patents in mind, not only to avoid licensing issues in the US, but also in case we do become lumbered with software patents in Europe.
In fact, according to testimony at a recent conference in Brussels I attended, an awful lot of small software companies are now filing patents as a defensive measure, both against unsubstantiated threats in Europe (where even going to court to point out the patent is invalid is too expensive) and in case the EU takes the Commission's bait.
So while I agree with your sentiment that software patents are a bad thing, and that we should use our votes and letter paper to sort it out, it's misleading to suggest we're completely unharmed by them.
Re:Wavelet Theory (Score:2, Informative)
As far as Wavelets go, I'm not too sure how much compute power they require to calculate, but I'm assuming they would be more computationally intensive than -say- a FFT (from which the DCT is based).
Fortunately for implementers, your assumption turns out to be wrong. The wavelet transform is no more computationally complex than any block or lapped Fourier-style analysis.
Re:Duplicating work? (Score:4, Informative)
The quality craps on anything I've seen MPEG produce.
Seek granularity / CPU load (Score:3, Informative)
The typcial keyframe rate in MPEG4 stuff is around 8-10 seconds. In MPEG2 it tends to be around 2-5 ms, which is about as good as the eye gets, apparently. So, if you watch it from start to finish, that's fine - but if you want to do anything non-linear, MPEG2 gives a good win.
In terms of broadcasting, you need to add the seek time onto the total 'tune in to pictures' latency. Remember that this is applied everytime that you change channel, and it's pretty clear that 8-10 seconds is way too much.
Also, MPEG4 is a much more complex beast, with things like motion compensation much greater than MPEG2. This is where MPEG2 wins ove MPEG4. Consider a slowly panning camera, over a scene that changes slowly, with a foreground object - think left to right pan over a nature scene with birds and gentle breeze, with the presenter in the foreground. In the low bandwidth limit, MPEG4 will approximate this to a static background, and just move it. However, as the bandwidth improves, it uses this a baseline, and records deltas to it. In the high bandwidth limit, it can be seen that this is a lot more work than just recordsing the background as a much simpler object, rather than all the moving, and altering. Doing it the way that works at low bandidth is actually more expensive, then, for the high bandwidth situation. MPEG4 _can_ drop all that, and just to it the simple way (as MPEG2 would do), but doesn't have to.
There are many more, similar, examples. The short answear is that if you set the keyframe interval short, and give it lots of bandwidth, MPEG4 can be as good as MPEG2 - but can also be much worse (in terms of picture quality vs bandwidth, and CPU required). MPEG2 is a lot more dependable in this case. Plus, if you set the keyframe intervals to match, I have a sneaky feeling that MPEG2 will have a slight win here.
What? (Score:2, Informative)
You do the exact same number of fetches, adds and stores. Just different coefficients and different strides. Your neighborhood of fetches will be about the same, so cache usage should be about similar.
Wavelets are slower mostly because people haven't had years to fiund all the clever tricks (SIMD instructions on various targets, DFT->FFT-like optimizations for popular wavelets)
MPEG2 keyframes (Score:4, Informative)
The typcial keyframe rate in MPEG4 stuff is around 8-10 seconds. In MPEG2 it tends to be around 2-5 ms
Seeing as how one frame is 1/25 (0.04) or 1.001/30 (0.03) seconds depending on which part of the world you live in, 0.005 is just plain impossible. At least as far as DVDs go, MPEG2 keyframe intervals are usually 12-18 frames, which works out to 0.4-0.6 seconds for NTSC--still a lot less than MPEG4.
Re:My question is... (Score:3, Informative)
* Better at compression that rival codecs.
* Patent unencumbered (well, software patents in Europe is a separate discussion really).
* Free.
* Wavelet-based.
* Suitable for internet broadcast and HDTV.
If it's stable, believe me we techies will adopt it very quickly!
Re:Here's hoping it leads to more videos (Score:4, Informative)