Opened 2 months ago

#11178 new defect

MediaCodec: Hardware decode wrong crop values on MediaTek SOC (width=319 height=239)

Reported by: littux Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: mediacodec hwaccel hw_decode android avcodec
Cc: littux Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When using -hwaccel mediacodec on Android, the output resolution is always 319x239 on my phone with a MediaTek SOC (MediaTek Helio G80). The video is improperly cropped and there's a green line on the bottom of the video (See "mtk_wrong_crop_result.mkv" attachment)

Meanwhile, it works fine on my other phone which has a Snapdragon 680 (Same ffmpeg build).

How to reproduce:
Just use -hwaccel mediacodec on any file (On a phone with a MediaTek SOC)

% ffmpeg -hwaccel mediacodec -i file -f null -

Additional info:
Android version: 13
FFmpeg configuration:

ffmpeg version git-2024-08-22-cfe0a36 Copyright (c) 2000-2024 the FFmpeg developers
  built with clang version 18.1.8
  configuration: --cpu=host --disable-debug --disable-decoder=opus --disable-decoder=vorbis --disable-encoder=opus --disable-encoder=vorbis --disable-ffplay --disable-indevs --disable-outdevs --disable-static --disable-symver --enable-gnutls --enable-gpl --enable-indev=android_camera --enable-indev=lavfi --enable-indev=v4l2 --enable-jni --enable-libass --enable-libbluray --enable-libcaca --enable-libcodec2 --enable-libdav1d --enable-libdvdnav --enable-libdvdread --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenmpt --enable-libopus --enable-libpulse --enable-libqrencode --enable-librtmp --enable-librubberband --enable-libsmbclient --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lto --enable-mediacodec --enable-neon --enable-nonfree --enable-opencl --enable-outdev=caca --enable-outdev=pulse --enable-shared --enable-version3 --enable-vulkan --extra-cflags='-march=native -pipe' --extra-libs=-landroid-glob --prefix=/data/data/com.termux/files/usr --target-os=android
  libavutil      59. 34.100 / 59. 34.100
  libavcodec     61. 11.100 / 61. 11.100
  libavformat    61.  5.101 / 61.  5.101
  libavdevice    61.  2.100 / 61.  2.100
  libavfilter    10.  2.102 / 10.  2.102
  libswscale      8.  2.100 /  8.  2.100
  libswresample   5.  2.100 /  5.  2.100
  libpostproc    58.  2.100 / 58.  2.100

Attached logs, the original and the transcoded files

Attachments (3)

ffmpeg-20240907-160002.log (36.8 KB ) - added by littux 2 months ago.
ffmpeg log
mtk_wrong_crop_result.mkv (1.3 MB ) - added by littux 2 months ago.
original_vid_no_hwaccel.mkv (1.9 MB ) - added by littux 2 months ago.
Original video (skipped last 20 seconds)

Change History (3)

by littux, 2 months ago

Attachment: ffmpeg-20240907-160002.log added

ffmpeg log

by littux, 2 months ago

Attachment: mtk_wrong_crop_result.mkv added

by littux, 2 months ago

Attachment: original_vid_no_hwaccel.mkv added

Original video (skipped last 20 seconds)

Note: See TracTickets for help on using tickets.