Android MediaCodec: video file processing: add the original audio, while process video -
the input video file. want process each video frame, while audio remains same. output video file.
i follow example decodeeditencodetest.java , meidamuxertext.java in bigflake.com without adding audio track, application works well. add audio track mmuxer.
since not need process audio, not use decode or encode audio.
here dilemma. if want know whether sample data video or audio, use: int chunksize = extractor.readsampledata(inputbuf, 0)
if set inputbuf general bytebuffer, , if sample turns out audio, fine. use mmuxer.writesampledata write inputbuf output video file.
but if sample turns out video, supposed write data in decoder's input buffer. since not know first, how can determine buffer use?
mediaextractor.getsampletrackindex() tells track current sample comes from.
Comments
Post a Comment