AVI does not work nice but MKV does?

Hi
I have Before running Plex Media Server on a old windows computer.

Now I have move on to a little more powerfull computer and also running with Linux (Ubuntu server)
and now I have notice something strange.

When I play a AVI file (Divx/Xvid) it have big problem to play the file. It just play and then stop, and then play and then stop…
But if I do a mux so it have MKV with (MKVToolNix) and is still have Divx/Xvid as codec Everything works fine.

Not sure why, I can understand if I convert the file from Divx/Xvid to H.264 but I have not done that. I did just put it in a MKV instead.

So if that any easy and nice way how to fix it or do I have to mux every AVI file I have :slight_smile:

AVI is a very old and decrepit file format. You are doing well to get rid of it.

hmm well yes but it is strange that
Divx/Xvid + AVI = Bad
Divx/Xvid + MKV = OK

1 Like

Seriously, that’s the best answer a plex ninja moderator can respond with?
Way to go with the help and supportive nature of the plex community!!!

1 Like

It may be strange, but no less true.

That was not only a good answer but it is also correct and the best advice for anyone still having avi files in their library.

While my servers are more than able to handle whatever is thrown at them I, long ago, converted all my avi files that I had from years ago to mp4s or mkvs. (Mostly mp4s for compatibility reasons.)

Since it is possible to automate the conversion using readily available tools there really is no good reason to keep any avi files in a library.

2 Likes

I don’t see why you think changing from an AVI container to an MP4 or MKV container for a library of historical content is somehow an improvement? Sure newer container formats CAN be better for holding newer encoding formats, subs, metadata, etc but there is no real gain in just moving the existing streams from AVI to MKV and there should be no need to

…and yet the person who started the thread says there is.

1 Like

lol. Yes clearly there is a benefit in avoiding some kind of bug which is causing his problem, but that wasnt the point of the question was it? I’m surprised you didnt just suggest the OP watches content available on web shows and forgets owning any media at all!
Q: This isnt working properly but it always used to, do I really have to change all my media containers to make it still work?
A: Your a dinosaur and you should just keep changing your media because we think its much easier than trying to identify the problem.

This thread is going so off topic I am sure the OP is feeling the plex love!

My whole point is a more appropriate response from a Plex Ninja to the original post would have been something like “Thats not an issue I know about, please provide more detail on which client you are using so other people who still play AVI files can help narrow down the problem. Can you provide some logs. You might want to try forcing transcoding on your client or try a different one if available for the hardware”

Still you guys clearly know best…cant wait till some random bug blows your setup out the water!

For me is that is just so strange.
The tips to make it into MKV is from another users that did have problem to show the file on another system (I do not think it was a Plex system).

I can do that, convert the AVI to MKV but it is a little work :slight_smile: so that why I was wonder if that was possible so I do not need to do that.
It does not feel right to have Divx/Xvid in MKV container.

Which client are you using and have you tried another?

Rasplex and only that.

Oh. I haven’t used that since Pi B came out. Are you able to force transcode to see if it makes a difference?

have not done that, have no idea where to do it so I guess I have to search for it and try it tomorrow :slight_smile:

Most likely your AVI was damaged. When a media player, such as Rasplex, plays an AVI file, the normal mechanism is to read the index at the end of the file and play from the samples in the index. When you remuxed into an MKV file, the remuxer doesn’t read the index but instead reads the compressed frames in the file linearly from the beginning. So if your file had damage in the index, you would see the behavior you described.

As an aside, AVI is not a well designed format. The mov/mp4 format is actually older than AVI and is vastly better designed from the beginning (which is why it’s still in use today while AVI is not). Much of the AVI playback issues result from people hacking things into the format that it just never could have supported correctly. These include out-of-order-decoding (used by MPEG2/DivX/Xvid and all newer codecs), multi-channel audio (anything more than stereo), and multiple audio tracks. Funny enough, all three of those are supported in mov/mp4 without hacks (and, of course, MKV supports them too). So it’s possible, though less likely, your problem is due to one of these hacks.

1 Like

For those that want the most reliable and playable on the most clients convert EVERYTHING to mp4.

It really is that simple.

There are shiploads of software that can convert avi to MP4.
Who cares how long it takes to convert your library. Just do it

Can that really be correct? The file is streamed to RasPlex which is the client. To me that implies that RasPlex has no access to the end of the file. I would suspect that it is the server which has problems to chunk the streams such that they can be streamed via HLS.

I seems to me that it comes to the conclusion that it better to transcode than to serve the original streams.

I am just curious and willing to learn.

That is true I can convert all my AVI to MP4 (well h.264 and MKV) but not sure what kind of settings.
I do not want to loose to much of the quality (well is not so good now but I do not want to make it worse) and I do not like to make the file larger but preferably smaller or the same size

Maybe but I have try with more then one AVI file.

When the client is direct playing (Rasplex can DP AVI files), the client issues HTTP range requests. It’s fairly common among multiple kinds of media for the client to read the first bit of the media (say 1MB) so it gets the byte offset for the index at the end, issue another HTTP request with a range to read that index, then issue another request to continue reading the file from the beginning. The same happens with MOV/MP4 and MKV files.

There is no HLS involved when the client is direct playing.

If the transcode involves a seek (you resume playback instead of start from beginning), it could potentially run into the same issue with a broken file. Note: The transcoder is using the same backend library as Rasplex to read the media (FFmpeg).

As per converting your library, that’s a decision you have to make but I tend to be against doing so. If you are doing anything other than a remux, you will lose quality. Just by the nature of changing codecs, they have different encoding schemes and use different psychoacoustic models so transcoding from one to another will increase the errors from the original. The only reason to convert your library is if you regularly use clients which can’t direct play the original for compatibility or bandwidth reasons. Even in this case, you can still keep the original around for your more capable/higher bandwidth clients to play the original.

If your AVI is truly corrupt and the remux to the MKV corrected it, then you could leave it as an MKV or you could use FFmpeg to remex the original AVI to a new AVI. I’ve done the same to fix up AVIs with broken indexes before.

1 Like