mediacodec

media extractor show “failed to instantiate extractor”

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to work on media extractor for audio streaming of OGG file format on android. I have written some code with help of google documents. but it doesn't work at all. May be i have Written a wrong code or syntax As i am student. it show me failed to instantiate extractor public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); MediaExtractor extractor = new MediaExtractor(); extractor.setDataSource("http://examplelink.com/ogg");// I cant put real link so sorry for

Android MediaCodec, decoding MJPEG frames

匿名 (未验证) 提交于 2019-12-03 08:30:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: EDIT: Nevermind, I solved my problem. //------------------------------------------------------------------------------ I'm having some problems trying to do MJPEG stream decoding using Android MediaCodec API. What I'm trying to do is to stream jpeg frames from my webcam and display them using hardware accelerated decoding on my android device (currently I'm using Nvidia Shield Tablet, Android 6.0). Right now I'm at the point where I receive a jpeg frame and I can display it on the screen by using BitmapFactory.decodeStream() function.

Android Precise seeking of video

陌路散爱 提交于 2019-12-03 08:17:42
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. Basicly, I would have to seek to closest previous sync frame and then advance() the extractor until target time is reached. Every frame in the process would be fed to the decoder, i.e the first I-frame and the rest P-frames. This is related code snippet (based on google/grafika 's MoviePlayer): extractor.seekTo((long) seekTarget[threadNr],

MediaCodec audio/video muxing issues ond Android

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am transcoding videos based on the example given by Google ( https://android.googlesource.com/platform/cts/+/master/tests/tests/media/src/android/media/cts/ExtractDecodeEditEncodeMuxTest.java ) Basically, transocding of MP4 files works, but on some phones I get some weird results. If for example I transcode a video with audio on an HTC One, the code won't give any errors but the file cannot play afterward on the phone. If I have a 10 seconds video it jumps to almost the last second and you only here some crackling noise. If you

How to play raw h264 produced by MediaCodec encoder?

这一生的挚爱 提交于 2019-12-03 06:25:46
问题 I'm a bit new when it comes to MediaCodec (and video encoding/decoding in general), so correct me if anything I say here is wrong. I want to play the raw h264 output of MediaCodec with VLC/ffplay. I need this to play becuase my end goal is to stream some live video to a computer, and MediaMuxer only produces a file on disk rather than something I can stream with (very) low latency to a desktop. (I'm open to other solutions, but I have not found anything else that fits the latency requirement)

IllegalStateException at MediaCodec.dequeInputBuffer / dequeOutputBuffer

99封情书 提交于 2019-12-03 05:39:05
I am trying to convert a PNG file to a one slice video clip, so to just to make a start-up over a project. What I had code to make it happen is :- private boolean MediaConversion() { MediaCodec codec = MediaCodec.createEncoderByType(MIMETYPE); MediaFormat mediaFormat = null; if(CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_720P)){ mediaFormat = MediaFormat.createVideoFormat(MIMETYPE, 1280 , 720); } else { mediaFormat = MediaFormat.createVideoFormat(MIMETYPE, 720, 480); } mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, 700000); mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, 10);

Android Video Circular Buffer with Sound

雨燕双飞 提交于 2019-12-03 05:18:12
问题 I am using Google's Open Source Example: Grafika . I am using it's ContinuousCaptureActivity.java The CircularBuffer's Implementation is demonstrated in this Activity, but there is no audio included in the resultant Video file. I want to add the Audio Recording functionality within this Activity and add the recorded Audio into the Video in the same CircularBuffered Fashion. For achieving this i have explored the MediaCodec Library, which was introduced in 4.3+ versions. I have also used

Muxing AAC audio with Android's MediaCodec and MediaMuxer

淺唱寂寞╮ 提交于 2019-12-03 04:27:15
问题 I'm modifying an Android Framework example to package the elementary AAC streams produced by MediaCodec into a standalone .mp4 file. I'm using a single MediaMuxer instance containing one AAC track generated by a MediaCodec instance. However I always eventually get an error message on a call to mMediaMuxer.writeSampleData(trackIndex, encodedData, bufferInfo) : E/MPEG4Writer﹕timestampUs 0 < lastTimestampUs XXXXX for Audio track When I queue the raw input data in mCodec.queueInputBuffer(...) I

Use MediaCodec and MediaExtractor to decode and code video

放肆的年华 提交于 2019-12-03 03:41:34
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 images in the sequence and code it back to a movie. But I have two problem with this: First, as I read it, the getFrameAtTime is for creating thumbnails and will not guarantee returning the correct frame. This makes the video laggy. Secondly, saving the images and reading it back takes a long time. I read that the proper way of doing the decode is with

MediaCodec and 24 bit PCM

匿名 (未验证) 提交于 2019-12-03 03:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am successfully using MediaCodec to decode audio, however when I load a file with 24-bit samples, I have no way of knowing this has occurred. Since the application was assuming 16-bit samples, it fails. When I print the MediaFormat, I see {mime=audio/raw, durationUs=239000000, bits-format=6, channel-count=2, channel-mask=0, sample-rate=96000} I assume that the "bits-format" would be a hint, however this key is not declared in the API, and is not actually emitted when the output format changes. I get {mime=audio/raw, what=1869968451,