Jump to content

mkv vs mp4 vs avi vs flv ?

Go to solution Solved by mariushm,

These are not video formats, the correct terminology is movie containers

 

These files contain

* at least one or several video streams compressed using various video codecs

* at least one but can be  several audio streams compressed with various audio codecs (to reduce file size) - think standard 5.1 audio, second track stereo audio in case the hardware player can't play 5.1 content , then maybe an audio track with director's commentary and so on, then maybe movie dubbed in some foreign language for those who have difficulties reading subtitles

* none, or some number of subtitles (normal or for hearing impaired people, with or without additional stuff like embedded fonts for japanese characters and so on)

* chapter information (to make it possible to jump in the video at the beginning of certain scenes)

 

These file formats pack the above information in such a way that it makes it possible for movie players to just jump at a random position in the file and start splitting the content read from file into the essential elements and play only those essential elements. It makes it possible to play incomplete downloads, it makes it possible to quickly jump somewhere in a movie and so on.

 

AVI is one of the oldest movie containers and as such has some limitations .. it can only hold one video track and as far as I know it can only have two audio tracks. You can't add subtitles in an AVI file and because it's so old, there are also some limitations about how data is stored inside the file and what video and audio codecs can do to compress the content more efficiently.

 

The AVI format wasn't really designed to account for modern compression techniques that were implemented in video codecs like XVID or h264 for example, or audio codecs like MP3 or AAC - programmers were smart enough to make workarounds and clever hacks to make these codecs work with the limitations of the AVI format but basically, this file container is outdated and not recommended to be used anymore.

 

FLV is short for Flash Video, it was a container format invented by Apple where you could mix video and audio compressed using a limited number of codecs. The Flash designers needed this because at that time, there was no alternative for what they wanted to do - one of their video codecs could compress transparency as well, allowing for designers to easily record movies and define some portions of the movies as transparent and then overlay these movies over some parts of the Flash presentation (think people talking in front of green screen and then when compressing, you told the video codec to ignore the green color and make that portion transparent)

They also needed a simple container format that would allow them to connect to a web cam and a microphone and record camera and microphone, combine them quickly into a format they know and upload that data to a website that had the Flash object on it.  This would have been very difficult to do with AVI or MPG , which were the containers that were available back then.

 

Nowadays, most FLV files you'd see are basically just MP4 files that have the video part compressed with h264 video codec and the audio part either MP3 or AAC. Basically, they just rename a MP4 file and change the extension to FLV. Technically, these FLV files are not true FLV files but the Flash player checks inside the file for specific signatures and recognizes what format the file actually is and plays them right.

 

MP4 is a file container that's much better for streaming, it's organized into "atoms" which are basically chunks of data, so if by some accident a chunk is corrupted during download the video player can always just continue to download data until the start of a new chunk is found and then resume decoding.

It's better than AVI in the sense that video and audio codecs aren't so restricted, but on the downside only a few video codecs and audio codecs are permitted inside MP4 containers. The majority of mp4 files will have the video compressed using h264 and the audio part compressed with AAC or AC3.

It has limited support for subtitles, only a limited number of subtitle formats is supported.

 

MKV is the most modern and versatile container, it can bundle several video tracks, lots of audio tracks, subtitles, chapters, and was designed from the start to be extendable easily when new video codecs or audio codecs are designed.

WEBM is basically a subset of MKV, a MKV container with a few restrictions to simplify it.

 

You can read more here about various containers : https://en.wikipedia.org/wiki/Comparison_of_video_container_formats

 

Hello all, 

I am quite confused with the different video formats like mkv, mp4, avi, flv etc. Whats the difference?
So, which is the best one? 

And where to use which video formats?

Link to comment
Share on other sites

Link to post
Share on other sites

These are not video formats, the correct terminology is movie containers

 

These files contain

* at least one or several video streams compressed using various video codecs

* at least one but can be  several audio streams compressed with various audio codecs (to reduce file size) - think standard 5.1 audio, second track stereo audio in case the hardware player can't play 5.1 content , then maybe an audio track with director's commentary and so on, then maybe movie dubbed in some foreign language for those who have difficulties reading subtitles

* none, or some number of subtitles (normal or for hearing impaired people, with or without additional stuff like embedded fonts for japanese characters and so on)

* chapter information (to make it possible to jump in the video at the beginning of certain scenes)

 

These file formats pack the above information in such a way that it makes it possible for movie players to just jump at a random position in the file and start splitting the content read from file into the essential elements and play only those essential elements. It makes it possible to play incomplete downloads, it makes it possible to quickly jump somewhere in a movie and so on.

 

AVI is one of the oldest movie containers and as such has some limitations .. it can only hold one video track and as far as I know it can only have two audio tracks. You can't add subtitles in an AVI file and because it's so old, there are also some limitations about how data is stored inside the file and what video and audio codecs can do to compress the content more efficiently.

 

The AVI format wasn't really designed to account for modern compression techniques that were implemented in video codecs like XVID or h264 for example, or audio codecs like MP3 or AAC - programmers were smart enough to make workarounds and clever hacks to make these codecs work with the limitations of the AVI format but basically, this file container is outdated and not recommended to be used anymore.

 

FLV is short for Flash Video, it was a container format invented by Apple where you could mix video and audio compressed using a limited number of codecs. The Flash designers needed this because at that time, there was no alternative for what they wanted to do - one of their video codecs could compress transparency as well, allowing for designers to easily record movies and define some portions of the movies as transparent and then overlay these movies over some parts of the Flash presentation (think people talking in front of green screen and then when compressing, you told the video codec to ignore the green color and make that portion transparent)

They also needed a simple container format that would allow them to connect to a web cam and a microphone and record camera and microphone, combine them quickly into a format they know and upload that data to a website that had the Flash object on it.  This would have been very difficult to do with AVI or MPG , which were the containers that were available back then.

 

Nowadays, most FLV files you'd see are basically just MP4 files that have the video part compressed with h264 video codec and the audio part either MP3 or AAC. Basically, they just rename a MP4 file and change the extension to FLV. Technically, these FLV files are not true FLV files but the Flash player checks inside the file for specific signatures and recognizes what format the file actually is and plays them right.

 

MP4 is a file container that's much better for streaming, it's organized into "atoms" which are basically chunks of data, so if by some accident a chunk is corrupted during download the video player can always just continue to download data until the start of a new chunk is found and then resume decoding.

It's better than AVI in the sense that video and audio codecs aren't so restricted, but on the downside only a few video codecs and audio codecs are permitted inside MP4 containers. The majority of mp4 files will have the video compressed using h264 and the audio part compressed with AAC or AC3.

It has limited support for subtitles, only a limited number of subtitle formats is supported.

 

MKV is the most modern and versatile container, it can bundle several video tracks, lots of audio tracks, subtitles, chapters, and was designed from the start to be extendable easily when new video codecs or audio codecs are designed.

WEBM is basically a subset of MKV, a MKV container with a few restrictions to simplify it.

 

You can read more here about various containers : https://en.wikipedia.org/wiki/Comparison_of_video_container_formats

 

Link to comment
Share on other sites

Link to post
Share on other sites

These file types are actually containers. You can find out about codecs and containers here.

 

.AVI is 'Audio Video Interleaved'; a container designed by Microsoft in 1992. Modern compression techniques and new video codecs have left this in the dust. It's utterly outdated and I don't recommend it.

.FLV is Flash Video. Most embedded online streaming services like YouTube or Hulu use play videos. They essentially convert any uploaded videos to .FLV videos, so you don't need to do that yourself, and most sites recommend uploading MP4 anyway. Don't bother rendering as FLV unless you have to put the video into a Flash creation yourself.

Now for the two formats I think are still relevant for the user.

 

.MP4 is the most commonly used video container. It's short for MPEG-4, and is the successor to older containers like MPEG-1, MPEG-2 etc. It's the most widely compatible container for portable players, and will work on anything. You can encode audio, video, chapters, information, and subtitles into a .MP4 file, and it supports all all of the most common video codecs (H.264, MPEG-4 AVC, MPEG-2, VC-1, and many more). It also supports all the most common audio codecs (MP3, M4A, AAC, AC3, Apple Lossless). It's what virtually everyone uses to share videos online, and I'd recommend rendering videos using H.264 and AAC in the MP4 container for sharing and online publication, as they're the most widely-used. The downside is limited support for codecs (although it covers the most common ones) and limited support for subtitles.

.MKV, or Matroska Multimedia Container, is an open-source media container that has the widest support for codecs. However, it isn't as widely compatible with portable devices etc., although this is quickly changing (many smart TVs now support .MKV containers). You'll find that a lot of Blu-Ray rips (audiovisual data from Blu Rays or even DVDs extracted to a single file) use the .MKV container as it can support an unlimited number of video tracks, audio tracks, virtually every codec under the sun, and has the best support for subtitles, allowing for more 'decorated' subtitles to be stored in files (the kind you may see in Japanese Anime openings).

I'd only use this if you need that additional support for subtitles, want more audio or video tracks in the single video, or want to rip a Blu-Ray disc and retain all the information. If you're just rendering videos you edit, then there's no need- just use the MP4 container.

Link to comment
Share on other sites

Link to post
Share on other sites

21 minutes ago, mariushm said:

These are not video formats, the correct terminology is movie containers

 

These files contain

* at least one or several video streams compressed using various video codecs

* at least one but can be  several audio streams compressed with various audio codecs (to reduce file size) - think standard 5.1 audio, second track stereo audio in case the hardware player can't play 5.1 content , then maybe an audio track with director's commentary and so on, then maybe movie dubbed in some foreign language for those who have difficulties reading subtitles

* none, or some number of subtitles (normal or for hearing impaired people, with or without additional stuff like embedded fonts for japanese characters and so on)

* chapter information (to make it possible to jump in the video at the beginning of certain scenes)

 

These file formats pack the above information in such a way that it makes it possible for movie players to just jump at a random position in the file and start splitting the content read from file into the essential elements and play only those essential elements. It makes it possible to play incomplete downloads, it makes it possible to quickly jump somewhere in a movie and so on.

 

AVI is one of the oldest movie containers and as such has some limitations .. it can only hold one video track and as far as I know it can only have two audio tracks. You can't add subtitles in an AVI file and because it's so old, there are also some limitations about how data is stored inside the file and what video and audio codecs can do to compress the content more efficiently.

 

The AVI format wasn't really designed to account for modern compression techniques that were implemented in video codecs like XVID or h264 for example, or audio codecs like MP3 or AAC - programmers were smart enough to make workarounds and clever hacks to make these codecs work with the limitations of the AVI format but basically, this file container is outdated and not recommended to be used anymore.

 

FLV is short for Flash Video, it was a container format invented by Apple where you could mix video and audio compressed using a limited number of codecs. The Flash designers needed this because at that time, there was no alternative for what they wanted to do - one of their video codecs could compress transparency as well, allowing for designers to easily record movies and define some portions of the movies as transparent and then overlay these movies over some parts of the Flash presentation (think people talking in front of green screen and then when compressing, you told the video codec to ignore the green color and make that portion transparent)

They also needed a simple container format that would allow them to connect to a web cam and a microphone and record camera and microphone, combine them quickly into a format they know and upload that data to a website that had the Flash object on it.  This would have been very difficult to do with AVI or MPG , which were the containers that were available back then.

 

Nowadays, most FLV files you'd see are basically just MP4 files that have the video part compressed with h264 video codec and the audio part either MP3 or AAC. Basically, they just rename a MP4 file and change the extension to FLV. Technically, these FLV files are not true FLV files but the Flash player checks inside the file for specific signatures and recognizes what format the file actually is and plays them right.

 

MP4 is a file container that's much better for streaming, it's organized into "atoms" which are basically chunks of data, so if by some accident a chunk is corrupted during download the video player can always just continue to download data until the start of a new chunk is found and then resume decoding.

It's better than AVI in the sense that video and audio codecs aren't so restricted, but on the downside only a few video codecs and audio codecs are permitted inside MP4 containers. The majority of mp4 files will have the video compressed using h264 and the audio part compressed with AAC or AC3.

It has limited support for subtitles, only a limited number of subtitle formats is supported.

 

MKV is the most modern and versatile container, it can bundle several video tracks, lots of audio tracks, subtitles, chapters, and was designed from the start to be extendable easily when new video codecs or audio codecs are designed.

WEBM is basically a subset of MKV, a MKV container with a few restrictions to simplify it.

 

You can read more here about various containers : https://en.wikipedia.org/wiki/Comparison_of_video_container_formats

 

 

8 minutes ago, Aereldor said:

These file types are actually containers. You can find out about codecs and containers here.

 

.AVI is 'Audio Video Interleaved'; a container designed by Microsoft in 1992. Modern compression techniques and new video codecs have left this in the dust. It's utterly outdated and I don't recommend it.

.FLV is Flash Video. Most embedded online streaming services like YouTube or Hulu use play videos. They essentially convert any uploaded videos to .FLV videos, so you don't need to do that yourself, and most sites recommend uploading MP4 anyway. Don't bother rendering as FLV unless you have to put the video into a Flash creation yourself.

Now for the two formats I think are still relevant for the user.

 

.MP4 is the most commonly used video container. It's short for MPEG-4, and is the successor to older containers like MPEG-1, MPEG-2 etc. It's the most widely compatible container for portable players, and will work on anything. You can encode audio, video, chapters, information, and subtitles into a .MP4 file, and it supports all all of the most common video codecs (H.264, MPEG-4 AVC, MPEG-2, VC-1, and many more). It also supports all the most common audio codecs (MP3, M4A, AAC, AC3, Apple Lossless). It's what virtually everyone uses to share videos online, and I'd recommend rendering videos using H.264 and AAC in the MP4 container for sharing and online publication, as they're the most widely-used. The downside is limited support for codecs (although it covers the most common ones) and limited support for subtitles.

.MKV, or Matroska Multimedia Container, is an open-source media container that has the widest support for codecs. However, it isn't as widely compatible with portable devices etc., although this is quickly changing (many smart TVs now support .MKV containers). You'll find that a lot of Blu-Ray rips (audiovisual data from Blu Rays or even DVDs extracted to a single file) use the .MKV container as it can support an unlimited number of video tracks, audio tracks, virtually every codec under the sun, and has the best support for subtitles, allowing for more 'decorated' subtitles to be stored in files (the kind you may see in Japanese Anime openings).

I'd only use this if you need that additional support for subtitles, want more audio or video tracks in the single video, or want to rip a Blu-Ray disc and retain all the information. If you're just rendering videos you edit, then there's no need- just use the MP4 container.

I have noticed one thing that the file size of .mkv is significantly less than that of mp4.

Link to comment
Share on other sites

Link to post
Share on other sites

38 minutes ago, 4klips said:

 

I have noticed one thing that the file size of .mkv is significantly less than that of mp4.

That has nothing to do with the container type. It's unrelated....

 

Here's an example of the versatility of MKV format, you can't do this in MP4 ( use a modern video player like MPC-HC and enable subtitles and switch between subtitles, right click on image and use the Subtitle menu) :

 

 

 

 

Edited by mariushm
deleted demonstrative clip as may be copyright infringing
Link to comment
Share on other sites

Link to post
Share on other sites

25 minutes ago, 4klips said:

 

I have noticed one thing that the file size of .mkv is significantly less than that of mp4.

That's a silly comparison. The container itself doesn't make much of a difference. If anything, MP4 is more lightweight, as MKV needs more resources to store all the additional media it contains. The container alone isn't a good way to compare.

 

Here's how you can compare them.

  • Take two files (one MKV, one MP4) that have the same number of audio, video, and subtitle tracks.
  • Make sure they both have the same video resolution and the same video bitrate.
  • Make sure they both have the same audio bitrate.
  • Watch and listen to them both carefully, and assess which one is better quality. pause on the same individual frames and compare details.

MKV is theoretically capable of more efficient compression as it supports the powerful new H.265 codec, but again, it comes down to the codecs used more than anything. 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, mariushm said:

That has nothing to do with the container type. It's unrelated....

 

Here's an example of the versatility of MKV format, you can't do this in MP4 ( use a modern video player like MPC-HC and enable subtitles and switch between subtitles, right click on image and use the Subtitle menu) :

 

Suzumiya_Haruhi_no_Yuuutsu_-_C4_-_Special_Ending_-__Hitsuji__e569a2b7_ (1).mkv

 

 

All good, but you're sharing rips copyrighted content and violating the forum's code of conduct on piracy. If I recognize it, that file is from a DVDRIP torrent. You can't post pirated content here.
 

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, mariushm said:

That has nothing to do with the container type. It's unrelated....

 

Here's an example of the versatility of MKV format, you can't do this in MP4 ( use a modern video player like MPC-HC and enable subtitles and switch between subtitles, right click on image and use the Subtitle menu) :

 

Suzumiya_Haruhi_no_Yuuutsu_-_C4_-_Special_Ending_-__Hitsuji__e569a2b7_ (1).mkv

 

 

All good, but you're sharing rips copyrighted content and violating the forum's code of conduct on piracy. If I recognize it, that file is from a DVDRIP torrent. You can't post pirated content here.
 

 

Link to comment
Share on other sites

Link to post
Share on other sites

22 minutes ago, 4klips said:

-snip-

Also, 'snip' your quotes like I just did. Don't quote long-ass replies; it messes up the layout and makes it harder to read through threads. Or just 'mention' the concerned users with '@' like this- @Aereldor

Link to comment
Share on other sites

Link to post
Share on other sites

Quote

All good, but you're sharing rips copyrighted content and violating the forum's code of conduct on piracy. If I recognize it, that file is from a DVDRIP torrent. You can't post pirated content here.

 

It fits into fair use..  it's a short segment at 1 minute , it's reduced quality ( 420 something x 240 pixels, 64 kbps audio) and it's used to teach something, to illustrate my point, not to sell or make money off it and there's practically no chance of me depriving the makers of that cartoon from any revenue (it's not like someone would have bought the DVD just for that song and now they lost a sale because of me).

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, mariushm said:

 

It fits into fair use..  it's a short segment at 1 minute , it's reduced quality ( 420 something x 240 pixels, 64 kbps audio) and it's used to teach something, to illustrate my point, not to sell or make money off it and there's practically no chance of me depriving the makers of that cartoon from any revenue (it's not like someone would have bought the DVD just for that song and now they lost a sale because of me).

 

 

 

Look, I don't really care about the broader legal argument. The CoC doesn't define exceptions here, so you can take it up with a mod. I just wanted to let you know the terms of this forum. What you posted is still pirated content.

Read below. The community standards can be found in the bar at the top of the forum interface, and I linked them in my previous reply.

On 1/20/2016 at 6:22 AM, Windspeed36 said:

Community Standards

  • Generally speaking, as long as the following rules are met you should never find yourself subject to disciplinary action:
  • Ensure a friendly atmosphere to our visitors and forum members.
  • Encourage the freedom of expression and exchange of information in a mature and responsible manner.
  • "Don't be a dick" - Wil Wheaton.
  • "Be excellent to each other" - Bill and Ted.
  • Remember your audience; both present and future.
  • The following is not an exhaustive list of the rules and guidelines that must be followed when participating on Linus Tech Tips. The administration and moderation team reserve the right to terminate any and all accounts or remove any content at any stage without prior notice. The rules outlined below are only the minimum expectations of members, and not every issue can be predicted and addressed here, so conduct could still be considered out of line even if it isn't covered here specifically. The instructions of the moderation team must be followed at all times.
  • No harassment, discrimination or abuse of any kind.
    • This includes insults, fanboy, or troll accusations
  • No pornography or sexually explicit material
  • No spam
    • ‘LMGTFY’ links
    • Post count/reputation farming
    • 'Ask Me Anything’ threads
    • Tagging things as 'repost' or 'reported'
  • No Trolling
    • This includes flame wars such as NVIDIA vs AMD, political or religious debate.
  • No advertising of any non LTT/LMG material
    • eBay/trading sites, personal websites or businesses except where appropriate. (Eg who can do data recovery in Vancouver)
    • Twitch/YouTube links are only allowed in user profile status updates
  • Talking about piracy in general, broad details, is acceptable however the posting or discussing pirated/hacked/cracked or otherwise nefariously obtained content is not. This includes Windows content, games, hackintosh, etc. Also discussions regarding ways to avoid or block legitimately installed monitoring/tracking software or the like is also not allowed.
Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, mariushm said:

 

It fits into fair use..  it's a short segment at 1 minute , it's reduced quality ( 420 something x 240 pixels, 64 kbps audio) and it's used to teach something, to illustrate my point, not to sell or make money off it and there's practically no chance of me depriving the makers of that cartoon from any revenue (it's not like someone would have bought the DVD just for that song and now they lost a sale because of me).

 

 

 

Agreed!

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

29 minutes ago, AkiraDaarkst said:

Agreed!

That's the law, but this forum has its own community standards, and sharing pirated content of any form is strictly against it. 

By all means, go on and share pirated content if you want. Maybe you can use the above as a defense if it's seen by a mod or admin.

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, 4klips said:

Hello all, 

I am quite confused with the different video formats like mkv, mp4, avi, flv etc. Whats the difference?
So, which is the best one? 

And where to use which video formats?

Here. hope this video also helps you out.  This video doesn't explain the pros and cons of each container, simply that you should select an appropriate container for what you want to do with the videos.

 

 

 

32 minutes ago, Aereldor said:

That's the law, but this forum has its own community standards, and sharing pirated content of any form is strictly against it. 

By all means, go on and share pirated content if you want. Maybe you can use the above as a defense if it's seen by a mod or admin.

LMAO!!!!!!!!!

That is not dead which can eternal lie.  And with strange aeons even death may die. - The Call of Cthulhu

A university is not a "safe space". If you need a safe space, leave, go home, hug your teddy & suck your thumb until ready for university.  - Richard Dawkins

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×