I have a lot of *.avi files with either 1 audio track or several. All of them are mp3 encoded. The video codec is xvid4.

However, when I play these avi files I can choose between the audio tracks (if there is more than 1 audio track) but they are named "audio track 1", "audio track 2" and so on.

That's why I want to convert them into mkv files since they support audio track names.

Would I loose any quality if I convert them?

2 Answers 2


AVI and MKV are both containers, so in theory it should be possible to transfer your contents with no further loss. I can't say for certain if MKV can wrap xvid4, but it's very likely. You shouldn't need to decode / re-encode to transfer the contents, just demux / remux.

  • I used mkvmerge for the muxing. Thanks. seems like the audio and video quality are still the same.
    – Davlog
    Jul 16, 2014 at 15:48

As Jim Mack has correctly pointed out MKV (Matroska) and AVI are containers, and are both able to store many of the same streams without any change to the streams themselves, and thus the remuxing should be lossless.

But there is one time where data is lost when remuxing from AVI to MKV. The thing is that some poor encoders in the day of AVI have created technically playable AVI files which had some garbage data in one of the streams for part of the time. They used that rather than setting up timestamp offset.

Most AVI-to-MKV remuxers (like mkvtools) will take such garbage data and assume that it can be converted into the offset, when such garbage happens in the beginning. However, in some rare cases this may not work, for example when the bitrate of the stream with garbage in it is variable. This causes timestamps to be badly shifted.

If the garbage occurs only in the beginning, the problem is easily resolved by editing the header of Matroska file, and changing the offset manually until the streams match. However, if the garbage occurs several times, then remuxer will just dump the garbage and the timestamps cannot be fixed that easily any longer.

Now, this doesn't happen for most files, but some "old school" Whatever-to-AVI may produce such thing. And it is important to know, since even losing "garbage" is by definition lossy when it translates to metadata change.


Not the answer you're looking for? Browse other questions tagged or ask your own question.