Log in

View Full Version : Quick question concerning H.264 / x264


strider01
9th April 2007, 20:09
Hi there,

I was wondering what the fundamental difference is between H.264 and x264? My understanding is that x264 is an open source implementation of H.264 in the same way that XviD is an open source version of DivX. In the same way that XviD is playable on standalone DivX DVD players, if i were to multiplex a video stream encoded in x264 (using the appropriate screen resolution) would this be playable by HD-DVD / Bluray players?

SˇnTëŁ
9th April 2007, 20:25
Basically:

DivX is a commercial implementation of the ASP/H.263 specification
XviD is an opensource implementation of the ASP/H.263 specification

x264 is an opensource implementation of the AVC/H.264 specification
Nero/Quicktime etc is a commercial implementation of the AVC/H.264 specification

Being an implementation of a specification does not mean however that all encoders are feature identical. Some features deemed unnecessary or not a high priority remain unimplemented and implementation differences of the same features result in different output. Encoders/implementations can also provide functionality that are not in the specification, which, if enabled, can break compatibility with a decoder following the specification, resulting in different/deteriorated or even broken playback.

As such, a basic xvid/divx clip can be decoded by both the divx/xvid decoders, and both can be decoded by a spec compliant ASP decoder (which is probably the decoder being used in a divx dvd player). Enabling some specific divx/xvid functionality however could break playback on some decoders (dunno any examples by heart, been too long).

The same is true for AVC, with the extra benefit that all compliant AVC decoders must produce bit identical output. As long as what your encoding is in line with a supported profile of the decoder, it can be played. In principle a blu ray player will decode x264 material but I guess there are other issues as well (BD disc format, directory structure, container, ... ?)

imcold
9th April 2007, 20:29
ASP is not the same as h.263.

strider01
10th April 2007, 14:37
Basically:

DivX is a commercial implementation of the ASP/H.263 specification
XviD is an opensource implementation of the ASP/H.263 specification

x264 is an opensource implementation of the AVC/H.264 specification
Nero/Quicktime etc is a commercial implementation of the AVC/H.264 specification

Being an implementation of a specification does not mean however that all encoders are feature identical. Some features deemed unnecessary or not a high priority remain unimplemented and implementation differences of the same features result in different output. Encoders/implementations can also provide functionality that are not in the specification, which, if enabled, can break compatibility with a decoder following the specification, resulting in different/deteriorated or even broken playback.

As such, a basic xvid/divx clip can be decoded by both the divx/xvid decoders, and both can be decoded by a spec compliant ASP decoder (which is probably the decoder being used in a divx dvd player). Enabling some specific divx/xvid functionality however could break playback on some decoders (dunno any examples by heart, been too long).

The same is true for AVC, with the extra benefit that all compliant AVC decoders must produce bit identical output. As long as what your encoding is in line with a supported profile of the decoder, it can be played. In principle a blu ray player will decode x264 material but I guess there are other issues as well (BD disc format, directory structure, container, ... ?)

Thanks for the good info! :)

So in theory, if I were to demux a WMV file and remux the video stream into an AVI container it would be playable by a DivX DVD player? If that would work it would be great, since at the moment I'm re-encoding these to make them playable which of course means I'm losing quality.

LoRd_MuldeR
10th April 2007, 15:08
Thanks for the good info! :)
So in theory, if I were to demux a WMV file and remux the video stream into an AVI container it would be playable by a DivX DVD player? If that would work it would be great, since at the moment I'm re-encoding these to make them playable which of course means I'm losing quality.

Nope! All the ".wmv" files are actually ASF files that contain video in the WMV format (and usually they also contain audio in the WMA format). So ASF is the container, while WMV is the video format! In theory it would be possible to demux the WMV stream from it's ASF container and then put it into an AVI container. But this is a very bad idea, as AVI is not intended to contain WMV video. Furthermore a "DivX Player", as the name indicates, is able to playback video created with the DivX Codec. So the DivX Player will be able to decode MPEG-4 ASP video, as this is the video format produced by DivX. This means the player will not be able to play WMV video, especially not from the AVI container! Nevertheless a DivX Player will always be able to playback videos that were produced with the Xvid codec, as both, DivX and Xvid, produce the same video format: MPEG-4 ASP. Those MPEG-4 ASP streams usually are stored in the AVI container today :)

To sum up:
* DivX and Xvid both are Codecs that implement the MPEG-4 ASP standard and thus produce MPEG-4 ASP video
* WMV is a video format, not a container! (BTW: The latest WMV is an implementation of the VC-1 standard)
* AVI is a container often used to store MPEG-4 ASP video and many more (but it's *not* suitable for WMV!)
* ASF is another container used to store WMV video (usually such files get a .wmv extension)

PuzZLeR
10th April 2007, 17:52
H.264 is the name of an MPEG standard, specifically the MPEG-4 Part 10 standard and is also synonymous with the name “AVC”, which means Advanced Video Codec (or sometimes misinformed as Advanced Video Coding).

x264 is an encoding engine that produces video in the H.264/AVC standard. This is also true of Nero Digital AVC, another encoding engine that produces H.264/AVC video.

Most H.264 video streams typically use the .mp4 or .mkv containers.

Similarly, ASP (Advanced Simple Profile) is part of the MPEG standard as well, namely MPEG-4 Part 2 (an older standard, before Part 10 was introduced a few years later). I’m not sure if ASP is H.263, or H.263+, or whatever, but at least arguably, they are the same, if not very similar.

DivX, Xvid, Nero Digital (without “AVC”) and about 20 others are encoding engines of MPEG-4 Part 2.

DivX and Xvid use the .avi container, while Nero Digital uses the .mp4 container. Actually, in recent years, DivX also uses an enhanced .avi container called .divx which can handle DVD-like features like menus, chapters, etc.

The relationship of x264 and Nero Digital AVC to H.264/AVC is very similar to the relationship of DivX, Xvid and Nero Digital to H.263/ASP.

H.264/AVC is a newer form of the MPEG standard and is better in terms of compression. In other words, you would need a larger file size with ASP/H.263 type of video to get similar quality to H.264/AVC.

Microsoft’s WMV series is an all-together different animal. It has its own container specifically designed for it (such as .asf and named .wmv). However, if you wish to compare, WMV was typically compared to ASP until WMV9, or VC-1, is typically compared to AVC.

Blu-ray and HD-DVD, the next disc formats, have adopted H.264/AVC and VC-1 as standard video formats, along with the older DVD’s MPEG-2 standard.

Now this doesn’t mean that they will playback/decode anything you encode with x264 or Nero Digital AVC. If BD/HD-DVD players accept this video as “data”, much like DivX certified DVD players accept DivX video on discs or how many CD players started accepting MP3s before that, then yes, they will play on the next-gen disc players easily. Although it's not really standard, I can't see why this would not be a feature in BD/HD-DVD players.

However, if you wish to play them as a "video" disc, they are still subject to re-encoding, transcoding, resizing (along with the authoring and burning).

I’m not too sure of this, but I would imagine if your video is in the AVC format, transcoding could be less lossy and faster when creating an AVC blu-ray disc. But, I’m not sure. I still say the best method is to prepare the clips in advance with the right specs for BD/HD-DVD, but it's a very new science at this time.

I also can’t say whether you can just “mux” your video streams into the .m2ts/.mts or .evo video containers of these discs (anybody?).

I would bet that you will still have to do, at minimum, one minor transcoding, at least one more time, to migrate your H.264 content onto BD/HD-DVD as “video”. But in due time it will be much easier, and less painful, to do this with the newer software and hardware of the future. It also won't be long before x264 and Nero further add features that are BD/HD-DVD specific as well, if they haven't already done so yet.