Inconsistent video quality when encoding camera preview frames with MediaCodec on Xperia Z1

前端 未结 1 1216
囚心锁ツ
囚心锁ツ 2020-12-10 08:31

I am encoding NV21 frames coming from camera preview. For some reason schema which is working fine on other devices works incorrectly on Sony Xperia Z1

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-10 09:22

    Are you sure you pass timestamps in the right unit (microseconds) - and that it has set a sensible framerate?

    • Some encoders might ignore the timestamps and only set a fixed bitrate budget per frame, based on the framerate.

    • Others might try to calculate how many bits they're allowed to use per frame based on the timestamp.

    If the timestamps are given e.g. in milliseconds instead, this could lead to the encoder reducing the size of encoded frames down towards zero.

    0 讨论(0)
提交回复
热议问题