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

Android ExoPlayer: Play Single Stream to Multiple Surfaces

I am investigating how to make an Android Exoplayer play a single content stream to multiple surfaces. For example, if the content stream is online, it would only be downloaded once, yet still be played on both surfaces. I have investigated this…
M.S.
  • 1,091
  • 1
  • 11
  • 27
0
votes
1 answer

android - mux raw h264 in mp4 container

I have raw h264 data of my frames and its presentationTimeUs and I want to mux data in mp4 container. How can I do it with ffmpeg or any library except MediaMuxer ? Update: I need a command to write h264 data of just one frame to mp4 container…
Sajad Norouzi
  • 1,790
  • 2
  • 17
  • 26
0
votes
1 answer

Delaying frames of an Android virtual display

The basic issue I am trying to solve is to delay what is sent to a virtual display by a second or so. So basically, I am trying to shift all frames by 1 second after the initial recording. Note that a surface is used as an input and another surface…
John Smith
  • 307
  • 3
  • 14
0
votes
1 answer

mediacodec doesn't work smoothly

using this url I wrote below code to encode onpreviewframe data to mp4 video and I used a thread to do this job well, but it seems that it doesn't work properly. private void initCodec() { String root = …
Sajad Norouzi
  • 1,790
  • 2
  • 17
  • 26
0
votes
1 answer

MediaPlayer within TextureView not working as intended

I've put in a MediaPlayer within a TextureView, which itself is located inside a ListView. Yesterday, the MediaPlayer worked as intended with a test .mp4 clip. Today, the MediaPlayer tries doing some kind of FFmpeg Extractor, for which i've been…
0
votes
1 answer

Can I record video on Android device and encode it in h.264 (Baseline profile) on it?

I need to determine how can I record video in Android device and encode it in h.264 Baseline profile in mp4 container. I can't find information about this because smartphone manufacturers usually don't show it. All I know is that Sony Z3 encodes all…
0
votes
1 answer

What is the fastest way to decode an MP3 file then encode to AAC on Android?

I have a working solution using MediaCodec and MediaExtractor, but the decoding of a 6mb MP3 takes 15 sec + encoding of 15 sec to AAC. Total of > 30 sec. I need something really fast <10 sec. Anyone know a faster solution? EDIT My bottleneck is from…
Rami Kuret
  • 3,581
  • 2
  • 15
  • 17
0
votes
0 answers

Using Java Queues in real-time audio application

I am writing an audio application in android which records audio using AudioRecord and currently I am saving the recorded audio as a wav file. Now, I want to encode this audio data to save it in the compressed form. For compression, I am using…
Swapnil
  • 1,870
  • 2
  • 23
  • 48
0
votes
1 answer

Issues encoding audio with Mediacodec and Motorola mobile

I have been able to implement a video/audio decoder and encoder. On my Samsung S3, everything works fine. Then I deployed into a Samsung, and I had some rotation issues I have fixed, but the final encoded video does not have audio. When I stop the…
Gabriel Bursztyn
  • 656
  • 8
  • 24
0
votes
0 answers

Recreate muxer for new video file while encoder works

I use CameraToMpegTest from BigFlake, but I modify it to enable start and stop muxer many time while encoder works. When the video recording is not, I still use the encoder to get frames from texture for other processing. For first start/stop it…
0
votes
1 answer

Mediacodec to encode video online

I was able to implement a code which records video bases on CameraCaptureActivity from grafika. Now I can record myself counting from 1 to 10, but when I go to see the recorded video I am saying 1,3,8,9, that is I missed some frames to be recorded.…
Gabriel Bursztyn
  • 656
  • 8
  • 24
0
votes
1 answer

PCM to MP3 using MediaCodec API Android

I am gettting PCM data from Microphone using AudioRecord class, how to encode it to MP3 using MediaCodec in Android?
0
votes
1 answer

MediaCodec h264 encoder outputs large raw stream

I'm using MediaCodec in an Android app to encode frames from a Usb camera and then feed that raw stream to mp4parser to create mp4(API level is 16). Everything works really good on many devices, but i have issues with Galaxy S3 (I9300). The problem…
Alon
  • 48
  • 6
0
votes
0 answers

MediaCodec Encoder SPS missing VUI params

fadden I hope you're listening. So I've been trying to encode some preview frames from the camera, to eventually stream over rtmp as flv. However, when filling out the avcdecoderconfigurationrecord in the avc sequence header, I have to give the SPS…
0
votes
1 answer

Android MediaCodec MixVBP: unknown header 12 is parsed

I'm using the Android MediaCodec api in C++ to decode streamed video (video/avc) and audio (audio/mp4a-latm). I'm using a Nexus Player device on Android M. I've found that the first couple of seconds of playback show a black screen, and during that…
Jack
  • 2,153
  • 5
  • 28
  • 43