mediamuxer

android - How to mux audio file and video file?

我与影子孤独终老i 提交于 2019-12-17 18:09:49
问题 i have a 3gp file that is recorded from the microphone and a mp4 video file. i want to mux audio file and video file in to a mp4 file and save it. i searched a lot but didn't find any thing helpful for using MediaMuxer api of android. MediaMuxer api UPDATE : this is my method that mux two files , i have an Exception in it. and the reason is that the destination mp4 file doesn't have any track! can someOne help me with adding audio and video track to muxer?? Exception java.lang

MediaCodec.createInputSurface() throws IllegalStateException in Android emulator (Error -38)

倖福魔咒の 提交于 2019-12-13 15:27:00
问题 I have MediaMuxer : MediaMuxer mMediaMuxer = new MediaMuxer(new File(Environment.getExternalStorageDirectory(), "video.mp4").getPath(), MediaMuxer.OutputFormat.MUXER_OUTPUT_MPEG_4); And code, which records video: MediaFormat mMediaFormat = MediaFormat.createVideoFormat("video/avc", width, height); mMediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, CodecCapabilities.COLOR_FormatSurface); mMediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, 128000); mMediaFormat.setInteger(MediaFormat.KEY_FRAME

Editing frames and encoding with MediaCodec

白昼怎懂夜的黑 提交于 2019-12-12 19:37:34
问题 I was able to decode an mp4 video. If I configure the decoder using a Surface I can see the video on screen. Now, I want to edit the frame (adding a yellow line or even better overlapping a tiny image) and encode the video as a new video. It is not necessary to show the video and I don't care now about the performance.(If I show the frames while editing I could have a gap if the editing function takes a lot of time), So, What do you recommend to me, configure the decoder with a GlSurface

How to dub a video with audio in android

陌路散爱 提交于 2019-12-12 04:59:50
问题 I want to make a dubbing app in Android. Flow of the app is: Get video and audio from the gallery. Reduce the original sound of Video file. And mix (Dub) the selected audio on this video file. After mixing the audio on this video file save it in to external memory. I am using MediaMuxer for this, but m not success. Please help me regarding this. Regards, Prateek 回答1: even i was looking for the same to dub my video with an audio using mediaMuxer, MediaMuxer was a little difficult concept for

Android Mediamuxer moov atom

断了今生、忘了曾经 提交于 2019-12-12 04:27:29
问题 I am recording device screen using Mediacodec and Mediamuxer api everything is fine. Now I want to stream this file while recording, but cant until muxer is stopped and moov atom is written at the end of file. So my question is it even possible using Mediamuxer for the purpose? If not what are the alternatives? 回答1: No, it's not possible. In order to send an MP4 file while it is being written, you need to write fragmented MP4, and MediaMuxer only writes non-fragmented MP4. 来源: https:/

MediaCodec signalEndOfInputStream() error

▼魔方 西西 提交于 2019-12-11 04:16:13
问题 I'm trying to use the Live Camera Recording ( With Opengl ) from the Sample Code Grafika. Every things works fine on my Moto G but i try in my other device (Galaxy Tab 2 with Cyanogendmod 11) it's seems the method : signalEndofInputStream() is not working and the Encoder never stop. It's there a way to send the signal to the MediaCodec in an other way ? Sorry for bad English. 回答1: You can work around it. If you look at DecodeEditEncodeTest, you can see a mysterious boolean called WORK_AROUND

Android MediaCodec How to Frame Accurately Trim Audio

一个人想着一个人 提交于 2019-12-11 02:08:40
问题 I am building the capability to frame-accurately trim video files on Android. Transcoding is implemented with MediaExtractor , MediaCodec , and MediaMuxer . I need help truncating arbitrary Audio frames in order to match their Video frame counterparts. I believe the Audio frames must be trimmed in the Decoder output buffer, which is the logical place in which uncompressed audio data is available for editing. For in/out trims I am calculating the necessary offset and size adjustments to the

Android Media Muxer Not Working [Android/Java]

a 夏天 提交于 2019-12-10 18:28:26
问题 Media Muxer Media Muxer Not Working In Lolipop Testing on Android Emulator Api 22 (Lolipop) here is my code for muxing audio and video file public void muxer(File videoFile, File audioFile, long dowloadId) { String outputFile = ""; String TAG = "MURGE"; publishProgress(0, 0, dowloadId, 0, "Parsing"); try { if (!new File(DataStore.getInstance(this).getPathDownload() + "/Final").exists()) { new File(DataStore.getInstance(this).getPathDownload() + "/Final").mkdirs(); } File file = new File

Non-streamable video file created with MediaMuxer

我与影子孤独终老i 提交于 2019-12-10 15:38:19
问题 I am using MediaCodec to encode video. Frames are coming through the camera preview callback to the MediaCodec instance (no Surface used). I am using JCodec library for muxing and I am able to stream produced video (video player is showing correct duration and I am able to change video position with seek bar). Today I've tried to use MediaMuxer instead of JCodec and I've got video which still looks fine, but duration is absolutely incorrect (a few hours instead of one minute) and the seek bar

Android MediaMuxer readSampleData IllegalStateException

倾然丶 夕夏残阳落幕 提交于 2019-12-10 11:58:47
问题 I am using the following code to generate a video. However, one in every 5 attempts the readSampleData raises either a IllegalArgumentException or a IllegalStateException. What can I do to stop the exceptions. Can I check the state of the extractor before calling readSampleData. If so, how? MediaExtractor videoExtractor = new MediaExtractor(); videoExtractor.setDataSource(SOURCE); Log.d(TAG, "Video Extractor Track Count " + videoExtractor.getTrackCount() ); MediaMuxer muxer = new MediaMuxer