On Sat, 5 Oct 2024, Zhao Zhili wrote:

From: Zhao Zhili <zhiliz...@tencent.com>

MediaCodec can generate AV1CodecConfigurationRecord, which shouldn't
be put into packet->data. Skip four bytes and extract configOBUs
if it exist.
---
I did some test on Pixel 8 Pro. AV1 hardware encoding works with a lot
of bugs:

1. It's broken for width non-aligned to 16. For width 1080 and pixel
format YUV420P, MediaCodec use 1080 as stride. For pixel format NV12,
MediaCodec use 1088 as stride. There is no API to get the stride info.
AMEDIAFORMAT_KEY_STRIDE doesn't work. And set stride to MediaCodec has
no effect from my test, at least on that device. We know the buffer
size provided by MediaCodec, but we still cannot get stride by
buf_size / height:

 1) For YUV420P, buf_size = 1080 * height
 2) For NV12, buf_size = 1080 + 1088 * (height - 1). Yes, buf_size doesn't
count last line's padding :(

Isn't this pretty much the case for the encoders for other codecs as well - there aren't really any compat guarantees for how they behave for widths that aren't a multiple of 16? At least back when there when Android added CTS tests to guarantee some sort of cross device consistent behaviour, they only tested/mandated the behviour for a couple resolutions, that all were even multiples of 16.

I guess the difference here is whether it's possible to do cropping in the same way as via the h264_metadata/hevc_metadata BSFs?

// Martin

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to