mediacodec

How to query the Video Capabilities of an Android device?

為{幸葍}努か 提交于 2020-01-06 07:15:11
问题 public void getCodecInfo() { int numCodecs = MediaCodecList.getCodecCount(); for (int i = 0; i < numCodecs; i++) { MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i); if (!codecInfo.isEncoder()) { continue; } String[] types = codecInfo.getSupportedTypes(); for (int j = 0; j < types.length; j++) { MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(types[j]); Log.d("CodecCapabilities", new Gson().toJson(capabilities)); //MediaCodecInfo.VideoCapabilities

How to query the Video Capabilities of an Android device?

独自空忆成欢 提交于 2020-01-06 07:15:09
问题 public void getCodecInfo() { int numCodecs = MediaCodecList.getCodecCount(); for (int i = 0; i < numCodecs; i++) { MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i); if (!codecInfo.isEncoder()) { continue; } String[] types = codecInfo.getSupportedTypes(); for (int j = 0; j < types.length; j++) { MediaCodecInfo.CodecCapabilities capabilities = codecInfo.getCapabilitiesForType(types[j]); Log.d("CodecCapabilities", new Gson().toJson(capabilities)); //MediaCodecInfo.VideoCapabilities

decode h264 raw stream using mediacodec

寵の児 提交于 2020-01-06 07:00:33
问题 I recieve h264 data from server, I want to decode this stream using mediacodec and texture view on android.I got the data from the server , parssing it to get the SPS , the PPS and the video frame data, then I passed this data to the mediacodec , but the function dequeueOutputBuffer(info, 100000) always returns -1 and I get dequeueOutputBuffer timed out. Any help please, I'am stucked at this issues from three weeks. this is the code used to decode the video frame. public class

Copy consecutive frames from video

隐身守侯 提交于 2020-01-05 12:12:48
问题 I'm trying to copy a part of a video, and save it as a GIF into the disk. The video can be local or remote, and the copy should be 2s max. I don't need to save every single frame, but every other frame (12-15 fps). I have the "frames to gif" part working, but the "get the frames" part is not great. Here is what I tried so far: - MediaMetadataRetriever : too slow (~1s per frame on a Nexus4), and only works with local files - FFmpegMediaMetadataRetriever: same latency, but works with remote

mediaCodec android- How to do decoding encoding from buffer to buffer

强颜欢笑 提交于 2020-01-05 08:32:55
问题 I want to decode and then encode a video file. The example I found on bigflakes is using the Inputsurface for decoding. I want to directly provide the decoded data to the encoder as input. I am getting error that the output buffer from decoder is null, when I provide that as input to the encoder. Any suggestions ? Thanks 来源: https://stackoverflow.com/questions/25901345/mediacodec-android-how-to-do-decoding-encoding-from-buffer-to-buffer

Why is video made with MediaCodec garbled for Samsung Galaxy S7?

回眸只為那壹抹淺笑 提交于 2020-01-05 06:51:08
问题 When I encode a video via Surface -> MediaCodec -> MediaMuxer, I get a very strange result when testing on the Samsung Galaxy S7. For other devices tested (emulator with Marshmallow and HTC Desire), the video comes out correctly, but on this device the video is garbled. Using MediaCodec to save series of images as Video had a similar output of video, but I don't see how the solution could apply here because I am using a Surface as input and set the color format to COLOR_FormatSurface. I also

Why is video made with MediaCodec garbled for Samsung Galaxy S7?

有些话、适合烂在心里 提交于 2020-01-05 06:51:05
问题 When I encode a video via Surface -> MediaCodec -> MediaMuxer, I get a very strange result when testing on the Samsung Galaxy S7. For other devices tested (emulator with Marshmallow and HTC Desire), the video comes out correctly, but on this device the video is garbled. Using MediaCodec to save series of images as Video had a similar output of video, but I don't see how the solution could apply here because I am using a Surface as input and set the color format to COLOR_FormatSurface. I also

How do I correctly convert YUV colours to RGB in Android?

此生再无相见时 提交于 2020-01-05 04:51:46
问题 I am using MediaCodec to retrieve frames from a video on the SD card. I am using ScriptIntrinsicYuvToRGB to convert the outputted frames of the MediaCodec to RGB. Then I am displaying them in a TextureView. The problem is, the RGB colours are wrong (e.g. The grass is meant to be green. NOT purplish-grey) Anybody know how to fix this please? Thanks 来源: https://stackoverflow.com/questions/29953508/how-do-i-correctly-convert-yuv-colours-to-rgb-in-android

How do I correctly convert YUV colours to RGB in Android?

╄→гoц情女王★ 提交于 2020-01-05 04:51:05
问题 I am using MediaCodec to retrieve frames from a video on the SD card. I am using ScriptIntrinsicYuvToRGB to convert the outputted frames of the MediaCodec to RGB. Then I am displaying them in a TextureView. The problem is, the RGB colours are wrong (e.g. The grass is meant to be green. NOT purplish-grey) Anybody know how to fix this please? Thanks 来源: https://stackoverflow.com/questions/29953508/how-do-i-correctly-convert-yuv-colours-to-rgb-in-android

Decoding H264 stream bufferInfo.size is always zero

牧云@^-^@ 提交于 2020-01-05 03:52:11
问题 I've got an H264 stream and want to use MediaCodec to decode it to surface to display. Because I'm only decoding, and want to target as many devices as possible, I'm supporting API 16 and used the ExtractMpegFrames test as reference. http://bigflake.com/mediacodec/ExtractMpegFramesTest.java.txt When calling dequeOutputBuffers(info,timeout); the info.size is always zero. If I hardcode releaseOutputBuffer(index,true); i get the display (depending on how i set up surface... creating a surface in