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
7
votes
1 answer

Transcode video to lower bitrate and stream

I have a working app that streams video to Chromecast(using nannoHttpd) and everything is working fine. Now my problem is: videos recorded using new devices are too large in size to stream, so I want to re-encode videos to some lower bitrate. I…
ingsaurabh
  • 15,249
  • 7
  • 52
  • 81
7
votes
1 answer

what is COLOR_FormatYUV420Flexible?

I wish to encode video/avc on my android encoder. The encoder (Samsung S5) publishes COLOR_FormatYUV420Flexible as one of its supported formats. yay! but I dont quite understand what it is and how I can use it. the docs say: Flexible 12 bits per…
FuzzyAmi
  • 7,543
  • 6
  • 45
  • 79
7
votes
0 answers

Video encoded using camera2 is upside down on nexus (5x, 6p) devices

We are using camera2 API to get preview and encode video simultaneously, using mediacodec. We know when we should rotate the camera by querying 'CameraCharacteristics.SENSOR_ORIENTATION' but there is only preview rotation option. What we need is to…
eduard
  • 309
  • 3
  • 9
7
votes
0 answers

Video encoded and sent from Android can not be played in iOS Telegram

Telegram use MeidaCodec to encode video from Android API 16. It works fine from API 18. But there are an error in API 16, 17. Video encoded and sent from Android cannot be played in iOS. I think the problem is in process converting color between…
Huy Duong Tu
  • 7,798
  • 5
  • 25
  • 46
7
votes
0 answers

MediaCodec weak global reference table overflow

I'm working on an app that instantiates several MediaCodec instances for decoding streaming audio and video data to a SurfaceTexture on an Nvidia TX1 development kit. After a few minutes of just using one audio and one video decoder, I get an error…
jldeon
  • 363
  • 2
  • 11
7
votes
1 answer

How does an output surface of a Decoder is passed to an input surface of an Encoder?

I'm trying to understand how the surface-to-surface approach works with MediaCodec. In a ByteBuffer only approach, decoded data is placed in OutputBuffers. This non-encoded data can be processed manually then passed to the InputBuffers of an…
Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67
7
votes
0 answers

AVC HW encoder with MediaCodec Surface reliability?

I'm working on a Android app that uses MediaCodec to encode H.264 video using the Surface method. I am targeting Android 5.0 and I've followed all the examples and samples from bigflake.com (I started working on this project two years ago, so I kind…
Adrian Crețu
  • 878
  • 8
  • 17
7
votes
2 answers

Android: Encoding audio and video using MediaCodec

I'm trying to encode video from camera and audio from microphone using MediaCodec and MediaMuxer. I use OpenGL to overlay text on the image while recording. I took these classes as…
user992029
7
votes
1 answer

Android Extract Decode Encode Mux Audio

I am trying to adapt the code found in ExtractDecodeEditEncodeMuxTest.java in order to extract audio and video from a mp4 recorded via Cordova's device.capture.captureVideo, decode the audio, edit the decoded audio samples, encode the audio, and mux…
7
votes
0 answers

What are the official requirements for MediaMuxer to be able to merge videos

In an application that consists in different MediaCodec and (others Android.Media namespace stuff) prooves of concept, I'm generating a video on an opengl frame along with a PCM tone so that I have data to send to a two MediaCodec encoder (PCM…
Léon Pelletier
  • 2,701
  • 2
  • 40
  • 67
7
votes
1 answer

Android encoding using MediaCodec and a Surface

I've been rendering video through the MediaCodec directly to a Surface that was taken from a SurfaceView in my UI. This works great. I am now attempting to use MediaCodec as an encoder. As a test, I want to render to the Surface (as in above) and…
7
votes
2 answers

MediaCodec is giving a storeMetaDataInBuffers trace error

I'm getting on the logcat the next error while encoding via the MediaCodec in Android. The actual encoding works fine and the output is produced correctly, so I can't really understand why I get this trace. Is it a harmless error trace, or is there…
PerracoLabs
  • 16,449
  • 15
  • 74
  • 127
7
votes
0 answers

Android display video stream in MediaPlayer and encode with MediaCodec

Problem: I have video stream from GoPro camera, in the .m3u8 format. I need to display the content of the stream in application and then stream the video. For streaming, I have library that works with MediaCodec and ffmpeg. I should be able to…
kvgr
  • 325
  • 4
  • 17
7
votes
1 answer

how to use software codec in android using mediacodec

In my i want encode yuv data into h264 using mediacodec software codec. I use Google software encoder OMX.google.h264.encoder when i use hardware encoder[OMX.qcom.video.encoder.avc] that time it work but when i use software…
Bhagirathsinh Gohil
  • 673
  • 1
  • 9
  • 25
7
votes
1 answer

How to record video and audio with MediaCodec and MediaMuxer

I am able to record(encode) video with the help of MediaCodec and MediaMuxer. Next, I need to work on audio part and mux audio with video with help of MediaCodec and MediaMuxer. I am facing two problems: How to encode audio with MediaCodec. Do I…
abhishek kumar gupta
  • 2,189
  • 6
  • 35
  • 56