Log in

View Full Version : wrapping H.264 in AVI


theAlchemist
9th April 2006, 09:34
H.264 is gathering momentum as the new agreed upon standard for video. Is there an agreement on the way it will be packed in AVI files / other formats?
If you know of any open source code that does this I would appreciate a pointer.
I got a simple baseline profile encoder that generate raw stream (takes forever to encode). I would like to wrap it in AVI so it can be watched using the standard PC viewers.

DarkZell666
9th April 2006, 09:58
Fact 1 : AVI isn't designed to recieve h264.
Fact 2 : h264 wasn't designed to be put in AVI, but MP4.
Fact 3 : x264 can output h264 in mp4, mkv, and avi (yes, but with dirty tricks).
Fact 4 : x264's source code is freely available for you to read and understand.

Suggestion : get reading ;)

Note : storing h264 in other containers than MP4 is feasible but non-standard ;)

Sergey A. Sablin
9th April 2006, 10:19
Fact 1 : AVI isn't designed to recieve h264.
Fact 2 : h264 wasn't designed to be put in AVI, but MP4.
Fact 3 : x264 can output h264 in mp4, mkv, and avi (yes, but with dirty tricks).
Fact 4 : x264's source code is freely available for you to read and understand.

Suggestion : get reading ;)

Note : storing h264 in other containers than MP4 is feasible but non-standard ;)
there is no any standart/specification which tells you where to put all your avc/h.264 videos. MP4 is one of the existing way - not more, not less.
BUT some specific applications has restrictions about container - some of them use only MP4, another ones - TS.
But once again - there is no one spec for all cases. And saying "MP4 is the only standart container for H.264" is incorrect.

bond
9th April 2006, 10:19
just because you place x264 in avi doesnt make "standard pc viewers" be able to play it

there is no any standart/specification which tells you where to put all your avc/h.264 videos. MP4 is one of the existing way - not more, not less.
BUT some specific applications has restrictions about container - some of them use only MP4, another ones - TS.
But once again - there is no one spec for all cases. And saying "MP4 is the only standart container for H.264" is incorrect.of course there are standards defining how to place avc in mp4 and mpg and ts

this makes those containers more standard than avc-in-avi, as there are no specs existing for this combination (eg defining a common fourcc at least)

btw you have pm ;)

DarkZell666
9th April 2006, 12:20
But once again - there is no one spec for all cases. And saying "MP4 is the only standart container for H.264" is incorrect.
Isn't it defined in the white papers ? I'm sure I read this in this forum somewhere ...

Isn't MP4 designed to contain MPEG4-defined bitstreams ? Such as ASP, AVC, and AAC ?

bond
9th April 2006, 12:37
Isn't MP4 designed to contain MPEG4-defined bitstreams ? Such as ASP, AVC, and AAC ?of course

there even is an own standard defining how to store avc in mp4: 14496-15

foxyshadis
9th April 2006, 12:48
MP4 is the standard format for customer deliverables, like trailers and standalone movies. TS is the standard for broadcast, with all the potential problems (interference, interruptions, resyncs) that entails.

I don't know what the internet broadcast format is, though; I know mp4 can be used, but I don't think it was really designed with that specifically in mind.

Avi is a standard that even its creator disowned years ago for a much more advanced container, which might even be a standard in our lives if they hadn't locked it down so hard. :p

theAlchemist
9th April 2006, 14:31
From all you wrote I understood the following:
1. AVI is not a standard container for AVC but there is a way to make x264 make an AVI.
2. MP4 is a new container specially defined to contain AVC (or is it general MPEG-4??)
3. Other containers are defined such as .TS

I have few followup questions if you will:
1. What is the AVI fOURCC code for x264 codec and is the driver part of x264 project?
2. Are the standard PC viewers MediaPlayer / QuickTime / RealPlayer aware of the .MP4 and .TS formats? Is it a plugin?
3. Where can I find the .MP4 and .TS container format documentation?

Sirber
9th April 2006, 14:31
and MKV is the standard format for the people of the republic of video community! :D

unmei
9th April 2006, 17:47
1. like bond already said, the existing iplementations don't agree: one uses AVC1, another H264, yet another VSSH ..etc..

2. For windows media player and other direct show based players, they rely on splitter filters that might have to be installed into windows (nero, haali, gabest splitters are examples), for Quicktime and RealPlayer i don't use them, but at least for mp4 it can be assumed to be built-in (another question is what features of AVC they actually support)

3. the ISO sells those. ISO/IEC 14496-14 should be storing in mp4, the mpeg-2 transport stream is in 13818-2 (but im not sure at all packing of avc is defined in that document and not one of the 14496 series). The documents are not exactly cheap (maybe 60-200 USD, i only see swiss prices in CHF ;) but you can probably collect enough information from other sources to write valid streams.

Hyper Shinchan
9th April 2006, 18:37
2. MP4 is a new container specially defined to contain AVC (or is it general MPEG-4??)
Generally MPEG-4 container (derivated from the ISO Media Base containter, MPEG-4/JPEG2000 Part 12).
1. What is the AVI fOURCC code for x264 codec and is the driver part of x264 project?
The 4CC was made for AVI usage of course, but as you can understand from this thread it's better that you don't use it in the AVC faq you can find a list of reason (B-frames, multiple reference frames and so on).
2. Are the standard PC viewers MediaPlayer / QuickTime / RealPlayer aware of the .MP4 and .TS formats? Is it a plugin?
Liek unmei said there are many directshow filters, for the transport stream I don't know a lot of Dshow filters, I use the Elecard one anyway.
QT supports AVC until main profile (no Lossless or other High profile's features at the moment).
Real supports MP4 but I dunno about H.264/AVC support at the moment (i don't use it from months).
Anyway I personally discourage (MP4 rules:sly: ) the usage of TS for two reasons:
1. TS are heavily overheaded.
2. They are mainly used in the digital broadcast, there isn't a large use of them in the PC world (but we'll start to use them with BD, but at the moment we don't know the real structure of the BD streams).
the mpeg-2 transport stream is in 13818-2 (but im not sure at all packing of avc is defined in that document and not one of the 14496 series) I think that they updated their specs of the MPEG-2 standards, I don't think that the MP4 way to store AVC is related with the MPEG-2 one.

SeeMoreDigital
9th April 2006, 19:35
Without doubt the MP4 container is the "de-facto" container for MPEG-4 A/SP and AVC video, along with AAC (or MP3) audio streams.

The MP4 container (and not the MOV container) should be used for streaming the afore mentioned audio and video streams over the internet.

By rights (and wherever possible), the MP4 container should be used for spinning the afore mentioned audio and video streams in stand-alone players too!

Granted AVI continues to hang around because of stand-alone player compatibility (courtesy of DivX), not to mention its ability to support AC3 audio :scared:

There's no other container but MP4 for me and my stand-alone player ;)