ACodec configureCodec returning error -38 - android

I am trying to configure a video encoder using MediaCodec for mime=video/avc, width=1920, height=1080.
Unfortunately the device complains with the following log:
12-20 13:11:49.410 5781-5817/ I/OMXClient: Treble IOmx obtained
12-20 13:11:49.423 5781-5817/ E/ACodec: [OMX.google.h264.encoder] configureCodec returning error -38
12-20 13:11:49.424 5781-5817/ E/ACodec: signalError(omxError 0x80001001, internalError -2147483648)
12-20 13:11:49.424 5781-5816/ E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 3
12-20 13:11:49.425 5781-5801/ E/MediaCodec: configure failed with err 0x80001001, resetting...
12-20 13:11:49.433 5781-5817/com.humaneyes.filesave I/OMXClient: Treble IOmx obtained

Some codecs are finicky and require special properties.
Failing to specify some of these can cause the MediaCodec configure()
call to throw an unhelpful exception.
Must define the following integer properties in the MediaFormat at a minimum:
MediaFormat.KEY_BIT_RATE
MediaFormat.KEY_FRAME_RATE
MediaFormat.KEY_I_FRAME_INTERVAL
MediaFormat.KEY_COLOR_FORMAT
For example:
MediaFormat mediaFormat = MediaFormat.createVideoFormat("video/avc", 1920, 1080);
mediaFormat.setInteger(MediaFormat.KEY_BIT_RATE, 2000000);
mediaFormat.setInteger(MediaFormat.KEY_FRAME_RATE, 30);
mediaFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar);
mediaFormat.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 1);

Related

android webrtc crash Unable to instantiate codec 'OMX.qcom.video.decoder.vp8' with err 0xfffffff4

im using webrtc for calling, but it's crash in China rom device mostly but also some others(even samsung). here is the crash log:
2021-09-12 18:29:31.899 1218-14625/? E/OMX-VDEC-1080P: Omx_vdec::Comp Init Returning failure, errno 12
2021-09-12 18:29:31.899 1218-14625/? E/OMX-VDEC-1080P: eventfd_write failed for fd: -1, errno = 9, force stop async_thread
2021-09-12 18:29:31.899 1218-14625/? E/OMX-VDEC-1080P: Invalid input: -1
2021-09-12 18:29:31.913 1218-14625/? E/android.hardware.media.omx#1.0-service: Failed to allocate omx component 'OMX.qcom.video.decoder.vp8' err=InsufficientResources(0x80001000)
2021-09-12 18:29:31.916 3298-27657/com.civix.link E/ACodec: Unable to instantiate codec 'OMX.qcom.video.decoder.vp8' with err 0xfffffff4.
2021-09-12 18:29:31.916 3298-27657/com.civix.link E/ACodec: signalError(omxError 0xfffffff4, internalError -12)
2021-09-12 18:29:31.918 3298-27656/com.civix.link E/MediaCodec: Codec reported err 0xfffffff4, actionCode 0, while in state 1
2021-09-12 18:29:31.924 1195-32507/? E/ResourceManagerService: getLowestPriorityBiggestClient_l: lowest priority 0 vs caller priority 0
2021-09-12 18:29:31.925 3298-25911/com.civix.link W/MediaCodec-JNI: try to release MediaCodec from JMediaCodec::~JMediaCodec()...
2021-09-12 18:29:31.925 3298-25911/com.civix.link W/MediaCodec-JNI: done releasing MediaCodec from JMediaCodec::~JMediaCodec().
2021-09-12 18:29:31.925 3298-25911/com.civix.link W/System.err: android.media.MediaCodec$CodecException: Failed to initialize OMX.qcom.video.decoder.vp8, error 0xfffffff4
2021-09-12 18:29:31.925 3298-25911/com.civix.link W/System.err: at android.media.MediaCodec.native_setup(Native Method)
2021-09-12 18:29:31.925 3298-25911/com.civix.link W/System.err: at android.media.MediaCodec.<init>(MediaCodec.java:1912)
2021-09-12 18:29:31.925 3298-25911/com.civix.link W/System.err: at android.media.MediaCodec.createByCodecName(MediaCodec.java:1890)
2021-09-12 18:29:31.925 3298-25911/com.civix.link W/System.err: at org.webrtc.HardwareVideoDecoder.initDecodeInternal(HardwareVideoDecoder.java:173)
2021-09-12 18:29:31.925 3298-25911/com.civix.link W/System.err: at org.webrtc.HardwareVideoDecoder.initDecode(HardwareVideoDecoder.java:150)
2021-09-12 18:29:31.925 3298-25911/com.civix.link E/rtc: #
# Fatal error in: gen/sdk/android/generated_base_jni/jni/../../../../../../../../../usr/local/google/home/sakal/code/webrtc-aar-release/src/sdk/android/src/jni/jni_generator_helper.h, line 37
# last system error: 0
# Check failed: !env->ExceptionCheck()
#
I have some device work normally, but in some device(even Samsung) it crash after 1 minute -> 30 minutes running call.
About my webrtc, im using default all:
peerConnectionFactory = PeerConnectionFactory.builder()
.setOptions(options)
.setVideoEncoderFactory(new DefaultVideoEncoderFactory(MeetingClient.mRootEglBase.getEglBaseContext(), true, true))
.setVideoDecoderFactory(new DefaultVideoDecoderFactory(MeetingClient.mRootEglBase.getEglBaseContext()))
.createPeerConnectionFactory();
Can someone tech me how to solve this? Thanks

ExoPlayer error: ACodec: signalError(omxError 0x80001019, internalError -2147483648)

I encountered an error when using react-native-video to play m3u8. What caused this?
m3u8 comes with a key, some can be played, some cannot be played
08-13 14:12:45.847 E/ACodec: [OMX.qcom.video.decoder.avc] storeMetaDataInBuffers failed w/ err -1010
08-13 14:12:45.878 E/ACodec: [OMX.qcom.video.decoder.avc] ERROR(0x80001019)
08-13 14:12:45.878 E/ACodec: signalError(omxError 0x80001019, internalError -2147483648)
08-13 14:12:45.884 E/MediaCodec: Codec reported err 0x80001019, actionCode 0, while in state 6
08-13 14:12:45.922 E/ExoPlayerImplInternal: Internal runtime error.
java.lang.IllegalStateException
at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)

How to fix videos that can be played although they are corrupted

My case is, I did to convert a video with a mediacodec lib, then I sent the converted file to another device. Before I sent to another device, that file could run normally. But when file is received, that file is corrupted but still can be played and show a dialog like "Can't properly play this file due to an unexpected error has occured".
This is an error log:
05-26 10:10:53.522 299-12376/? E/ACodec: [OMX.Intel.aac.decoder] ERROR(0x80001001)
05-26 10:10:53.522 299-12376/? E/ACodec: signalError(omxError 0x80001001, internalError -2147483648)
05-26 10:10:53.522 299-12376/? E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 6
05-26 10:10:53.522 299-12375/? E/NuPlayerDecoder: Failed to dequeue input buffer for OMX.Intel.aac.decoder (err=-38)
05-26 10:10:53.523 299-12365/? E/NuPlayer: received error(0xffffffda) from audio decoder, flushing(0), now shutting down
05-26 10:10:53.523 2608-14507/? E/MediaPlayer: error (1, -38)
05-26 10:10:53.523 2608-2608/? E/MediaPlayer: Error (1,-38)
05-26 10:10:53.523 2608-2608/? D/VideoView: Error: 1,-38
05-26 10:10:53.523 2608-2608/? D/MoviePlayerForL: Gallery MoviePlayer Receive error
05-26 10:10:53.523 299-12375/? E/NuPlayerDecoder: failed to flush OMX.Intel.aac.decoder (err=-38)
05-26 10:10:53.523 299-12365/? E/NuPlayer: received error(0xffffffda) from audio decoder, flushing(2), now shutting down
05-26 10:10:53.526 2608-29677/? E/MediaPlayer: error (1, -38)
05-26 10:10:53.527 299-12376/? E/SimpleSoftOMXComponent: 1
05-26 10:10:53.527 299-12376/? E/SimpleSoftOMXComponent: 2
05-26 10:10:53.527 299-12376/? E/SimpleSoftOMXComponent: 3
Now my question is, what makes that file is broken and how to fix it?

use android mediacodec encode aac on galaxy s4 4.3

I use MediaCodec to encode aac stream and then mux to mp4, I test on most devices works properly , but on Galaxy S4 with 4.3, API level 18, the problem cames, below is the code:
if (mHasAudioTrack) {
mAudioCodec = MediaCodec.createEncoderByType("audio/mp4a-latm");
MediaFormat audioFormat = MediaFormat.createAudioFormat("audio/mp4a-latm", 44100, 2);
audioFormat.setInteger(MediaFormat.KEY_AAC_PROFILE, MediaCodecInfo.CodecProfileLevel.AACObjectLC);
audioFormat.setInteger(MediaFormat.KEY_CHANNEL_MASK, AudioFormat.CHANNEL_IN_STEREO);
audioFormat.setInteger(MediaFormat.KEY_CHANNEL_COUNT, 2);
audioFormat.setInteger(MediaFormat.KEY_BIT_RATE, 128000);
try {
mAudioCodec.configure(audioFormat, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
} catch (Exception e) {
Log.e(logTag, "configure audio codec err:"+e.getMessage()+"use no audio");
mHasAudioTrack = false;
mAudioCodec.release();
}
}
and the error log is:
> 11-16 11:40:51.006 20858-21098/com.youku.demorecord
> E/TDScreenVideoWriter﹕ Create media codec context. 11-16 11:40:51.126
> 20858-21594/com.youku.demorecord W/ACodec﹕ [OMX.google.aac.decoder]
> Failed to set standard component role 'audio_encoder.aac'. 11-16
> 11:40:51.126 20858-21594/com.youku.demorecord E/ACodec﹕
> [OMX.google.aac.decoder] configureCodec returning error -2147483648
> 11-16 11:40:51.126 20858-21594/com.youku.demorecord E/MediaCodec﹕
> Codec reported an error. (omx error 0x80001001, internalError
> -2147483648) 11-16 11:40:51.126 20858-21098/com.youku.demorecord E/TDScreenVideoWriter﹕ configure audio codec err:nulluse no audio
Any parameters is wrong?
Is there any guys face same problem and can give me some tips? thanks very much.
btw:I don't want to compile third aac encoder library use ndk.

Media Codec : Insufficient sized buffer

When i play video with resolution 704x576 (using MediaCodec) . I'm seeing this error and app is crashing
Logs:
12-04 04:35:55.507 E/OMX-VDEC-1080P( 9621): Insufficient sized buffer given for playback, expected 2514944, got 2506752
12-04 04:35:55.507 E/OMXNodeInstance( 9621): OMX_UseBuffer failed with error -2147479547 (0x80001005)
12-04 04:35:55.507 E/ACodec (22699): registering GraphicBuffer 0 with OMX IL component failed: -2147483648
12-04 04:35:55.507 E/ACodec (22699): Failed to allocate output port buffers after port reconfiguration (error 0x80000000)
12-04 04:35:55.507 E/MediaCodec(22699): Codec reported an error. (omx error 0x80001001, internalError -2147483648)

Categories

Resources