私はOpenGLの画像を描画するサーフェスを使用しています。私はMediaCodecを使用してビデオをエンコードする際に、いくつかの画像については、その結果は...ピクセル化、または圧縮に見えるAndroid - MediaCodecでの動画のエンコードの品質
オリジナル背景画像:エンコード
結果:
左下隅にピクセル化されていることがわかります。ここで
は、私がMediaCodecエンコーダを作成するために使用する値である:
int width = 800;
int height = 800;
int bitRate = 10485760; // bps, = 10Mbps (1080p)
bufferInfo = new MediaCodec.BufferInfo();
MediaFormat format = MediaFormat.createVideoFormat(GLVideoEncoderImpl.MIME_TYPE, width, height);
// Set some properties. Failing to specify some of these can cause the MediaCodec
// configure() call to throw an unhelpful exception.
format.setInteger(MediaFormat.KEY_COLOR_FORMAT,
MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
format.setInteger(MediaFormat.KEY_BIT_RATE, bitRate);
format.setInteger(MediaFormat.KEY_FRAME_RATE, 30);
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);
try {
mediaCodec = MediaCodec.createEncoderByType(GLVideoEncoderImpl.MIME_TYPE);
} catch (IOException e) {
e.printStackTrace();
UtilsAndroid.throwException("Impossible to create media codec");
}
mediaCodec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
は、出力品質を向上させることが可能ですか?事前に感謝します
ありがとうございました。残念ながら、私は何度もパラメータを変更しました。 (2Mbpsから20Mbpsのビットレートから)、0 iフレームから200 iフレーム(1,2,3,5,10,20,100など)を試してみました。そして、何も見栄えが良いように見えません。私の800x800ビデオは16秒の長さを持ち、10Mo、iフレーム間隔は5です。それは私が持つことができる最高の品質ですが、まだそれはありませんとても良い... – Xys