Remux Videos for iTunes Playability? What video formats are usable within iTunes, specifically for syncability/playability on iOS devices?

I understand that we're talking about a number of different things here:


Container format
Video codec
Audio codec
Subtitle format


I have a fairly extensive library of many different kinds of videos, and the prevailing formats are MKV and AVI.  I don't really know what codecs are most common in my library, but they pretty much fall under the generic MPEG4 banner, I suppose.

Whenever I research this question on my own, Google results are saturated with transcoding utilities (both paid and free).  Sure, transcoding makes for a simple "one click and it magically makes my home video play on my iPad" solution, but for my library it presents a few problems:


Loss of quality
Significant investment in time and computing resources


Is it possible that most of what I have is close enough and just needs to be re-muxed into a different container format?  Is there a utility (even command-line) which I could try for this?  How would I use that utility to remux and not transcode?
I have been fighting this issue myself, with some success - but mostly, I have reverted to getting more of my collection in MP4 in the first place.

Subler is a must have to begin. It effortlessly does remuxing of MKV to MP4, including soft subtitles and iTunes Metadata. So for most MKVs, it is a breeze to get them into iTunes in a tidy manner.

When it comes to AVI and other formats, it's a bit trickier. AVI tend to be used with video codecs such as DivX or XviD, and although they could be remuxed into an MP4 container, it seems iTunes will not read it.

If you wanna play around with remuxing, your best bet is ffmpeg. You will need to compile it yourself or Google for binaries.

I'd advice you to convert your MKVs using Subler, and to re-rip/re-download the AVIs in a newer format where possible. What is left you can transcode using Handbrake.