problem about mediacodec-Collection of common programming errors
chentc
android mediacodec
I have a bunch of local images saved as jpeg files. My images are captured using CameraPreview and the PreviewFormat is as default: NV21. I want to generate a small video from a fixed number of images. I am not going to use FFMpeg because it requires NDK and will introduce compatibility issues. MediaCodec and MediaMuxer seems work but there are not one working solutions on the web. There are a few references lead to my current solution.1.EncodeAndMuxTest: http://bigflake.com/mediacodec/EncodeAnd
Harpreet
android mediacodec
I am trying to convert a PNG file to a one slice video clip, so to just to make a start-up over a project.What I had code to make it happen is :-private boolean MediaConversion(){MediaCodec codec = MediaCodec.createEncoderByType(MIMETYPE);MediaFormat mediaFormat = null;if(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_720P)){mediaFormat = MediaFormat.createVideoFormat(MIMETYPE, 1280 , 720);} else {mediaFormat = MediaFormat.createVideoFormat(MIMETYPE, 720, 480);}mediaFormat.setInteger(Media
Vin Kemp
android mediacodec
I have an app that manages its own GLSurfaceView and now I want to use Android 4.3’s new MediaCodec feature that takes a Surface as input.In all the examples I’ve seen, the Surface is created using MediaCodec.createInputSurface(), then the GL context is created for this Surface. This feels monolithic and incredibly disruptive to retrofit into a code base that is already stable.Is it possible to use MediaCodec.configure(format, a_predefined_Surface,null,MediaCodec.CONFIGURE_FLAG_ENCODE) instead?
xiaowoo
android android-camera mediacodec
I am trying to learn to encode a mp4 or any sort of video file using the Camera’s onPreviewFrame call back.Currently, I am trying the example codes from this postEncoding H.264 from camera with Android MediaCodecUnfortunately, I am keep getting an IllegalException on the mediaCodec.configure(mediaFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);From another post IllegalStateException when MediaCodec.configure Android, I notice that are some mandatory values I have to set for the MediaCodec.
fadden
android audio-recording codec mediacodec
I get the IllegalStateException on MediaCodec.configure() line, I’m trying to record audio using MediaCodec. This only occur on some phones, on tabs everything is fine. This particular crash example is from Samsung Galaxy S4. Exception traces: 01-22 17:33:38.379: V/ACodec(16541): [OMX.google.aac.decoder] Now Loaded 01-22 17:33:38.379: V/ACodec(16541): onConfigureComponent 01-22 17:33:38.379: W/ACodec(16541): [OMX.google.aac.decoder] Failed to set standard component role ‘audio_encoder.aac’. 01-2
pocmo
android audio pcm mediacodec mediaextractor
I want to decode audio files to raw PCM data to stream it to a playback device in the local network. I use the new MediaExtractor and MediaCodec classes, introduced with API level 16, for that. The device requires the PCM data to be in 44,100 kHz, have 2 channels and a 16 bit sample size. This is working fine as long as the input file roughly matches these requirements. However whenever I’m decoding a MP3 file that uses – for example – a sample rate of 32,000 kHz and maybe has only one channel t
nmxprime
android mediacodec
Following this i have tried below code to initialize MediaCodec, but it failed! The github hosted project runs without any problem. The updated log is as below01-27 02:02:25.125: I/OMXClient(8956): Using client-side OMX mux. 01-27 02:02:25.140: I/ACodec(8956): setupVideoEncoder succeeded 01-27 02:02:25.140: E/OMXNodeInstance(1910): OMX_GetExtensionIndex failed 01-27 02:02:25.140: A/ACodec(8956): frameworks/av/media/libstagefright/ACodec.cpp:3234 CHECK_EQ( (status_t)OK,mCodec->initNativeWindow
fadden
android mp4 fatal-error mediacodec muxer
I am having problems stopping the MediaMuxer.Pretty much have followed fadden’s example all the way, except I am using audio, so I am not 100% sure the audio and video tracks line up yet. This might be the problem.When I hit the breakpoint for mMediaMuxer.stop() I get a fatal error:09-30 17:11:21.677: E/AndroidRuntime(32304): FATAL EXCEPTION: CaptureManager 09-30 17:11:21.677: E/AndroidRuntime(32304): java.lang.IllegalStateException: Failed to stop the muxer 09-30 17:11:21.677: E/AndroidRuntime(
user3297414
android mediacodec mediaextractor mediamuxer
I am trying to use MediaCodec,MediaExtractor and MediaMuxer to generate mp4 file. EveryThing seems to work properly but when i call MediaMuxer.stop i’m having an error . The MP4 file is created but i can’t play it with a Player. Here is my logcat: 02-13 10:41:22.420: D/OpenGLRenderer(11768): Enabling debug mode 0 02-13 10:41:22.600: I/OMXClient(11768): Using client-side OMX mux. 02-13 10:41:22.717: E/ACodec(11768): [OMX.TI.DUCATI1.VIDEO.DECODER] storeMetaDataInBuffers failed w/ err -2147483648 0
lowtraxx
java android h.264 encoder mediacodec
I have written a H264 Stream Encoder using the MediaCodec API of Android. I tested it on about ten different devices with different processors and it worked on all of them, except on Snapdragon 800 powered ones (Google Nexus 5 and Sony Xperia Z1). On those devices I get the SPS and PPS and the first Keyframe, but after that mEncoder.dequeueOutputBuffer(mBufferInfo, 0) only returns MediaCodec.INFO_TRY_AGAIN_LATER. I already experimented with different timeouts, bitrates, resolutions and other con
fadden
android h.264 mediacodec
I am using mediacodec on JB. If I provide input surface there is no crash. However if I do not specify the input surface, I am getting a crash in the class Acodec. The input stream is a h264 annex b formatted stream of video frames.//setupdecoder = MediaCodec.createDecoderByType(“video/avc”);MediaFormat mediaFormat = MediaFormat.createVideoFormat(“video/avc”,WIDTH, HEIGHT);decoder.configure(mediaFormat, null, null, 0);decoder.start();codecInputBuffers = decoder.getInputBuffers();codecOutputBuff
vodkhang
android mediacodec mediaextractor
I am building an android video player app with the new API MediaCodec and MediaExtractor (available from API 16). It normally works well but sometimes I have a crash with a very meaningless messages:09-30 16:39:13.985: A/MediaCodec(6508): frameworks/av/media/libstagefright/MediaCodec.cpp:423 CHECK(buffer->meta()->findInt64(“timeUs”, &timeUs)) failed. 09-30 16:39:13.985: A/libc(6508): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 12769 (MediaCodec_loop)If would be good if som
HPP
android crash fatal-error video-encoding mediacodec
Keep getting a Fatal Signal 11 crash. I have debugged it down to the following line of codeint outBuffIdx = codec.dequeueOutputBuffer(null, 16000);The first time it passes this line of code it returns -1 for Format change, but the next time it just crashes. Looking into the error it is saying it has something to do with a null reference variable, but the both the input and output buffers should not be null.
Web site is in building