Episode: 53
Title: HPR0053: Codecs Part 4
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0053/hpr0053.mp3
Transcribed: 2025-10-07 10:49:07

---

.
Welcome to the Hacker Public Radio. This is Clack 2. This is the fourth and final episode of the In-depth series on Codex.
There are certain codex that probably a great many of us won't really encounter that often, but some of them are interesting because they kind of, they show how specialized codex can be and how certain codex are working to overcome certain limitations of computers and video.
So I'll go over that a little bit and then toward the end of the episode we'll talk a lot about AUG and I would also like to just touch on just a typical line command of how to encode your video into the AUG format.
And AUG is obviously something that we'll all encounter quite frequently, so that'll split the episode between something you'll probably never see and something you'll see all the time.
So again, these are all kind of obscure codex, but one of the most interesting ones perhaps are the encoding hardware and software packages that certain companies are selling to, for instance, the news programs.
Most news reporters have to get their reports at the scene when they switch over to these people live.
Obviously, since it's happening in reality and being recorded by a video camera, there's a codex involved.
That's what we talked about in the first episode, how a codex is simply translating reality into a digital stream.
So they're taking the video, they're compressing it or encoding it, and then they have to send it across sometimes the world to get that video to play live on television for our consumption.
The way they do this is not by setting up a MacBook next to their, although Apple would love for you to think that.
They're not setting up like just a computer next to the, you know, plugging the camera into it and streaming it.
They're piping it into a rack unit that is dedicated to compressing video at really, really, really fast rates.
And I don't necessarily feel the need to mention a company for this, but just in case someone actually needs, like, has a need for this kind of service or it's just interested in this kind of stuff,
there is one that I know of called Streambox, and they have codex called ACT-L3 and RMS, no relation, I think, to RMS.
I think another one that I think that I've used in a job was by Green Valley, although I could be wrong about that.
Those are dedicated hardware devices that simply encode video, and it's very heavy duty, and it's very serious, and it's not something that a lot of people are going to use often,
but just be aware that that exists, and that's how really, really smooth videos transferred across the globe.
It's serious stuff.
So, there are other companies, and there are just small ones that I really don't even want to mention their name, because I don't want to promote them in any way.
And they just get into the business of codex, and they'll pinpoint a market, for instance, maybe someone wants to pinpoint the streaming market because they know that streaming video is big right now, and so they figure they'll offer a codec, and they'll market that codec as being a specialized codec for streaming, and it's really good with low bandwidth situations.
And all these other claims to fame, and there might be some truth to it, but the bottom line is that the hardware is still the same hardware.
The software, I mean how good can it really be, and it's a really great way for someone to make a quick buck off of a company that's looking for a solution of how to stream video, or whatever the market that they've been pointing is.
There are yet other codex that you will find more similar to the stream box stuff, where they're dedicated hardware.
There are capture cards out there, not so much for Linux, as far as I know.
Dedicated to capturing, for instance, really, really high definition video.
A lot of computers cannot handle that kind of bit rate, even with a good graphics card and a fiber optic link, because there's just not enough power.
So what certain cards will do is take in the high definition, it will re-encode it into something more manageable by the computer.
They can edit the video, and then they can send it back out.
So these are really specialized codex, and they often have strange names, and they're owned by whatever company is making this specialized hardware.
And again, you'll see the name of the codec in VLC player, if you open up a clip, if it's a mysterious clip, you have no idea why it's not playing anywhere else.
Open it up in VLC, whether it plays or not, you'll see the name of the codec right there.
Do a Google search for that codec, bang, you found out at least who owns that codec, and you're one step closer to getting it.
There are also codex that are actually quite specialized containers for like 3D modeling and things like that that will have the support for really interesting aspects of, I guess, video that usually you wouldn't really need like a materials list and a textures map and things like that.
So those are the specialized codex, and then of course there is the great AUG.
AUG is the open source solution, aside from xvid, it's one of the open source solutions for all those evil codex out there.
There is AUG Vorbis, sound only, it can contain metadata, so it's just like mp3 in the sense that it has tags and things like that.
It may even soon be able to contain data like MIDI data and things like that, so it's a pretty cool little format.
There's AUG, which is obviously the video codec. Now AUG, there's a lot of confusion about that.
A lot of people aren't clear on the patent freedom of AUG, the deal is this.
AUG was based on a codec owned by a company called ON2, the codec was called vp3, and vp3 is covered by patents.
But the codec fiora owned by the ziff.org, guys who do the AUG stuff, fiora has an irrevocable license to do whatever they want to do.
Whatever ziff wants to do with fiora, they're allowed to do it. It's irrevocable, it's permanent.
So while vp3 is covered by patents, fiora is licensed by that company.
If ON2 and ziff have a falling out and never talk to one another again, that agreement stands.
So AUG fiora is a perfectly legal and safe codec to use. It is not a problem.
There are many players for AUG fiora. VLC player, Totem, Miro, formerly known as Democracy Player.
So if you're sending out AUG fiora files to friends, which you should, if you're going to send video,
they can't play it in their Windows Media Player or their QuickTime Player.
Tell them to go download either Miro or VLC Player. They can watch it, and that will be that.
And now that KDE is out for both Windows and Mac, you could even send them to go download caffeine.
So AUG fiora is a great little codec. It is in peg 4 compliant.
It supports i and p frames, not b frames, but I haven't had any problems with that.
It supports variable bit rate, so that in a situation where there's a big fancy explosion with lots of lasers,
it will give that section of the video a very high band with a very high bit rate.
And then we cut to me talking at the microphone again, and it'll drop my bit rate down,
because I don't need that much information. So that's a really handy device called variable bit rate
to keep your end file size down by making it a variable in terms of what bit rate each scene gets.
It works within the YUV color space, which is the default for professional grade video.
It does not interlace, but again, that hasn't been really a problem for anyone that I know of.
I mean, interlaced videos kind of being phased out in many ways.
So AUG or the ZIF people also have the FLAC codec, which is the uncompressed audio codec, like WAVE or AIFF.
Speaks is for low bit rate audio. It supports VBR. It's just a very paired down kind of codec that they've designed, just voice stuff.
So that if I wanted to send this out in the Speaks format, that would be great.
It's extremely low bit rate stuff. It would be ideal, I would think, for something like Skype or something like that.
There have been some, I think, video games. I think I heard on an interview with someone from ZIF,
like some prominent video games have actually used the Speaks codec for, I guess, online talking to other players or something like that.
So that's kind of cool. So AUG is a fantastic codec. Nothing to be afraid of. Very handy codec.
And now let's talk a little bit about how we can transcode video that maybe we acquire from someone into a free format like AUG.
Or maybe it's video that we've acquired from a video camera. We want to save it for ourselves, we want to archive it.
Going to AUG is a great idea. Either AUG or XVID. Because you never know what the impact of society is going to do.
You don't know what kind of support they're going to give you. Whereas AUG and XVID, obviously being open source,
not going to be a problem in terms of it suddenly disappearing off the face of the earth.
So to do this, you'll need ffimpeg2theora installed. That is ffimpeg, the number 2 in the word theora,
t-h-e-o-r-a. Easiest way to get that apt-get install ffimpeg, the number 2 t-h-e-o-r-a,
or yum install ffimpeg2theora. Either way, it'll get to your repository and grab that little command line program.
And you can open up a terminal or a console, and you can do the following.
The command obviously is ffimpeg2theora, and then you type in the name of the file. So it'll be example.avi.
Then you need to give it the frame size that you want. So if you're staying native, it's just going to...
So if it was standard definition, it would be dash x, space 720, and then dash y, space 480, or whatever.
You look at the video that you're trying to transcode and see what the native frame size is.
Or if you want to scale it down, then you just do the math, 320 by 240, or whatever size you prefer.
And you'll want to define your bitrate as well. So the option for that is dash capital V.
And that is going to be measured in kilobits per second. Can't really predict what it would be. It just depends on the video.
So it could be anywhere from conceivably 200 kilobits per second all the way up to a lot more.
So just whatever bitrate you think is going to treat the video best and be better for your audience.
You'll need to... or you may want to also define the aspect ratio, because Ogthura does have a lot of different aspect ratios that it can encode to.
So if it was something that you'd recorded in anamorphic mode on your camera, it would be dash dash aspect space 16 colon 9.
Or if it was just standard definition, non-anamorphic, it'd be 4 colon 3, audio bitrate as well.
And remember, the higher the audio bitrate, essentially the lower the video bitrate is going to be if file size is a concern to you.
So typical audio bitrate you figure the audio that you download off of the internet usually is about 128 kilobits per second a lot of times on music.
It's a lot less on most podcasts because most podcasts are people talking and so it's frequently 64 kilobits per second.
So whatever you think the audio in this clip would require is what you would put here.
So dash capital A192 would be pretty good sound, 128 kind of standard sound, anything lower than 128 you're getting into areas where audio people are going to start to cringe.
You can also set how many output channels of audio you have, so that would be just dash C and then you can do one or two.
You can set the keyframe interval, which would be your iFrames.
And that's the default for for for ff impact to the aura is 64.
So that's one really nice frame every two seconds roughly.
So you could make that more frequent if you wanted to. There's the sample rate that you'll want to set for your audio again dash capital H for CD quality.
It's 44 100 DVD quality would be more like 4800 48000.
I usually just leave it at 44 100 not really a reason to go higher than that.
Usually not a good idea to go lower than that.
Dash O is your output. So put dash O and then name a file dot OGG.
The dot OGG is the again the container file. So all the aug when we say aug we're typically talking about aug Vorbis, but we might be talking about aug the aura obviously.
The aug is simply our version of the dot AVI or the dot MP4 or the dot WMV or what have you hit return and it will start encoding your video.
Encoding video relies heavily on the power of your CPU.
Video is being processed by your CPU to being being received and then written back out as a file.
If you have a couple of CPUs dedicated to doing this, it'll be a pretty quick process.
If you have just a single Intel Core Duo 2 chip, it's going to take, you know, I mean if it's a long file, it could take quite a while.
Be aware that encoding video is usually an intense and long process.
Your computer will get pretty hot. You will get pretty bored waiting for it.
So it's a great thing to have running overnight or started up in the morning and go to work, come back, see what happens.
But that's all there is to it really. It's just keeping in mind the variables that we've discussed in episode two, I think, or three, whatever we were talking about.
And then just typing in those variables into the command line one after another with the input file at the very beginning, the output file at the very end.
The manual page for ffnpeg2theora is actually one of the best manual pages that I've ever read.
I find it very clear. It just, it gives you a list of every single flag that you can possibly assign to ffnpeg2theora.
I guess it doesn't really tell you a whole lot about it, but now you know all, you need to know about those variables.
So when you see that there's the keyframe interval or the video bitrate and the audio bitrate and the sample rate, things like that, you now know what all of that is talking about.
Thanks for listening. This has been Hacker Public Radio.
Thank you for listening to Hacker Public Radio.
HPR is sponsored by Carol.net, so head on over to C-A-R-O dot N-C for all of those meetings.
Thank you very much.
