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
0 answers

Android Audio video encoder using MediaCodec API

I am developing an App that need audio-video encoding simultaneously. I checked the Google Grafika https://github.com/google/grafika CameraCaptureActivity, but it only encodes the video data. How can I encode audio data with other MediaCodec object…
Sino
  • 886
  • 7
  • 21
0
votes
0 answers

How to Encode and Decode video from camera in real time for android?

I am previewing with SurfaceView. I need to endcode the video and send it for decoding in real time. 10+ API level would accepted for me. Could any one help ?
0
votes
1 answer

Android: Is it possble to use MediaCodec on android 4.0.4(api level 15)?

Is it possble to use MediaCodec on android 4.0.4(api level 15)? MediaCodec Min api level is 16, but I need to use on level 15. Is there any way to use MediaCodec on android 4.0.4 except for Upgrading android OS?
김만수
  • 1
  • 3
0
votes
0 answers

Android MediaCodec: mpeg4 decoding

I am trying to decode video using AMediaCodec without AMediaExtractor. I have successfully decoded avc and hevc streams using it by passing NAL units and required codec specific info. in start. However, I am having problem with mpeg4. Some files…
Abdul Rauf
  • 766
  • 2
  • 7
  • 19
0
votes
1 answer

Surface transparent before playing

I have a dialog where I put a surface that is used for a MediaCodec instance to play a video. When I load this dialog, the surface appears transparent for a few seconds until the mediacodec is ready and the video plays fine. Since this is a dialog,…
MichelReap
  • 5,630
  • 11
  • 37
  • 99
0
votes
1 answer

video clip transition effects

I am try to combine video clips together use MediaCodec API. With decoder, MediaMuxer I can combine video clips together, but the transition between each clips seem too dull. I wanna to add some transition effects between each clip, like GoPro…
Yupeng Zhu
  • 23
  • 4
0
votes
1 answer

Android AAC-HE encoder initialization fails with 8khz sampling rate

I am trying to initialize AAC encoder with the following parameters aac-profile=5, mime=audio/mp4a-latm, bitrate=12000, channel-count=1, sample-rate=8000 But the codec initialization fails with the following error: 06-14 19:17:58.009 6194-6450/?…
user2067340
  • 231
  • 1
  • 2
  • 8
0
votes
1 answer

Surface texture type for mediacodec

Many examples of mediacodec use EXTERNAL surfacetexture as the output of mediacodec, my problem is can I use a 2D surfacetexture?
S.Jins
  • 41
  • 5
0
votes
1 answer

Decoding an AAC audio file into a RAW PCM file

I have an AAC-format audio file that im trying to convert into a raw format PCM file, in order to mix it with another audio file and play it using AudioTrack later on. After some research I came across this library that decodes my AAC file…
0
votes
1 answer

Recoding one H.264 video to another using opengl surfaces is very slow on my android

I'm developing function of translating one video into another with additional effects for each frame. I decided to use opengl-es for applying effects on each frame. My input and output videos are in MP4 using H.264 codec. I use MediaCodec API…
0
votes
0 answers

MediaCodec releaseOutputBuffer causes memeory leak

For some reason I am using mediacodec API to decode mp4 audio track in JNI layer, I just reflect MediaCodec/MediaExtractor/AudioTrack into jni layer and try to decode audio and video tracks, but when I am decoding the audio track I can not get the…
0
votes
1 answer

Video Lag and FPS drop on Android Lollipop on touching screen

I am using MediaCodec to play 1080p@60fps video. This is on freescale SabreSD platform with Android Lollipop 5.1. Initially because of BufferQueue Synchronous Mode, the FPS was way below 60.I could now manage to play at 70FPS by changing the…
0
votes
0 answers

Android MediaProjection performance improvements

I Would like to ask, if it's possible to improve performance for MediaProjection. Edited after fadden answer. Pseudo structure of app: 1) Fullscreen FrameLayout in AppCompatActivity:
0
votes
1 answer

NdkMediaCodec returns ERROR(0x90000012)

I am working on turning my java decode process to JNI. First, I'm using the following source code to initial the mediacodec: AMediaCodec* codec; AMediaFormat* format =…
lsong98sh
  • 31
  • 4
0
votes
2 answers

android - why onpreviewframe doesn't work well?

I used following code to set a previewcallback mCamera.setPreviewCallback(new Camera.PreviewCallback() { @Override public void onPreviewFrame(final byte[] bytes, Camera camera) { if (recording…
Sajad Norouzi
  • 1,790
  • 2
  • 17
  • 26