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

Getting frames from SurfaceView and decode in H264 with mediacodec

Currently I'm using the sample app from Sony developer of the action camera. This sample app connects to the action camera and get with HTTP packets the images. The images are in the payload of the HTTP and I'm able to draw them on a SurfaceView.…
0
votes
1 answer

audio codec dequeueInputBuffer returns -1 on device

I'm trying to play some audio taken from an MPEG2 transport (.ts) file. I'm getting the audio stream via MediaExtractor, using readSampleData to copy samples to MediaCodec input buffers, then writing the MediaCodec output buffer to an AudioTrack.…
0
votes
1 answer

Grafika CameraCaptureActivity not working

I'm trying to test this sample in my galaxy S3 and everything seems to work well but when i try to play the recorded file, no player can play the file. I send the video to my computer and tried with VLC, gom player, etc and always get an error like…
borja
  • 125
  • 9
0
votes
0 answers

Crash related to MediaCodec.cpp: CHECK_EQ( mState,CONFIGURING)

Could anyone shed some light on the following crash report? Is there a way to prevent such crashes? Build fingerprint: 'samsung/kltexx/klte:5.0/LRX21T/G900FXXU1BNL9:user/release-keys' Revision: '14' ABI: 'arm' pid: 13847, tid: 16899, name:…
Hong
  • 17,643
  • 21
  • 81
  • 142
0
votes
2 answers

releaseOutputBuffer for varying resolutions

I'm using the Android NDK MediaCodec API to decode an MP4 stream of varying resolutions. I am using the built-in functionality to render to a surface, calling AMediaCodec_releaseOutputBuffer with the render flag set to true. I have found that every…
Jack
  • 2,153
  • 5
  • 28
  • 43
0
votes
1 answer

Android MediaCodec: ExtractMpegFramesTest.java

I am trying to run ExtractMpegFramesTest.java but getting an error : [OMX.qcom.video.encoder.avc] storeMetaDataInBuffers (output) failed w/ err Frame wait time out Please advice me how to get out of this issue as no much related information…
0
votes
1 answer

Is it possible to encode video with mediacodec without a surface?

I have found a lot of examples on how to encode video with MediaCodec, but all of them have to create a input surface. It is possible to encode video without a input surface? A code example will be a great help, thank you!
Chris Tsang
  • 181
  • 12
0
votes
1 answer

The returned color format by selectColorFormat method is not correct

I'm using the selectColorFormat method from bigflake to get supported input color format of encoder of MediaCodec.It works well on some tested devices except Huawei Mate7. The returned color format is COLOR_FormatYUV420Planar.So I configure it as…
Frank Bush
  • 111
  • 3
  • 11
0
votes
1 answer

How to dump YUV in Android Native OMXCodec (S3 & Note 3)

i have followed below method to access YUV buffer. It works in few phones. But in S3 and Note 3 I'm getting problem. any reason ? Please help me. sp mCurrGraphicBuffer; void *vaddr; mCurrGraphicBuffer =…
0
votes
1 answer

MediaExtractor returns wrong number of tracks?

I'm trying to build a player that plays mpeg2-ts stream with 2 audio tracks using MediaCodec and MediaExtractor. When I set the URL to the extractor: extractor.setDataSource(URL) int the Logcat I can see that the framework has found the 2 audio…
0
votes
1 answer

Media Extractor: Decoder gives wrong Width on Android 4.2

I'm writing a plugin for Unity that decodes and takes the frames from a video file using the Media Extractor and re-encodes to a new video file. However the frames are being decoded into an array of the wrong size (on android 4.2.2) because the…
0
votes
0 answers

Is MediaCodec performance/latency affected by the frame resolution on Android?

I am creating an application that receives an RTSP streaming that is H264 encoded and the application has to decode it using MediaCodec to be finally displayed. Something similar to the one mentioned in this other post. I wonder if some knows if…
David
  • 1
0
votes
1 answer

Losses of first buffered data of mp3 decoding using MediaCodec in android-NDK 10 version

I use MediaCodec and MediaExtractor classes from android NDK for decoding mp3 files. For comparison input file(mp3) and outputfile(wav - it`s my decoded format) i look at tracks duration and i exactly see difference of duration 50 milliseconds. I…
0
votes
2 answers

How to scale the YUV image from MediaCodec output with any color format?

I'm using MediaCodec to decode the video and using sws_scale(from ffmpeg) to rescale it.I can deal with one special color format,eg. YUV420P, and rescale it to destination size. But I have to do some preparing work, such as getting the linesize and…
Frank Bush
  • 111
  • 3
  • 11
0
votes
1 answer

How to get pcm data buffers from MediaCodec output buffers?

I want to decode mp3 file to pcm or wav data.(Android Application: API 20) I use this approach for decoding data from mp3, but on native platform with C++. After decoding i know from decoder filled output buffered data is in "sound/raw" format.…