Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaCodec & Android: crashes with generic error #1027

Open
filnik opened this issue Aug 27, 2024 · 2 comments
Open

MediaCodec & Android: crashes with generic error #1027

filnik opened this issue Aug 27, 2024 · 2 comments

Comments

@filnik
Copy link

filnik commented Aug 27, 2024

I've tried to compile by hand the ffmpeg-kit adding the mediacodec. The build should be successful since I'm able to use libopenh264 correctly.

However, if I set the codec to h264_mediacodec I got a generic error :

[amediacodec @ 0xb400007947296700] android.media.MediaCodec$CodecException: Error 0xffffffc3
[h264_mediacodec @ 0xb4000079e3740800] MediaCodec configure failed, Generic error in an external library

and I cannot find a way to make it work. The command I'm using is the following:

val VIDEO_WIDTH = 1080
val VIDEO_HEIGHT = 1920
val BITRATE_MBS = 7 * 1000000 // 7 Mbps
val cmd = mutableListOf(
    "-y",
    "-i", tempInputFile.absolutePath,
    "-vf", "scale=w=$VIDEO_WIDTH:h=$VIDEO_HEIGHT:force_original_aspect_ratio=decrease",
    "-c:v", "h264_mediacodec",
    "-b:v", "$BITRATE_MBS",
    outputPath
)

Any idea to solve the issue would be really appreaciated! Thank you :)

@github-staff github-staff deleted a comment from mengyanshou Aug 29, 2024
@HitRoxxx
Copy link

ffmpeg CLI does not support h264_mediacodec or any mediacodec encoder/decoder.

@cinemast
Copy link

cinemast commented Sep 23, 2024

Do you have any reference ffmpeg CLI not supporting h264_mediacodec?

Here is an excerpt from ffmpeg -codecs from a Nokia 7.2

DEV.L. h261                 
 DEV.L. h263                  (decoders: h263 h263_v4l2m2m ) (encoders: h263 h263_v4l2m2m )
 D.V.L. h263i                
 DEV.L. h263p                
 DEV.LS h264                  (decoders: h264 h264_v4l2m2m h264_mediacodec ) (encoders: h264_mediacodec h264_v4l2m2m )
 DEVIL. hap                  
 DEVIL. hdr                  
 DEV.L. hevc                  (decoders: hevc hevc_v4l2m2m hevc_mediacodec ) (encoders: hevc_mediacodec hevc_v4l2m2m libkvazaar )
 D.V.L. hnm4video            

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@cinemast @filnik @HitRoxxx and others