mediacodec

Type list of MediaCodec.createDecoderByType (String type)

孤人 提交于 2019-12-23 02:52:34
问题 Where can I find the complete list of the type used in MediaCodec.createDecoderByType (String type)? Google's document only gives a partial list. Update[2015-06-03] Per pskink's tip, I ran a piece of code to extract all the decode's MIME types on an Asus MeMO tablet. Here is the list video/avc video/3gpp video/mp4v-es audio/3gpp audio/amr-wb audio/mp4a-latm audio/flac audio/mp4a-latm Using the method suggested by fadden(adb shell cat /system/etc/media_codecs.xml), I got the following

Regarding Android's Mediacodec speed concerns and bottlenecks

喜欢而已 提交于 2019-12-23 01:44:07
问题 Currently, my encoding a 30 FPS video consisting of 90 frames using Mediacodec takes 2100-2400 ms. I'm using the code found here, except with the generateSurfaceFrame(i) part being replaced with: private void generateFrame(Bitmap bitmap, Rect source) { long drawFrameStartTime = System.currentTimeMillis(); Canvas canvas = mInputSurface.lockCanvas(null); canvas.drawRect(0, 0, mSquareDim, mSquareDim, clearPaint); //Process the canvas below try { canvas.drawBitmap(bitmap, source, new Rect(0, 0,

Z-order issue with MediaCodec and TextureView

痴心易碎 提交于 2019-12-22 21:26:07
问题 In my Android app I have the need to render three views with the following Z-order: At bottom, the output surface of a MediaCodec decoder covering the whole screen. I have the requirement that I have to transform the image produced by MediaCodec (e.g. scale it) In the middle, a GLSurfaceView (or other surface/view running GL shaders I define), covering the whole screen. Obviously some of the pixels in this layer will be transparent, in order to see the MediaCodec output beneath. On top, any

MediaCodec encoder using Surface crashes inconsistently on various devices

你。 提交于 2019-12-22 11:25:27
问题 I'm developing an app that post processes video by applying graphics and text to the video. My code is based on the Android CTS test DecodeEditEncodeTest and it works great on the Nexus 4 and Nexus 5 (4.4) but not on any other device I've tried; not even the Nexus 7 II on 4.4. For example, on a Galaxy S3, I get the following errors: E/ACodec(17651): configureCodec multi window instance fail appPid : 17651 E/ACodec(17651): [OMX.qcom.video.decoder.avc] configureCodec returning error -38 E

Android MediaCodec: encoding falis because no sync frames for video track

我是研究僧i 提交于 2019-12-22 09:47:59
问题 I am planning to convert a video file to another video file with different bitrate, fps, etc. Bascially I follow the examples in http://bigflake.com/mediacodec However, Log shows error of no sync frames for video track: submitted frame 5 to dec, size=47398 no output from encoder available decoder output format changed: {height=1080, what=1869968451, color-format=2141391875, slice-height=1088, crop-left=0, width=1920, crop-bottom=1079, crop-top=0, mime=video/raw, stride=1920, crop-right=1919}

Android MediaCodec for HEVC

北城以北 提交于 2019-12-21 23:27:40
问题 I'm looking into using the android MediaCodec class to decode HEVC. Are there any examples of projects that do this? At present I configure the decoder with the following: AMEDIAFORMAT_KEY_MIME: "video/hevc" AMEDIAFORMAT_KEY_MAX_HEIGHT: 4320 AMEDIAFORMAT_KEY_MAX_WIDTH: 8192 AMEDIAFORMAT_KEY_HEIGHT: 1600 AMEDIAFORMAT_KEY_WIDTH: 3840 AMEDIAFORMAT_KEY_FRAME_RATE: 24 AMEDIAFORMAT_KEY_PUSH_BLANK_BUFFERS_ON_STOP: 1 When using this setup, I get no video output. I've also tried setting csd-0 , csd-1

Raw H.264 stream output by MediaCodec not playble

蹲街弑〆低调 提交于 2019-12-21 20:46:37
问题 I am creating raw H.264 stream output by MediaCodec. The problem is the output file is not playable in android default player (API 16). How can it be that Android can export file that is not playable in player, only in VLC on the PC. Maybe some thing wrong with my code? My video is 384x288. public class AvcEncoder { private MediaCodec mediaCodec; private BufferedOutputStream outputStream; private File f; public AvcEncoder(int w, int h, String file_name) { f = new File(file_name + ".mp4"); try

Android MediaCodec Format/Resolution Change mid-stream

心已入冬 提交于 2019-12-21 20:26:16
问题 I'm processing a live stream via MediaCodec and have a scenario where the MediaFormat changes mid-stream (ie: resolution of the video being decoded changes). Given I'm attaching the decoder to a Surface to render it as soon as I detect the change in resolution on the incoming stream I recreate the decoder before feeding it the new resolution buffer (providing it with the proper new MediaFormat ). I've been getting some weird errors which don't give me too much info as to what could be wrong,

MediaCodec audio/video muxing issues ond Android

北战南征 提交于 2019-12-21 17:32:50
问题 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

How to use MediaCodec to decode data from RTSP server?

社会主义新天地 提交于 2019-12-21 15:04:58
问题 I tried setDataSource() in MediaExtractor class but it doesn't work with RTSP path. I can use the same path with MediaPlayer class and it works but it is very important for me to use MediaCodec class instead. I think Android doesn't have any RTSP API I could use nor I can find any RTSP libraries for Android. Is there a relatively easy way of feeding video stream from RTSP server into MediaCodec class? 回答1: No easy way. I ended up using this project: https://code.google.com/p/android-rtsp