Two things I notice, one minor, one major:
minor: you're setting width and height on the output audio coder. that's unnecessary since it's just audio.
major: you're attempting to write all the video packets from a file and then all the audio packets from a file, but telling Xuggler not to interleave (you're passing false on IContainer.writePacket). I'm surprised the file writes any audio at all --in fact I suspect you're getting an error when you try to write your first audio packet because of 'timestamps out of order" -- check your logs.
So some general advice:
1) always walk through your code iine by line in a Debugger to see if methods are failing (e.g. returning negative numbers) when you don't expect.
2) you could just change your writePacket(...) call to ask Xuggler to interleave (pass in true). This will likely help for small files, but due to the way you've implemented your Algorithm Xuggler would need to buffer the entire set of video packets in memory while waiting for the audio to be written. This probably doesn't scale. By the way, if this doesn't work for small files (let's say 10 seconds or less), then go back to step 1, and look at the return values for each method you call.
3) implement the algorithm in the correct (but more difficult) way. That is:
a) open each container, let's call them A and B
b) read one packet each from A and B
c) process both packets and get two new packets to write (let's call them A' and B').
d) write both packets to the IContainer either in DTS order, or ask the IContainer to interleave.
e) if A'.getDts() is < B'.getDts(), then read container A to get the next packet, else read container B to get the next packet.
f) continue until one file is empty, and then flush out the other file.
Put another way, be clever in your code and interleave which of the two files you're reading from next to ensure that Xuggler doesn't have to buffer an entire file.
Hope that helps,
- Art