Questions tagged [android-mediacodec]

MediaCodec is a class from the package "android.media" of Android API that can be used to access low-level, native media codec, i.e. encoder/decoder components.

MediaCodec is a class from the package android.media of Android API that can be used to access low-level, native media codec, i.e. encoder/decoder components. Along with the common IO it supports input data of the following decoder mime types:

  • "video/x-vnd.on2.vp8" - VPX video (i.e. video in .webm)
  • "video/avc" - H.264/AVC video
  • "video/mp4v-es" - MPEG4 video
  • "video/3gpp" - H.263 video
  • "audio/3gpp" - AMR narrowband audio
  • "audio/amr-wb" - AMR wideband audio
  • "audio/mpeg" - MPEG1/2 audio layer III
  • "audio/mp4a-latm" - AAC audio
  • "audio/vorbis" - vorbis audio
  • "audio/g711-alaw" - G.711 alaw audio
  • "audio/g711-mlaw" - G.711 ulaw audio

The reference to the API docs: http://developer.android.com/reference/android/media/MediaCodec.html

1173 questions
0
votes
2 answers

How to Convert YV12 to COLOR_FormatYUV420SemiPlanar?

I am trying to encode an .h264 video by using MediaCodec and Camera (onPreviewFrame). I got stuck converting color space from YV12 (from camera) to COLOR_FormatYUV420SemiPlanar (needed by the encoder). Edit: I noticed this can be a bug on MediaCodec…
0
votes
1 answer

Intermittent native crash in libstagefright_soft_aacdec.so when using MediaCodec (AAC decoding)

I'm getting an intermittent low level crash when using Android's MediaCodec API. I'm dealing with multiple (up to 8) raw AAC audio streams so I configure 8 MediaCodec instances and then feed them sample buffers as they arrive (from a single thread…
Dean Wild
  • 5,886
  • 3
  • 38
  • 45
0
votes
1 answer

MediaCodec Lollipop not decoding raw H264 stream 1080P at 60 FPS

This is my follow up question to below thread Slow H264 1080P@60fps Decoding on Android Lollipop 5.0.2 On the path of debugging the root cause of above issue, I tried various approach to Decode 1080P at 60 FPS. I tried wrapping H264 data into a…
Gurtaj
  • 13
  • 7
0
votes
0 answers

android-ndk crash in android::MediaCodec?

Can someone help me figure out what is the following crash about? Thanks. I/DEBUG ( 3007): Build fingerprint: 'samsung/zerofltetmo/zerofltetmo:5.1.1/LMY47X/G920TUVU2COF8:user/release-keys' I/DEBUG ( 3007): Revision: '11' I/DEBUG ( 3007): ABI:…
0
votes
2 answers

Android app that uses MediaSync freezes while playing video

I am trying to use the new MediaSync API to play video and Audio in sync . https://developer.android.com/reference/android/media/MediaSync.html I have the Audio Only player working using MediaSync,but for the Video only player, I get this in the…
Harkish
  • 2,262
  • 3
  • 22
  • 31
0
votes
2 answers

Which video encoders are guaranteed to be supported by android MediaCodec API?

Testing video encoding with the MediaCodec API in several devices, I noticed all of them have encoders for h264, h263, and MPEG-4. Are any of these guaranteed to be supported by all devices which have at least Jelly Bean, even if the actual encoding…
PerracoLabs
  • 16,449
  • 15
  • 74
  • 127
0
votes
1 answer

Find the MediaCodec supported video encoding resolutions under Jelly Bean MR2

Is there any way to get the MediaCodec video encoding supported resolutions under Jelly Bean MR2? For lollipop we can use the new getVideoCapabilities() method to find out all the supported video resolutions. But for lower API levels couldn't find a…
0
votes
2 answers

Modify audio pitch / tempo while encoding with android MediaCodec

I'm using AudioRecord to get audio in real-time from the device microphone, and encoding / saving it to file in the background using the MediaCodec and MediaMuxer classes. Is there any way to change the Pitch and (or) Tempo of the audio stream…
PerracoLabs
  • 16,449
  • 15
  • 74
  • 127
0
votes
1 answer

Android MediaCodec AMR-NB realtime decoding

I'm working on VoIP via a socket like API. (With a narrow band connection) I need to encode each voice frame (20ms) and send via said api, then decode it on the other side. I tried working with Opus through NDK but it wasn't going anywhere so I…
Eitan F
  • 127
  • 1
  • 11
0
votes
2 answers

Why always got NullPointerException while getting KEY_FRAME_RATE from MediaCodec?

I want to retrieve the frameRate from the MediaCodec, but i always got the NullPointerException. The code as following: public void handleWriteSampleData(MediaCodec encoder, int trackIndex, int bufferIndex, ByteBuffer encodedData,…
Jerikc XIONG
  • 3,517
  • 5
  • 42
  • 71
0
votes
1 answer

Mux video with my own audio PCM track

Using Android MediaMuxer, what would be a decent way to add my own PCM track as the audio track in the final movie? In a movie, at a certain time, I'm slowing down, stop, then accelerate and restart a video. For the video part, it's easy to directly…
Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67
0
votes
1 answer

How to set the Android MediaCodec profile?

I am try to set the profile, such as: MediaCodecInfo.CodecProfileLevel.AVCProfileBaseline The code snippet like this: MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, config.getWidth(),…
Jerikc XIONG
  • 3,517
  • 5
  • 42
  • 71
0
votes
0 answers

Accessing the MediaBuffer of the Audio File which is currently playing on the Android device

I am able to access the media buffer of the file/stream through mediaextrator, mediacodec and audio track when I set the dataSource. All I want is a method of accessing the media buffer of the audio which is playing through any music app in Android.
Vis
  • 109
  • 7
0
votes
1 answer

Record opengl fbo made with c++ with java MediaCodec

I'm trying to record the contents of an fbo that i create and fill in c++ with the MediaCodec java object. I understand that i need to get a Surface from MediaCodec and draw on it with a frag shader, so i'm trying to feed the c++ fbo as uniform to…
0
votes
1 answer

on some Samsung devices decoding H264 stream at hight resolution with MediaCodec, dequeueOutputBuffer always return -1

I am trying to use the MediaCodec API to decoding H264 stream with Android client. sample code: int decoderStatus = decoder.dequeueOutputBuffer(mBufferInfo, TIMEOUT_USEC); When the remote H264 stream resolution size is bigger (eg: 1600*1200),…
li homer
  • 9
  • 2