Home > Mobile >  MediaCodec recorded video is cut, there is a great god know why?
MediaCodec recorded video is cut, there is a great god know why?

Time:11-19

[images] [images]
Figure is a preview, figure 2 is the generated video, resolution preview ratio is 1280 x720, generate video is 720 x1280, didn't find the reason I want to a day, want to turn to the great god,
MediaCodec is directly obtained theoretically surfaceView data, why I will be cutting?

CodePudding user response:


Add pictures,

CodePudding user response:

How do I think is you initialize mediacodec, read the wide high whole...

CodePudding user response:

No, the demo is the https://github.com/ChinaZeng/SurfaceRecodeDemo,
Set is 1280 x720, width and height when I run the debug is right
//configuration video media format
Final MediaFormat format=MediaFormat. CreateVideoFormat (AYMediaCodecHelper MIME_TYPE, width, height);
Format. SetInteger (MediaFormat. KEY_COLOR_FORMAT, MediaCodecInfo. CodecCapabilities. COLOR_FormatSurface);
Format. SetInteger (MediaFormat KEY_BIT_RATE, bitrate);
Format. SetInteger (MediaFormat KEY_FRAME_RATE, FPS);
Format. SetInteger (MediaFormat KEY_I_FRAME_INTERVAL, iFrameInterval);
  • Related