Questions tagged [mediaextractor]

Android API MediaExtactor facilitates extraction of demuxed, typically encoded, media data from a data source

Detailed documentation can be found here.

122 questions
23
votes
1 answer

SurfaceTexture's onFrameAvailable() method always called too late

I'm trying to get the following MediaExtractor example to work: http://bigflake.com/mediacodec/ - ExtractMpegFramesTest.java (requires 4.1, API 16) The problem I have is that outputSurface.awaitNewImage(); seems to always throw…
manixrock
  • 2,533
  • 4
  • 24
  • 29
12
votes
1 answer

Get MPEG-4 video stream's profile programmatically on Android

Is there any way to get MPEG-4 video fils's profile-code using standard Android API? Sample profile-codes are: baseline, main, high and so on. I don't want to include ffmpeg binary in the android app just to get this information. I found reference…
8
votes
2 answers

MediaMuxer unable to make MP4s that are streamable

I'm editing an MP4 on Android using MediaExtractor to fetch audio and video tracks then creating a new file using MediaMuxer. It works fine. I can play the new MP4 on the phone (and other players) but am unable to stream the file on the web. When I…
mbert65
  • 227
  • 2
  • 7
8
votes
3 answers

Android MediaExtractor and mp3 stream

I am trying to play an mp3 stream using MediaExtractor/MediaCodec. MediaPlayer is out of the question due to latency and long buffer size. The only sample code i have found is this: http://dpsm.wordpress.com/category/android/ The code samples are…
7
votes
1 answer

Decoding audio files and re-encoding to desired PCM format: 44,100 kHz, 2 Channels, 16 Bit

I want to decode audio files to raw PCM data to stream it to a playback device in the local network. I use the new MediaExtractor and MediaCodec classes, introduced with API level 16, for that. The device requires the PCM data to be in 44,100 kHz,…
pocmo
  • 660
  • 6
  • 24
6
votes
0 answers

Android MediaExtractor / MediaCodec Native Crash

I have developed a simple audio player in Android that, among others, plays .mp3-files. To decode the files I am using the Android MediaExtractor and the Android MediaCodec. The sample code looks as follows: int inIndex =…
6
votes
1 answer

Android MediaExtractor readSampleData IllegalArgumentException

I try to follow this question Concatenate multiple mp4 audio files using android´s MediaMuxer and concatenate video files. But for some reason, the MediaExtractor throws an IllegalArgumentException when I call the readSampleData In the official API,…
Taiko
  • 1,351
  • 1
  • 19
  • 35
6
votes
0 answers

How can I extract rtsp data into MediaCodec

I am having issues with MediaPlayer playing my RTSP stream, so i decided to use the lower level APIs - MediaExtractor and MediaCodec. The problem is that the setDataSource() method for MediaExtractor does not accept an RTSP stream. So, my question…
JoeyZee
  • 165
  • 1
  • 8
6
votes
1 answer

Inconsistent sample time / presentation time during video decoding

I'm writing an APP that can encode video by camera input and process video by decode-edit-encode steps. For the camera, I use the Camera class rather than Intent to configure the details settings of the camera. Then I feed the camera frames to the…
Mark
  • 305
  • 5
  • 17
6
votes
2 answers

Use MediaCodec and MediaExtractor to decode and code video

I need to decode a video into a sequence of bitmaps, such that I am able to modify them, and then compress them back to a video file in android. I plan to manage this by using getFrameAtTime and saving it to an image sequence. Then I can modify…
G.T.
  • 562
  • 8
  • 18
5
votes
2 answers

MediaExtractor throws IllegalArgumentException when used with wav file

I am using the Android MediaExtractor like this: MediaExtractor extractor = new MediaExtractor(); extractor.setDataSource("path/to/my/wav/file.wav"); extractor.selectTrack(0); ByteBuffer inputBuffer = codec.getInputBuffer(inputBufferIndex); int…
muetzenflo
  • 5,653
  • 4
  • 41
  • 82
5
votes
1 answer

Decoding Video and Encoding again by Mediacodec gets a corrupted file

I am trying to implement https://android.googlesource.com/platform/cts/+/jb-mr2-release/tests/tests/media/src/android/media/cts/DecodeEditEncodeTest.java but modifying the source by using a video file mp4. The mime tipe is video/avc, bitrate…
5
votes
1 answer

Android Precise seeking of video

I'm struggling with precise seeking using MediaExtractor's seekTo(). While I can seek to sync frames without problems, I would like to seek to specific time. This question led me to some ideas how to do this, but I'm not sure if they are valid.…
5
votes
0 answers

MediaExtractor throw IOException "Failed to instantiate extractor" when extract ".m4s"

I am trying to implement "m4s" player by mediaExtractor on Android 4.4. However the mediaExtractor throws an IOException when set "m4s" data source. Here is my code snippet below videoExtractor = new MediaExtractor(); try { …
shouyinz
  • 51
  • 2
5
votes
1 answer

How to reduce latency in MediaCodec video/avc decoding

I performed some simple timing of MoviePlayer.java in the Grafika MediaCodec sample code running on a Nexus 5. I put a log statement at these locations: At line 203 just before decoder.queueInputBuffer At line 244…
Peter Tran
  • 1,626
  • 1
  • 17
  • 26
1
2 3
8 9