Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Reply
 
Thread Tools Search this Thread Display Modes
Old 3rd November 2009, 17:08   #1  |  Link
Rogier
Registered User
 
Join Date: Nov 2007
Posts: 4
Codecs vs container formats?

As I understand it, there are several algorithms to compress video (called 'codecs'), such as H.264, XviD, DivX, Ogg Theora, Sorensen, etc.
There are also several algorithms to compress audio, such as MP3, Ogg Vorbis, AAC, etc.

Furthermore, there are several 'container formats' in which content, compressed by some codec (as mentioned above), can be stored, such as avi, mkv, asf, mov, wmv, etc.

Question: can content compressed with a certain codec, stored in a certain container, generally be converted without any loss (i.e. without the need to re-compress the actual content) to another container format?

For example, suppose I have an .avi file which contains a H.264+AAC encoded movie. Can this be converted to a .mov file containing the same H.264+AAC data? (wrapped in a different format to meet the .mov standard I guess, but I mean essentially the same media data)
Rogier is offline   Reply With Quote
Old 3rd November 2009, 17:21   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by Rogier View Post
As I understand it, there are several algorithms to compress video (called 'codecs'), such as H.264, XviD, DivX, Ogg Theora, Sorensen, etc.
There are also several algorithms to compress audio, such as MP3, Ogg Vorbis, AAC, etc.
Not exactly. You must distinguish between Video Formats and Encoders/Decoders (Codecs) here!

For example MPEG-4 Visual (Part-2) is a video format. It's defined in the MPEG-4 standard. That is documents and specification, but not a software you can use. Encoders/Decoders (Codecs) are software. They implement standards. Both, DivX and Xvid, are MPEG-4 Visual (Part-2) encoders. So both of them implement the MPEG-4 standard. Internally they may use compeltely different algorithms (or pretty similar ones), but at the end they produce a valid MPEG-4 Visual (Part-2) bitstream that can be decoded by any MPEG-4 Visual (Part-2) decoder. That's because a video compression standard ("Format") only defines how a valid bitstream has to look like. It doesn't tell you how to transform an uncompressed video into such a bitstream. That's up to the Codec developers to figure out...

And the same goes for H.264. While H.264 is a video format (or "standard"), it is not a Codec. x264 is a Codec (actually it's only an encoder, not a decoder) that implements the H.264 standard in software. There are many other H.264 encoders, such as Ateme, MainConcept and so on. All of them produce a valid H.264 bistream at the end (hopefully ^^), but not all of them deliver the same quality. Some encoders use more sophisticated algorithms than others and thus produce better quality. For example x264 beats most (all?) other H.264 encoders at the moment...

Quote:
Originally Posted by Rogier View Post
Furthermore, there are several 'container formats' in which content, compressed by some codec (as mentioned above), can be stored, such as avi, mkv, asf, mov, wmv, etc.

Question: can content compressed with a certain codec, stored in a certain container, generally be converted without any loss (i.e. without the need to re-compress the actual content) to another container format?
Yes. This is possible. The process of storing (several) audio/video streams in a container is called "muxing" (multiplexing), reading individual streams from a container file is called "demuxing" (demultiplexing). Finally moving streams from one container to another one is called "re-muxing". That process is lossless, as the streams aren't re-encoded. However not any container is suitable for any audio/video format!

BTW: WMV is a video Format, WMA is an audio Format, ASF is the Container. Those ".wmv" and ".wma" files actually are ASF files that contain WMV and/or WMA streams
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 4th November 2009 at 12:07.
LoRd_MuldeR is offline   Reply With Quote
Old 3rd November 2009, 17:25   #3  |  Link
Rogier
Registered User
 
Join Date: Nov 2007
Posts: 4
Perfectly clear. Tnx a lot!
Rogier is offline   Reply With Quote
Old 9th November 2009, 10:20   #4  |  Link
Rogier
Registered User
 
Join Date: Nov 2007
Posts: 4
One more question on this subject: what software do you recommend to do this?

Also, if I *do* need to re-encode the content (for example when going from a .asf with wmv+wma content, to a .mov with h.264+aac/mp3 content), what program is suitable for this?


The thing is, I've tested several such programs (you find shitloads of stuff when googling for this) but they all seem to do ridiculous things like forcing me to select a new output resolution or a new framerate (I can't even imagine how crappy that will look!) while I want to keep these the same as the original. Just converting (re-compressing) is what I need.

Last edited by Rogier; 9th November 2009 at 10:27.
Rogier is offline   Reply With Quote
Old 9th November 2009, 13:21   #5  |  Link
RunningSkittle
Skittle
 
RunningSkittle's Avatar
 
Join Date: Mar 2008
Posts: 539
Just a few sections down! (how do people always miss this one!)

For muxing into mkv use mkvmerge, for mp4/mov use mp4box
For reencoding use one of the many gui's here:
http://forum.doom9.org/showthread.php?t=129748
(and of course other guis not on that list but are in the parent topic.)
RunningSkittle is offline   Reply With Quote
Old 14th November 2009, 01:28   #6  |  Link
khat17
Registered User
 
Join Date: Jul 2006
Posts: 19
You don't suggest some free apps like MEDIA CODER or FORMAT FACTORY?
khat17 is offline   Reply With Quote
Reply

Tags
codec, compression, container, format

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.