How do you pull the streams out of one container and put them into another? What program remuxes' from one container to another without the need to re-encode?
****Just noticed you're not OP. I'll throw out the quick answer and leave the long answer in case someone finds it useful****
Remuxing depends on the containers you are using and want to use
mkvmerge is great for creating .mkv files
virtualdubmod is great for working with .avi files
TsMuXer is great for .vob/.mpeg2/.m2ts/.ts/AVCHD files (basically anything that is DVD or BR format) and getting raw streams that you can load into other muxing tools
YAMB and
MP4Box are good for remuxing into the .mp4 format as long as the streams are compliant
There are tons of others
If you are completely locked into .mp4 then it will be a little more complicated than if you are able to go .mkv. Do you mind if I ask why you are converting?
Anyway, where it is an .avi, you may be looking at a 2 remux process but it should still only take a few minutes with no reduction in quality as long as your streams are /mp4 compliant.
STEP 1 - It is going to depend on what your streams are. If you need more assistance or are kind of new to this kind of thing, then run the file through Mediainfo:
http://mediaarea.net/en/MediaInfo
and then post what the streams are. You should be seeing at least 1 video file stream and 1 or more audio streams. With that info, I could tell you exactly what to do.
STEP 2 -
Download:
http://www.videohelp.com/tools/YAMB
or
http://www.videohelp.com/tools/My-MP4Box-GUI
Basically, just open the .avi in either of tools and as long as all of your streams (video/audio/subs) are found and supported, it'll just remux into an .mp4.
DONE, but.....
STEP 3 - If all of the streams fail to load or the remux just fails (as is often the case with .avi), open the .avi in:
http://www.videohelp.com/tools/VirtualdubMOD
Make sure you set the video and audio streams to "Direct Stream Copy" and then just "Save As...." and then choose .mkv. At this point, It's not a bad idea to double check that you are in "Direct Stream Copy" mode otherwise Virtualdubmod will try to decompress the video stream and/or convert. That would take much much longer than the 1 or 2 minutes to remux to .mkv. You'll notice the difference immediately because the fps in the <working window> will be 10-200fps (depending on CPU speed) instead of almost 1000fps while the task is being processed.
If you are OK using .mkv files then STEP 1 could have been completely skipped and then you are done at this point.
STEP 4 - If you must have .mp4 then do a 2nd remux with the tools above (YAMB or MP4box). They will accept an .mkv file much more willingly than an .avi. If you still can't get all of the streams to load up, then you have .mp4 uncompliant streams and you'll need to convert. That would take us back to Step 1 where we need to find out exactly what the streams are with MediaInfo.
I remember when I was just learning how to do this so, if you have questions, please let me know. If you have uncompliant streams then it can be fixed with several free tools like Handbrake or Super. Handbrake will force you to re encode all of the streams but Super will let you be selective. Even then, there are ways around it with Handbrake, too.
If you aren't too concerned about some quality loss introduced by re encoding, and have the time to let the PC re encode (it can take awhile) then it may be easier to just to run it through Handbrake. This is always my last resort and I learned it the hard way.