video encoding&cleaning

 Codecpage News



This is considered old material now (although avidemux and some of the hints here may still be useful). For current information on HD encoding, visit the new hdtv page.

AAC is also covered in the audio page. 

These are the video and audio formats of the future: Advanced Video Coding (AVC, also named h.264) and Advanced Audio Coding (AAC). Both are mainly used with HD video. Some satellite HD channels already started transmitting AVC (although there are hardly any receivers), and some audio players are supporting AAC. HE-AAC allows to use 64 kbps where mp3 needs 128.
There are no DVD players so far for AVC based MP4, so this here is still experimental and of little practical use. It's also not very useful to play AVC on a PC, since there aren't yet any graphics cards to accelerate it. More about this, and about
transcoding AVC into other formats, you'll find in the HDTV section.

Encoding AVC
requires special codecs and software. Let's show some solutions currently available.

First, we need encoders. Generally, it's advisable to have Nero with the Nero Digital extension, because it has good playback filters for AVC and also the best (HE-)AAC encoder so far.

For AAC video encoding, Nero Digital could do it as well, but X.264 reportedly has better quality and is very useful as it can be used as a compressor filter for video in VirtualDub. We will describe its use here. The filter however is still under development, hence it might cause errors.


An easy all-in-one solution is AVIdemux. It comes with X.264 and FAAC installed, can read almost any input files including MPEG4 and supports many output formats including mp4. It also allows for cut editing. Using it is straight forward, so let's just show a screen shot:

And that's about all to know here.



Another very easy tool is SUPER (short guide here).



Alternatively, we can work with VirtualDub, Nero audio and YAMB. Only advantage is the very good HE-AAC audio encoder of Nero. The deatilled procedure works a follows:

After installing x264, we can compress any video like this:

For now, we just leave the x264 default filter settings. We set Audio to "no audio" and save our avi file.

If the source video is mp4 already, we need a helper to allow VirtualDub to open it. AVIsynth will do this. Procedure here.

Audio: there is no filter for AAC for VirtualDub, so we use the "save wav" function to save an uncompressed audio file.

Then we use Nero's "extra" functions to compress the wav audio file we just made.
There are some other AAC encoders, but I can't yet tell about their quality.

Although Nero can do HE-AAC, which is still better than ordinary AAC, we will get problems multiplexing HE-AAC. So we stick with standard CBR AAC for safety. 96 kbps is already very good.

The separate video and audio files we made, have to be multiplexed into an MP4 container to be anything like standard. Tools for this still are extremely rare. We use YAMB.

First we have to reconfigure the video file. The input is our AAC avi file and the output YAMB generates has a .h264 extension.

With the .h264 and the AAC file, YAMB can now make our final .MP4 AVC/AAC file.

This format will play in Nero Showtime and also in Media Player (with Nero Showtime installed).

Nice so far. But what if we want to convert that .mp4 into something else ?

This isn't really so easy, because the Nero filters are pure DirectShow and won't work with VirtualDub and not even with Avisynth.

What works is Graphedit, a little utility contained in the DirectX9 SDK (can be downloaded from Microsoft, or, as this SDK is really huge, look at doom9 or somewhere if you get Graphedit separately).

We start by simply dropping the .mp4 into Graphedit's window. It will automatically choose some filter chain to render the file. Basically, if we press the play (>) button, Graphedit will now play the file.

We want a disk output however. We also want a file format that we can use. Let's say MJPEG and uncompressed audio, in an AVI container.

We do this by first inserting some filters, then wiring them correctly. We use the insert filter menu tab and open the DirectShowFilters tree. We need PICMjpeg Compressor, AVI multiplexer, and File writer.

The final graph may look like this:

Now press Play (>), and the file will be created.

The individual filter settings, PIC's compression quality for example, can be accessed by right clicking on the filter.
The resulting .avi had the video upside down. Reason obscure but no big deal, this is an intermediate format for other editing/compression jobs, and VirtualDub's FlipVertical filter corrects this easily.

To reuse the graph (or to secure before we make changes, as Graphedit can sometimes be quite tricky), we can save it in a .gra file.
Note that the .gra file may give an error if you try to load it from within Graphedit, but it may load nicely if you just start Graphedit by double clicking on the .gra file (maybe you first have to associate .gra extensions with Graphedit).

This is just one variety how to deal with AVC, simply with the intention to use the best parts available for decoding as well as encoding. We might as well do everything with NERO or some other commercial product, or go entirely freeware, for example using ffdshow for decoding. Remind that this is entirely temporary as technology is advancing rapidly.



Copyright (C) 1998-2011; all rights reserved. All materials in these pages are presented for scientific evaluation of video technologies only. They may not be copied from here and used for entertainment or commercial activities of any kind.
We do not have any relation to and do not take any responsibility for any software and links mentioned on this site. This website does not contain any illegal software for download. If we, at all, take up any 3rd party software here, it's with the explicit permission of the author(s) and regarding all possible licensing and copyright issues, as to our best knowledge. All external download links go to the legal providers of the software concerned, as to our best knowledge.
Any trademarks mentioned here are the property of their owners. To our knowledge no trademark or patent infringement exists in these documents; any such infringement would be purely unintentional.
If you have any questions or objections about materials posted here, please
e-mail us immediately.
You may use the information presented herein at your own risk and responsibility only. We do also not guarantee the correctness of any information on this site or others and do not encourage or recommend any use of it.
One further remark: These pages are covering only some aspects of PC video and are not intended to be a complete overview or an introduction for beginners.