arthenica / ffmpeg-kit

FFmpeg Kit for applications. Supports Android, Flutter, iOS, Linux, macOS, React Native and tvOS. Supersedes MobileFFmpeg, flutter_ffmpeg and react-native-ffmpeg.
https://arthenica.github.io/ffmpeg-kit
GNU Lesser General Public License v3.0
4.55k stars 608 forks source link

Can not decode h264 stream with h264_mediacodec #450

Open greensea opened 2 years ago

greensea commented 2 years ago

Description Using h264_mediacodec decoder on android to decode a h264 stream, but the decoder not work, keep printing Error while decoding stream #0:0: Try again message.

Expected behavior It should decode the h264 stream.

Current behavior The input stream can not be decode.

To Reproduce Use the ffmpeg-kit-test source, build a android package then install. Use the command to decode a h264 stream:

-vcodec h264_mediacodec  -i http://admin:admin@192.168.8.78:8081/live.flv  -vcodec mjpeg -acodec copy -f avi -y /dev/null

Screenshots Nnoe.

Logs (ghostbin is down right now, I paste the logs at github gist) ffmpeg log: https://gist.github.com/greensea/8b6b7261e06a7e47cb657184d124ef42 adb log: https://gist.github.com/greensea/7a98cc9ba8f87025d5760676457784e8

Environment

Other I test this on several devices, but still got this error. I also test other h264 streams, but also got this error. I also try decode a local h264 video file recorded by the device (-i /sdcard/DCIM/Camera/VID_xxxx.mp4), but still got this error.

I find some error log in adb logs:

06-03 15:51:07.889  1415 25472 E OMX-VDEC-1080P: Setparameter: unknown param 2130706434
06-03 15:51:07.889  1415 25472 E OMX-VDEC-1080P: set_parameter: Error: 0x8000101a, setting param 0x7f000002
06-03 15:51:07.889  1415 25472 E OMXNodeInstance: setParameter(0xeb0db404:qcom.decoder.avc, ??(0x7f000002)) ERROR: UnsupportedIndex(0x8000101a)

I am not sure if it is the cause of this issue.

tanersener commented 2 years ago

Well, h264_mediacodec is not one of the decoders we are testing regularly.

h264_mediacodec decoder source code is coming from ffmpeg. So, I'l mark this issue as ffmpeg-bug.

I suggest using the previous version v4.5.LTS or waiting for the next release, which will be released in July.