Hi all,
I'm determined to learn a bit more on videos and (to what I see) the complicated system of containers and codecs which make up what we watch.
From my understanding we have different containers, .avi / .mkv / .mov / .mpg etc etc
We also have different codecs, xvid / divx / h264 etc etc
What relationship do the containers have on the video though, for instance why would we use .mkv over .avi? Lets say I have a 720p x264 dvd rip in a .mkv file, what would stop me changing it to a .avi file? Doesn't the computer just have to read the codec inside to decode the video information? Why can something like a ps3 read a x264 file inside a .avi but not a x264 file inside a .mkv?
Sorry if this is pretty basic, but I'm in the newbie section for a reason
Also is there any limitations on the quality of the video determined by the container? I.e. Is it impossible to get the same quality out of a .avi file as a .mkv file, assuming I'm using the same codec? Codecs are the main determining factor in quality isn't it?
Thanks folks.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 19 of 19
Thread
-
-
Think of a mm container as a bucket, and the media streams as the liquid ingredients (oil, water, vinegar, etc). Different containers support different kinds of streams--some allow only audio + video, others allow those plus text, timecode, midi, pictures/graphics, subtitle overlays, etc--and different containers support certain # of those streams--some are 1 stream each, some 2, some more/unlimited. Also, some containers support only specific compatible codecs, while others potentially would allow any available codec. And some containers support only specific features to streams and their codecs, while others support much more--this includes things like AR flag and B-frames in video and multichannels and ultrahigh samplerates in audio. Lastly, some containers are older and have difficulty with streams that exceed 1, 2 or 4GB, whereas other containers have NO reasonable size limitation.
I could go into it further, but it would be long, and it would probably behoove you to do a little research anyway. If you do, and get stuck further only, we can always clarify certain things...
Readers/Players and set-top support are an additional matter, that's why sticking to STANDARDS is a good thing.
Scott -
Containers, examples:
1. Bucket
2. Bucket with holes
Contents (videos), examples:
1. Large rocks
2. Water
Large rocks clearly go in both containers.
Water can only be supported by one of the two containers.
Not all containers can hold all formats.
The only time "quality" is affected is by means of poor decompression (hindered by the container), with various artifacts as the result (freezing, choppy, etc).Want my help? Ask here! (not via PM!)
FAQs: Best Blank Discs • Best TBCs • Best VCRs for capture • Restore VHS -
Most containers are designed to be extensible. So, in theory, they support any type of stream or codec. The problem mostly stems around whether a container is actively supported by some standards setting body with enough clout to get everyone else to follow the standard.
AVI, for example, is an instantiation of the RIFF standard. RIFF was designed to be extensible. But since AVI was abandoned by Microsoft there really isn't anyone around to define new extensions -- at least nobody big enough to make their extensions a standard that everybody else follows. And Microsoft's VFW library (used by many programs to access AVI files and no longer actively developed my MS) wouldn't know what to do with the new chunks. Divx (the company) has recently been defining extensions to the AVI format to support chapters, subtitles, and menus but it is probably too little, too late. They are moving on to MKV with their new h.264 encoder.
There is also the issue of whether the standards setting bodies care to support certain features/codecs. For example, AC3 audio was only recently added to the MP4 container spec. -
Originally Posted by peleus
A subset of this is that certain codecs look better at a given bitrate than others. Codec A will look better at x bitrate in container 1 than it will at the same bitrate and codec in container 2. Sometimes there are exceptions to this and some can look identical in different containers.
Hope this helps a little.Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
Some codecs are also self-sustaining, no container needed, such as MPEG-1 or MPEG-2.
Want my help? Ask here! (not via PM!)
FAQs: Best Blank Discs • Best TBCs • Best VCRs for capture • Restore VHS -
Peleus, you asked a good question that often needs to be addressed by people visiting this site. Many people have encountered frustrating issues, especially with the very broadly applied .avi container. I love the bucket analogy, and in the case of the avi "bucket," the substance contained in it can be varied like sand, rocks, water, oil, etc., in the forms of DV, RAW, Uncompressed RGB, Uncompressed YUV, Divx, Xvid, and so on. Many people purchasing editing and encoding applications that claim to handle AVI get frustrated because they find they are using the wrong type of AVI.
Many people come here inquiring which is the best codec. A straight answer can never be given because sometimes you need sand, sometimes you need water, sometimes you need rocks, and sometimes you need oil. In the case of codec selection, some are better for editing, some are better for good visual quality with low storage space requirements, and some are better for broad distribution in a commonly used format. The "best" will depend ultimately on end use.
In a perfect world, codecs would be more universal. But technology changes and applications vary. It gets difficult to keep up with everything.
Thanks for bringing up this topic. -
Originally Posted by lordsmurf
Yeah, there's a lot of things to learn in this area. I used the "bucket" analogy to good use this last year while I was teaching at the Digital Arts School. You've got to come up with some analogy for people to be able to grasp all the technical permutations otherwise they'd really be overwhelmed. I also used a zipper/ropestrand analogy when dealing with muxing/demuxing.
Scott -
The main issue with MPEG PS container is that it isn't meant to to be flexible or extensible. It's for holding MPEG audio and video with a fixed range of properties. So it is inextricably linked to MPEG audio and video.
-
Guys thank you very much for your responses and outlines of my question. Much appreciated.
I think I can understand now that some containers suit particular codec's better, and while in some cases there is a wide range of codec's to choose from, there are better tool's than others.
I guess what you mean by "needing rocks or water" would be finding out what aim you have for your video.
I.e. If you're after decient quality but low storage requirements look for codecs such as Xvid or DivX, who have reasonable quality but low storage capacity? If you're after better quality and storage isn't as much of an issue go for H264 or huffy or something?
I'm guessing you can go down from h264 to divx or something to save space, I'm assuming there would be no point going from divx to h264 though (can't make quality out of air)?
I'm keen to read up on what "tool" each codec is good for, especially looking at audio codec's as well, any particular guides out there you'd recommend for a newbie? -
Peleus - While it's good that you want to learn, some of your assumptions are not right. I think you're taking lordsmurf's analogy far too seriously.
MPEG-2 was the successor video codec to MPEG-1. MPEG-2 could offer better compression and some other features missing in MPEG-1. Divx improved on MPEG-2 and could offer similar quality at a lower bit rate than MPEG-2 used. I am just making up these numbers, but for example, if an MPEG-2 video was encoded at 4000 Kbps, you could probably get similar quality from Divx at around 2000 Kbps. H.264 was even better and could offer equal quality at even lower bit rates. So H.264 offers the best quality at the lowest bit rate and has the smallest file sizes.
As far as containers go, the only ones you should concern yourself with as a newbie are AVI and MKV. Don't worry about the MP4 container, which is inferior to MKV. MKV is the most flexible in terms of what it will hold for audio and video so that's why it's used. AVI is much more restrictive in terms of what it will hold. As to why the PS3 wants AVI and not MKV, just blame Sony for that. MKV requires a little more processing power and I guess they didn't want to deal with it. -
Ok, thank you.
Firstly I completely understand how "frustrating" it can be dealing with newbies, who don't understand the basics / mis-interpret things that are said, so thank you for taking the time to educate me.
I think I saw my analogy that way because of the typical way you see (or I see) files, 4.7gb 720p rips in mkv files h264, and 700mb dvd rips in divx. From what you've just described though it seems as though h264 is superior in picture and quality for the same or lower bit rates. If that is the case, why would anyone ever use anything else?
Is it purely for compatibility? Obviously DivX has wider support in DVD players etc at the moment. I'm just trying to find examples / situations where and why one codec would be better than another. Same goes for containers I image linking back to my original question, but I have a sneaking suspicion if I have the codec question answered it will make the container choice reasoning a lot clearer.
Thanks again everyone for your help. -
The more pixels per frame and the more frames per second there are in a video the more bitrate it takes to maintain quality. So a 1280x720 video (typical 4 GB h.264) requires much more bitrate than a 576x432 video (typical 700 MB Divx).
Few set-top players support MKV or h.264. This is why Divx/Xvid in AVI has been preferred by the p2p community. Also h.264 takes much longer to encode and more CPU power to decode. -
Here's the thing about MKV...while it's a well thought out container format, it was designed by (for lack of a better term) semi-pro video hobbyists with good computer skills.
There is no corporate backing, so no hardware standards/support. It might be ok as an interim (particularly for BT downloads, hehe), but you can only play it on compatible HTPC's--no settops, gaming systems, ipods, etc.
In my book, that makes it much less desireable. I want something that is portable so I can show friends/relatives/clients.
Scott -
As an example of end-use driving the equation, while MKV may be technically better than MP4, I have two stand-alone devices that can handle h264 codec, but both require mp4 and will not play MKV whatsoever. Technically superior does not mean much if I can't see the video.
As for why h264 is not as common as some others, encode one and you will be able to answer that question sometime the next day, or the day after that on a slower machine.
H264 is often used on very hi quality source material, which somewhat skews your perception of the resulting file size. -
So really in an ideal world we would probably use h264 and mkv for everything... if compatibility and computing power weren't issues.
Because we don't live in that world, we typically only see h264 used for better quality sources (or niche area's in P2P) which is why my perception was skewed towards "it gives a much better picture" when really I was just seeing the good examples of it.
Same thing with DivX and .avi, the main reason its around is because its great for chucking in a DVD player and getting it to work.
To me that says that if time isn't an issue, and I want to back up DVD's of my own, I am most likely best off using .mkv and h264 if I only want to watch back through my computer?
Thanks folks. -
Originally Posted by peleus
The 720p is a high def conversion targeting dvd burners. This is because dvd burners are much more common than bluray at the moment. The 700mb is for cdr and that trends back to when cdr was more common than dvdr.
Regarding mkv as a technically superiror format that may be true. However as is mentioned it is not as widely supported as divx or mp4. Mp4 can be handled by quite a bit like ipod, psp, zune, and other portable players. The trick with mp4 becomes which flavor you use. The aformentioned players don't talk to each other and have their own needs. Even the Zune that can take mp4 ends up having to reencode it to wmv upon synching to the zune. But I guess my point is mp4 has a little more support than mkv. (in general of course - these are grand sweeping statements - there are exceptions to every rule).
Basically your choice of codec for compression comes down to a few choices:
1 - playback destination
2 - file size needs
3 - specialty needs (like subtitles, chapters, menus, etc)
1 - for PLAYBACK DESTINATION you need to choose how you will watch the compressed video. If you intend to burn to a cdr or dvdr for playback on a settop dvd player that would lend itself to divx/xvid (some can do wmv and mp4 generic but support is sporadic and VERY VERY PICKY). Even divx/xvid needs to meet certain criteria for dvd players before they can work well. Also portable players like ipod, archos, zune, psp, etc all have variations that need different focuses. And lastly if you only need to play it on your pc than pretty much any codec will work since a pc has the most flexibility in playing codecs.
2 - File Size needs - BITRATE is the key determinant in file size for video files (and audio files as well but thats a seperate topic). As already mentioned certain formats handle low bitrate better than others. The lower the bitrate the smaller the filesize as a rule. Something like realvideo for webplayback may look decent enough on a small window in a browser but is not ideal for fullscreen playback of a feature length film. As you step up into the next target quality improves but necessarily filesize increases. Again if its a pc destination filesize usually isn't a concern but fixed size playback devices like a ipod/zune etc.. can only hold so much video and music before its full. So you have to balance file size and video quality with the codec you use.
3 - specialty needs - Subtitle support I believe is the most widely supported subset of compressed video. As far as I know basically any compressed video format can handle subtitles. (I can't gaurantee it of course but that is a good assumption). However things like menus and chapters are a much more specific and limited subset of compressed video. I believe DIVX ULTRA is the only beast that will do both menus and chapters. There may be newer incarnations of mp4 and mkv that do this but I don't know anything about that. Also there would be almost no standalone support yet for newer functions like that. However you can pick up Divx Ultra certified dvd players that will function with menus and chapters. Again a pc would be able to mimick just about anything you need so its not as restrictive but if you don't have it configured as a htpc it might not be as practical to watch a 2 hour movie in your computer room as it is in the family room.
So these are my takes on the dos and don'ts of compressed video. Of course these are somewhat generallized and there are always exceptions to the rules and updates I may not know about. But if you follow these outlines for your compression needs you will be saving time and effort and some frustation.
Plus there are two more important factors to follow when converting video:
1 - ALWAYS use the original video source whenever possible. DON'T recompress already compressed video. This is a no-no here. The extra time saved and space saved from going to divx to mp4 might seem like a good idea at the time but the results won't be as good as going from the original source straight to the mp4 format you need. (again your personal tastes may not notice any serious loss in quality but the "experts" all agree one conversion is much better than multiple conversions).
2 - Always use good quality blank media. If your burning to cdr or dvdr or even bluray use quality rated blank discs. Also if you notice a video is freezing at the end of the movie try encoding to less than full capacity. Some are susceptible to bad edges and not filling up a disc will avoid the edges entirely.
Hope this helps. Others here can elaborate on my albeit still novice level understanding of digital video. But this should give you a real world example to follow and some insights into why we do certain things here.Donatello - The Shredder? Michelangelo - Maybe all that hardware is for making coleslaw? -
Another issue that helps determine format selection is end use. While h264 is coming of age as a great playback format, it is highly compressed and does not lend itself well to editing...as of yet.
If your source material is DVD, and you simply want to make smaller-sized backups that look comparable to the eye, a good divx/xvid encode (1500 - 1800 kbps) will take much less time to make and will be compatible with more players than h264 -- right now, anyway.
The "best" for one person might be the "worst" for another, depending on the individual's end application. That is why there is no single distinctive answer we can give you. And your "ideal world" codecs look absolutely nothing like mine. -
Originally Posted by Cornucopia
However for the $99 I paid on sale for it I'm happy. I have to USB drives plugged into it. Small easily portable, HDMI HD output, matched with a laptop type External drive or flash drive it is portable enough.
It has a few needs to be fixed items such as playing a mpeg2 file when you stop fast forwarding it jumps ahead instead of the more desirable jump back a couple of seconds. This makes it harder to rewatch a segment.
Right now no .divx support, renaming it .avi and it plays fine.
It has played test mkv, wmv and .mp4 files from youtube and has spotty DVD ISo playing.(no menu etc.) I have great hopes that a firmware release will fix the gaps in its performance.
Cheers
Similar Threads
-
--
By MGadAllah in forum Newbie / General discussionsReplies: 47Last Post: 25th Apr 2012, 14:12 -
.MKV Containers?
By F22RJ in forum Video ConversionReplies: 6Last Post: 11th Apr 2011, 18:57 -
How frequently are video containers are constructed with custom innerds?
By zok4me2000 in forum Newbie / General discussionsReplies: 7Last Post: 30th Jun 2010, 04:48 -
Slowdown video other than from Mkv containers
By ranosb in forum Video ConversionReplies: 5Last Post: 3rd Oct 2009, 20:51 -
AVC and containers
By georgekellerman in forum Newbie / General discussionsReplies: 6Last Post: 29th Jul 2007, 17:40