how are these combinations of codecs with containers?

Started by garin, June 20, 2012, 08:03:56 PM

Previous topic - Next topic

garin

mediainfo shows, for some files-

a video codec of  MPEG-4 and Audio of MP3

a video codec of  H.264 and Audio of MP3

Are both of those OK?


styrol

Quotea video codec of  MPEG-4 and Audio of MP3
It's okay for MKV and AVI.

Quotea video codec of  H.264 and Audio of MP3
It's okay for MKV and often used in AVI (but h.264 is not recommended for AVI).

If you wanna use MP4, you should set AAC as audio codec. MP4 (h.264/AAC) and MP4 (MPEG-4 ASP / AAC) are compliant to MPEG standards.

J. M.

AFAIK, MP3 in MP4 is officially allowed in the MPEG-4 standard, too. I don't know if there are players that cannot play MP3 audio in MP4 files, though (it works in all players I use).

styrol

QuoteAFAIK, MP3 in MP4 is officially allowed in the MPEG-4 standard, too.
You're right.

QuoteI don't know if there are players that cannot play MP3 audio in MP4 files, though (it works in all players I use).
As long as you don't rely on Apple hardware (iPhone etc.) and QuickTime framework only, you won't run into problems. QuickTime does indeed not play MP3 in movie container without the Perian QuickTime plugin (third party software based on libav) installed. QuickTime doesn't even encode MP3 audio only (without LAME plugin installed), but MP3 encoding capability is implemented in iTunes itself.

So on computers you have great software like MPlayer or VLC for the most important OS. On hardware you are sometimes limited to the specs supported. That's why I recommended AAC as audio encoding in MP4 containers, due to overall compatibility. BTW for those claiming AAC is worse than LAME MP3, software like Handbrake does also allow HE-AAC encoding.

garin

Is the MPEG standard freely downloadable anywhere?

It looks like I want part3 for audio supported, but I can't see a part for video codecs supported.

There's MPEG-4  profiles of-  Simple, Advanced Simple, Main, Core, Advanced Coding Efficiency, Advanced Real Time Simple,

I see Mediainfo doesn't show which profile is used, but avidemux says it within avidemux when you select which video codec.

Does the Profile belong to the video codec? or to the MP4 container?

If it belongs to the container, is it possible for there to be a clash between the Profile and the codec?  or container and codec?

I'm interested on some clarification on what is what, as I see syrol mentions
"MP4 (MPEG-4 ASP / aac)"     which suggests ASP is part of the MPEG4 video codec.

Whereas avidemux says
MPEG-4 ASP (xvid)

which suggests that ASP is an attribute of the container.



I notice avidemux lists container then the video codec in brackets e.g.
MPEG-1 (mpeg1video)

But why does it say
MPEG-4 AVC ?
I have heard that  AVC=H.264 which is a video codec.
Why doesn't it say MPEG-4 (AVC) ?


Thanks




styrol

QuoteIs the MPEG standard freely downloadable anywhere?
Maybe this helps: http://mpeg.chiariglione.org/standards/mpeg-4/mpeg-4.htm

QuoteDoes the Profile belong to the video codec? or to the MP4 container?
It belongs to the codec. MPEG-4 is a standard for a group of audio and video coding formats. And MP4 its the official container for these group of audio and video coding formats.

More info: http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles

QuoteI'm interested on some clarification on what is what, as I see syrol mentions
"MP4 (MPEG-4 ASP / arc)"     which suggests ASP is part of the MPEG4 video codec.
Whereas avidemux says
MPEG-4 ASP (xvid)
[..]
But why does it say
MPEG-4 AVC ?
I have heard that  AVC=H.264 which is a video codec.
Why doesn't it say MPEG-4 (AVC) ?
XviD is an MPEG-4 encoder. On the other issues you find some clarification here:
http://www.avidemux.org/smf/index.php?topic=10188

J. M.

Quote from: styrolBTW for those claiming AAC is worse than LAME MP3, software like Handbrake does also allow HE-AAC encoding.
Yes, but only with a proprietary encoder on a selected platform (the Handbrake wiki says Mac OS X only, but I don't use Handbrake, so I don't know). There is no free software HE-AAC encoder, that's why I don't use AAC, as FAAC (i.e. basic AAC) is quite useless IMO.

Quote from: garin on June 22, 2012, 12:44:55 PMI see Mediainfo doesn't show which profile is used, but avidemux says it within avidemux when you select which video codec.

Does the Profile belong to the video codec? or to the MP4 container?

If it belongs to the container, is it possible for there to be a clash between the Profile and the codec?  or container and codec?

I'd just like to interject for a moment... Oh well. :)

First of all, many people confuse these terms:

Codec: the true (correct, encyclopedic, logical) meaning of the word is "software or hardware that encodes and decodes data". This means that MPEG-4 ASP or AVC, or MP3, AAC etc. are not codecs, because these are specifications, standards, and specifications do not encode or decode anything. Software or hardware implementations do.  People who write codecs read the specifications (or create them, but that's not the case with MPEG standards) and then implement the specifications in software. The software product is then called a codec. For example Xvid, LAME, libvorbis, etc. Yes, many people apply the word "codec" to formats such as H.264 or MP3, but that's not the correct meaning of the word, and it only creates massive confusion. When you read the MPEG standards or documents, you can see that they're talking about "coding standards", "compression formats" or "compression algorithms" when they're referring to things like MPEG-4 Part 10 etc. The whole H.264 standard (~280 pages) does not contain the word "codec" anywhere at all. "Codec" may well be the most widely abused, misused and overused word ever. Generally, and this applies to Avidemux, too, this word should not be used except in some very rare special cases (like "Codec FourCC" in the file info box).

Encoder: this is "software or hardware that encodes data". For example, Xvid can be called a codec, not only an encoder, because it can both encode and decode. But in Avidemux, the selections in the A/V sidebar on the left are for encoders (e.g. x264 is a software encoder), not codecs, as you select the software library for encoding (e.g. x264 cannot decode at all, and Xvid in Avidemux is only used for encoding, too).

Decoder: this is "software or hardware that decodes data". So strictly speaking, you use decoders for decoding (playback), not necessarily codecs. Some libraries can only decode.

Format: not only container formats ("file formats") are formats. MPEG-4 Part 2, H.264, MP3, AAC etc. are formats, too. Or specifications that describe compression formats.

Container: this is the way of storing audio and video (and other) data in a single file. MP4, Matroska, AVI etc. are not containers. They are container formats. When  you create an MP4 file, you have one actual instance of an MP4 container on your HD (real bits and bytes). MP4 itself in not the container (real bits and bytes), it is a specification describing how to create the actual container (the actual bits and bytes).

QuoteI'm interested on some clarification on what is what, as I see syrol mentions
"MP4 (MPEG-4 ASP / arc)"     which suggests ASP is part of the MPEG4 video codec.

Whereas avidemux says
MPEG-4 ASP (xvid)
This means that the format is MPEG-4 ASP (or more exactly MPEG-4 Part 2) and the software library selected for encoding (encoder) is Xvid. This was the original logic used in the Avidemux GUI many years ago. Unfortunately, the Avidemux GUI does not follow any logic in these things anymore... It would be nice if these things were improved.

QuoteBut why does it say
MPEG-4 AVC ?
I have heard that  AVC=H.264 which is a video codec.
Why doesn't it say MPEG-4 (AVC) ?
Because it's (or used to be, before the gradual GUI rot)  "format (software encoder)", so in this case the format is MPEG -4 Part 10, AVC, aka H.264, and the software encoder that does the job is x264.

garin

Quote from: J. M. on June 22, 2012, 06:03:05 PM
When you read the MPEG standards or documents, you can see...

where can one read the standards?


styrol mentioned an overview..
http://mpeg.chiariglione.org/standards/mpeg-4/mpeg-4.htm

are they freely available anywhere and if not then how much do they cost to read?

Quote
the format is MPEG-4 ASP and the software library selected for encoding (encoder) is Xvid.

I see, or fully, MPEG-4 Part 2 Advanced Simple Profile (ASP)
When you say format, I see you mean format of the video codec.. rather than format of the container

I see, MPEG-4 Part 14  is the container format.


H.264/MPEG-4 Part 10 or AVC     
and
MPEG-4 Part 2 Advanced Simple Profile (ASP)  (which allows for the Xvid library)

are
formats for video codecs

i think i'm ok so far!

For the H.264/MPEG-4 Part 10 or AVC   video codec format,
  h264 is the H.264 decoder,
  x264 is the encoder

Regarding this video codec format  (MPEG-4 Part 2 Advanced Simple Profile (ASP) )
  xvid is one library..
  is divx a competing library?
  or are xvid and divx actually codecs?

you call xvid a library, and also a codec..  but aren't libraries and codecs different things? and wouldn't they then have different names?



J. M.

Quote from: garin on June 22, 2012, 07:31:44 PM
where can one read the standards?


styrol mentioned an overview..
http://mpeg.chiariglione.org/standards/mpeg-4/mpeg-4.htm
That's not the MPEG standard, it's just an overview posted on that website... The MPEG standards (published by ISO) are not free to read. For example, see the AVC standard:

http://www.iso.org/iso/iso_catalogue/catalogue_ics/catalogue_detail_ics.htm?csnumber=61490

But The H.264 standard, which is maintained by ITU-T, and technically identical to MPEG-4 AVC, is free to read I think:

http://www.itu.int/rec/T-REC-H.264-200305-S/en

QuoteH.264/MPEG-4 Part 10 or AVC     
and
MPEG-4 Part 2 Advanced Simple Profile (ASP)  (which allows for the Xvid library)

are
formats for video codecs

I would simply call it "video formats" or more specifically "video compression formats" (formats of the video bitstream), even though, yes video compression formats are the formats that codecs use for encoding and decoding. See Wikipedia: Video compression format.

QuoteFor the H.264/MPEG-4 Part 10 or AVC   video codec format,
  h264 is the H.264 decoder,
  x264 is the encoder
No. H.264 is the ITU-T name for MPEG-4 Part 10, AVC. So H.264 is the same video compression format as MPEG-4 AVC.

x264 is one of many software or hardware products that can encode video into the H.264 format.

QuoteRegarding this video codec format  (MPEG-4 Part 2 Advanced Simple Profile (ASP) )
  xvid is one library..
Yes. There are other software libraries that can encode and decode MPEG-4 Part 2 video, too.

Quoteis divx a competing library?
This is more complicated. DivX is actually a brand name, not a codec. A brand name for the whole DivX product line developed by the company that was originally called DivXNetworks, then DivX, Inc., now part of Rovi Corporation. For example, the DivX Plus Web Player, DivX Converter, or the DivX (Pro) Codec. "DivX" by itself is not really anything (even though early versions of the DivX Codec used to be called just "DivX").

So yes, the "DivX Codec" is a competing product. It uses the same video compression format as Xvid, FFmpeg MPEG-4 and other products. It can also use MPEG-4 AVC (H.264).

I would recommend reading the "Common myths" chapter in the Avidemux documentation, specifically the whole "Software vs. format, format vs. codec" section. This is something I consider the greatest confusion in the history of computing. There has been so much total nonsense written and said about these things in this century, irreparably confusing whole generations of people, that using correct terms is the only hope that things can get back to normal. In a hundred years.

Quoteor are xvid and divx actually codecs?

you call xvid a library, and also a codec..  but aren't libraries and codecs different things? and wouldn't they then have different names?
Wikipedia, Video codec: "A video codec is a device or software that enables video compression or decompression for digital video."

So a codec can be a hardware device or a piece of software (or a combination of both, like a part of a graphics card combined with a driver). As a piece of software, it can be implemented in two basic ways:

1. As a standalone program
2. As a library

Wikipedia, Library (computing): "In computer science, a library is a collection of resources used to develop software. These may include pre-written code and subroutines, classes, values or type specifications."

In English: a standalone program is something you can use and run by clicking on an icon or typing a command. A library is something that provides functions for programmers to use in their own applications (or libraries). Avidemux uses several libraries for encoding and decoding. Xvid is one of them.

Software codecs are typically implemented as libraries, which means they can be easily used in various applications such as players, editors or converters.

So Xvid is a codec. And a library. Just like Avidemux is a video editor and a computer program. These things are not mutually exclusive.

garin

I see the divx codec for the mpeg-4 part 10/H.264/AVC video compression format, is a different codec to the divx codec  for the mpeg-4 part2 video compression format. 

When I wrote
Quote from: garin
For the H.264/MPEG-4 Part 10 or AVC   video codec format,
  h264 is the H.264 decoder,
  x264 is the encoder

I should've said,  x264 is an encoder, as you say.

But I am not sure how right/wrong I was with the h264 line.

When I mentioned h264, I suppose i'd have been more correct calling h264 (small h no dot), ffmpeg' h264.

or is it standard?

Looks like h264(with small h and no dot) is a decoder for H.264
C:\>ffmpeg -codecs | find /i "h264"
...
D V D  h264            H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

C:\>



If you were to suggest improvements to the avidemux GUI in regard to how it describes video codecs

I see you'd change
  MPEG-4 AVC 
to read 
  MPEG-4 AVC (x264)



Maybe it'd help entice the developers to improve the situation,  if you filled in some others here?
If not it'd at least be a reference for what the settings actually are.

Video
  Copy
  MPEG-4 AVC  <--------  MPEG-4 AVC (x264)
  MPEG-4 ASP (Xvid)
  MPEG-4 ASP (mpeg4)
  MPEG-2 (mpeg2video)
  MPEG-2 (mpeg2enc)
  MPEG-2 requant
  MPEG-1 (mpeg1video)
  MPEG-1 (mpeg2enc)
  M-JPEG
  H.263
  Sorenson Spark
  DV
  Huffyuv
  FFVHuff
  FFV1
  YV12 (raw)




J. M.

Quote from: garin on June 22, 2012, 11:08:51 PMWhen I wrote
Quote from: garin
For the H.264/MPEG-4 Part 10 or AVC   video codec format,
  h264 is the H.264 decoder,
  x264 is the encoder

I should've said,  x264 is an encoder, as you say.

But I am not sure how right/wrong I was with the h264 line.

When I mentioned h264, I suppose i'd have been more correct calling h264 (small h no dot), ffmpeg' h264.

or is it standard?

Looks like h264(with small h and no dot) is a decoder for H.264
C:\>ffmpeg -codecs | find /i "h264"
...
D V D  h264            H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10

C:\>

Well, that's only the internal naming in the FFmpeg list, that does not mean the decoder is called like that. I'm not sure the FFmpeg decoders and encoders even have a name. I think it is simply the FFmpeg (or libavcodec) H.264 decoder. libavcodec is a single codec library providing decoders and encoders for many formats.

But yes, in Avidemux (and almost all other multimedia free software), the H.264 decoder from FFmpeg (or the Libav fork) is used.

QuoteIf you were to suggest improvements to the avidemux GUI in regard to how it describes video codecs

I see you'd change
  MPEG-4 AVC 
to read 
  MPEG-4 AVC (x264)


No, actually that's the way it was suggested and implemented back in 2005. But after so many years, the Avidemux GUI gradually got to a state where these things don't make any sense anymore, they don't follow any logic, either correct or even wrong, it is simply random and does not make sense.

What I actually suggested a couple of years ago was something that I think is better than the original version from 2005. But each time I upload a screenshot, the picture gets deleted from the server after some time of inactivity, and it gets forgotten. :)

So my suggestion actually looked like this (old version on the left, suggested new version on the right), in an attempt to make it absolutely and uncompromisingly clear to the user what is what (it is just an idea; from a GUI design point of view, these two-line items can be seen as problematic):



QuoteMaybe it'd help entice the developers to improve the situation,  if you filled in some others here?
If not it'd at least be a reference for what the settings actually are.

Video
  Copy
  MPEG-4 AVC  <--------  MPEG-4 AVC (x264)
  MPEG-4 ASP (Xvid)
  MPEG-4 ASP (mpeg4)
  MPEG-2 (mpeg2video)
  MPEG-2 (mpeg2enc)
  MPEG-2 requant
  MPEG-1 (mpeg1video)
  MPEG-1 (mpeg2enc)
  M-JPEG
  H.263
  Sorenson Spark
  DV
  Huffyuv
  FFVHuff
  FFV1
  YV12 (raw)

Yes, MPEG-4 AVC (x264) would be correct in the old way. Or MPEG-4 Part 10 (x264), or H.264 (x264)... But like I said, I would get rid of the old naming. It is not clear enough.

For most of the other items without brackets, there should be (libavcodec) or (FFmpeg) or something like that, as the libavcodec library from FFmpeg is used. Especially the "MPEG-4 ASP (mpeg4)" item in Avidemux 2.5 is nonsense. Or in Avidemux 2.6, "Mpeg4 ASP (ff)" (meaning "the MPEG-4 encoder from FFmpeg") and then "FLV1(flash)" (meaning "FLV1 is used in FlashVideo") in Avidemux 2.6. That's just logical collision. One more reason to get rid of the parentheses.

garin

I'm just reading the link styrol mentioned . again
http://www.avidemux.org/smf/index.php?topic=10188
v helpful..


some GUI comments here
http://www.avidemux.org/smf/index.php?topic=10735.0


By the way.. maybe you or styrol    can point me in the right direction on this one.. styrol mentioned, "MP4 (MPEG-4 ASP / arc)" 
Where is the arc audio codec..?
I don't see it in avidemux, or ffmpeg.

or is arc a format for audio codecs? in which case, what are the encoders or codecs for it?

J. M.

Quote from: garin on June 23, 2012, 12:42:00 AMby specifying the profile for mpeg-4  I suppose that may seem a bit of an exception, but really, mpeg-4 conventions seem to be ugly as sin..
one could know that there are 2   mpeg-4 formats.. one has many profile names..
Yeah, the MPEG naming is definitely a bit ugly. But that was not the main point, what I was trying to suggest was that there should be single, clear logic consistently applied throughout the whole GUI. And whether it's called AVC, Part 10 or whatever... That's just a detail. (As long as it's correct, of course.)

QuoteMPEG-4 ASP  would point to one of those formats. (not perfect as ASP is a profile, but one can know that.. and colloquially I suppose people say MPEG-4 ASP and know what they mean)
But you can also encode SP video... MPEG-4 Part 2 includes both SP and ASP.
 
QuotePutting mpeg4 in parentheses is fine but one could say  ff-mpeg4  just to show that it's ffmpeg's  mpeg4.   Putting libavcodec in parentheses isn't that useful as it refers to ffmpeg's whole library of codecs.
Yes, but FFmpeg/libavcodec itself refers to them as such, libavcodec is a single library.

Quoteffmpeg does name each codec so if using libavcodec and using for example, mpeg4 then ff-mpeg4 is good and completely clear.
I can't see the FFmpeg codecs named anywhere. Not in the official documentation, not on the official website, not in the source code (I just checked: the source code for the FFmpeg MPEG-4 encoder says "MPEG4 encoder", that is, just a generic info that this file is responsible for MPEG-4 video encoding). A command-line option like "mpeg4" is just a command-line option. Just like, for example, "avidemux3_qt4" is not the name of the Avidemux application, it is just a name of the executable file. Or the "FFmpeg4" option in the list of Avidemux video commands does not mean the name of the encoder is "FFmpeg4", it only means it is called like that in the internal list of command-line options in Avidemux.

The problem with "ff-mpeg4" is that this is a unique name nobody else uses. It may be completely clear to us, but the average user will not have a clue. That's why I would avoid inventing unique names and stick to the exact, correct, real full names and terms, which are unambiguous, "searchable" (or "googlable"), clear, understandable, official, shared by the rest of the world, and well documented.

Quoteit's listed by ffmpeg, very specifically.

C:\>ffmpeg -codecs | find /i "mpeg4"
DEVSDT mpeg4           MPEG-4 part 2
DEVSD  msmpeg4         MPEG-4 part 2 Microsoft variant version 3
DEVSD  msmpeg4v1       MPEG-4 part 2 Microsoft variant version 1
DEVSD  msmpeg4v2       MPEG-4 part 2 Microsoft variant version 2
Again, that's a list of inernal command-line switches in the FFmpeg application ("ffmpeg.exe" or just "ffmpeg"), which is a frontend to libavcodec and other libraries (Avidemux, MPlayer, MEncoder, VLC and other are frontends using libavcodec and other libraries, too, with their own internal command-line switches), not a list of official codec names. A command-line switch like "FFmpeg MPEG-4" would not be practical, that's why command-line options in programs usually use these shortened lower-case strings with no spaces or hyphens.

Names of software products are not defined in command-line options or file names, they are defined in the official documents, on the product website, sometimes registered as trademarks etc.

QuoteWhy not   Flash(ff-flv)

I don't see why something like that with parentheses needs to be nonsensical.
It does not have to be nonsensical (it wasn't in 2005, when the GUI was implemented cleanly), but it is now (because after 7 years, there have been too many inconsistent and illogical GUI tweaks).

For "Flash(ff-flv)"... Well, Flash is a name of the Adobe technology. Not a name of a video format. Again, I am not trying to suggest any particular names, what I would really like to see is that strict, correct logic is followed - and consistently. When one parentheses says "Flash" (technology), another one says "ff" (a software product), and yet another one does not say anything... That's not consistent or logical. That's just a mess.

The problem with the parenthesis is that people have no idea what they are supposed to mean (even if it's explained in the documentation, but people don't read it). They don't understand the logic behind it. It may not even occur to them that there is supposed to be some logic behind it... I've been reading this forum for many years...:)

QuoteIn your screenshot of the style you suggest, why is the Input(Left hand side),in a different format to the output?

Like on the left hand side you say MPEG-4 ASP.. (you include the profile you don't write the part)  and on the right hand side you write MPEG-4 Part 2. i.e. you write the part and don't write the profile
They list the same formats. ASP belongs to Part 2. The ASP vs. Part 2 change is only because the picture was initially used for that "Why call MPEG4 part 2 'ASP'"?" thread styrol mentioned before (the picture got deleted from the server since then). Again, that was not the point of the picture. :) The point was not whether to call it ASP or Part 2, the suggestion was about consistency and logic. Making it clear to the user that what they select in the drop-down list is a software encoder, which implies the output format. That these are two separate things. Most people do not understand this concept at all. Most people just know the word "codec" without actually having an idea what that means. That's why most people think that when they use Xvid, they are encoding "a Xvid file". This is exactly the distinction that this suggestion is trying to make.

J. M.

Quote from: garin on June 23, 2012, 12:42:00 AMsome GUI comments here
http://www.avidemux.org/smf/index.php?topic=10735.0
OK, let's continue there to avoid duplication...

QuoteBy the way.. maybe you or styrol    can point me in the right direction on this one.. styrol mentioned, "MP4 (MPEG-4 ASP / arc)" 
Where is the arc audio codec..?
I don't see it in avidemux, or ffmpeg.

or is arc a format for audio codecs? in which case, what are the encoders or codecs for it?
I can't see styrol mentioning it anywhere... Maybe just a typo?

garin