I\'m encoding Camera preview data using MediaCodec with mime-type \"video/avc\" and passing the encoded data (video-only, no audio) to MediaM
I had the same issue .While closing the Muxer it was throwing "Failed to stop" error.When I checked my saved file in an ISO viewer I couldn't find the Track in it . I solved issue by creating the track only after getting the first output from the video encoder.Here is how I add my track
m_VideoTrackIndex = muxer.addTrack(mediaCodec.getOutputFormat());
The media format for the track is obtained from mediaCodec.getOutputFormat() which in turn will get initialized only after encoding the first frame.I changed my code to add the track after getting first encoded data (And of course only once).It is working fine .