user6197: 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?

user3908: 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.

user4943: 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.

6197: <p>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. </p>

<p>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. </p>

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

<p>Would I loose any quality if I convert them?</p>
 3908: <p>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.</p>
 4943: <p>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.</p>

<p>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.</p>

<p>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.</p>

<p>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.</p>

<p>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.</p>
