You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unexpected error while transcoding. (AskGemini)
java.lang.IllegalArgumentException:Failed to initialize video/dolby-vision, error 0xfffffffe (NAME_NOT_FOUND)
at android.media.MediaCodec.native_setup(NativeMethod)
at android.media.MediaCodec.<init>(MediaCodec.java:2154)
at android.media.MediaCodec.<init>(MediaCodec.java:2132)
at android.media.MediaCodec.createDecoderByType(MediaCodec.java:2069)
at com.otaliastudios.transcoder.internal.codec.Decoder.<init>(Decoder.kt:43)
at com.otaliastudios.transcoder.internal.pipeline.PipelinesKt.VideoPipeline$lambda$1(pipelines.kt:62)
at com.otaliastudios.transcoder.internal.pipeline.PipelinesKt.$r8$lambda$m1rlbwqPaEygFy8BQNNSagwe4_w(UnknownSource:0)
at com.otaliastudios.transcoder.internal.pipeline.PipelinesKt$$ExternalSyntheticLambda1.invoke(UnknownSource:12)
at com.otaliastudios.transcoder.internal.pipeline.Pipeline$Companion.build$lib_release(Pipeline.kt:169)
at com.otaliastudios.transcoder.internal.pipeline.PipelinesKt.VideoPipeline(pipelines.kt:60)
at com.otaliastudios.transcoder.internal.pipeline.PipelinesKt.RegularPipeline(pipelines.kt:48)
at com.otaliastudios.transcoder.internal.transcode.DefaultTranscodeEngine.createPipeline(DefaultTranscodeEngine.kt:83)
at com.otaliastudios.transcoder.internal.transcode.DefaultTranscodeEngine.access$createPipeline(DefaultTranscodeEngine.kt:27)
at com.otaliastudios.transcoder.internal.transcode.DefaultTranscodeEngine$segments$1.invoke(DefaultTranscodeEngine.kt:42)
at com.otaliastudios.transcoder.internal.transcode.DefaultTranscodeEngine$segments$1.invoke(DefaultTranscodeEngine.kt:42)
at com.otaliastudios.transcoder.internal.Segments.tryCreateSegment(Segments.kt:87)
at com.otaliastudios.transcoder.internal.Segments.next(Segments.kt:46)
at com.otaliastudios.transcoder.internal.transcode.DefaultTranscodeEngine.transcode(DefaultTranscodeEngine.kt:114)
at com.otaliastudios.transcoder.internal.transcode.TranscodeEngine$Companion.transcode(TranscodeEngine.kt:48)
at com.otaliastudios.transcoder.internal.transcode.TranscodeEngine.transcode(UnknownSource:2)
at com.otaliastudios.transcoder.Transcoder$1.call(Transcoder.java:102)
at com.otaliastudios.transcoder.Transcoder$1.call(Transcoder.java:99)
at java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
2025-02-0710:52:48.4869692-9692<no-tag><package-name>ETranscodingfor content://com.google.android.apps.docs.storage.legacy/enc%3Dencoded%3DW0Q7pRNUU33m6n98tAFuukNHbP3oKVm9OIHRCUrI2Cfll5wc9TDP3qlZgCGCoQ%3D%3D failed with exception: java.lang.IllegalArgumentException: Failed to initialize video/dolby-vision, error 0xfffffffe (NAME_NOT_FOUND)2025-02-0710:52:48.6749692-12632MediaMetad...trieverJNI <package-name>E getFrameAtTime: videoFrame is a NULL pointer
2025-02-0710:52:48.6759692-12632MediaMetad...trieverJNI <package-name>E getFrameAtTime: videoFrame is a NULL pointer
2025-02-0710:52:48.6839692-12632MediaMetad...trieverJNI <package-name>E getFrameAtTime: videoFrame is a NULL pointer
/** * Sets the profile to AVCProfileBaseline for compatibility with older devices. * [DefaultVideoStrategy] does not allow to set the output profile, so we need to override * this method to set it manually.*/overridefuncreateOutputFormat(inputFormats:MutableList<MediaFormat>, outputFormat:MediaFormat): TrackStatus {
val result =super.createOutputFormat(inputFormats, outputFormat)
outputFormat.setInteger(MediaFormat.KEY_PROFILE, CodecProfileLevel.AVCProfileBaseline)
val supportedLevel = getSupportedAVCLevel()
if (supportedLevel !=null) {
outputFormat.setInteger(MediaFormat.KEY_LEVEL, supportedLevel)
}
return result
}
/** * Checks the highest supported AVC level. * AVC level 4.1 is a widely supported level. * @return AVC level 4.1 or `null` if no compatible level is found*/privatefungetSupportedAVCLevel(): Int?=MediaCodecList(MediaCodecList.ALL_CODECS).codecInfos
.filter { it.isAVCVideoEncoder() }
.flatMap { it.getAVCProfileLevels() }
.firstOrNull { level ->
level >=SUPPORTED_AVC_LEVEL
}
privatefun MediaCodecInfo.isAVCVideoEncoder() =
isEncoder &&
supportedTypes.any { it.startsWith("video/") } &&
supportedTypes.contains(MediaFormat.MIMETYPE_VIDEO_AVC)
/** * Retrieves the list of supported AVC profile levels for a given codec.*/privatefun MediaCodecInfo.getAVCProfileLevels(): List<Int> {
return getCapabilitiesForType(MediaFormat.MIMETYPE_VIDEO_AVC)
.profileLevels
.filter { it.profile ==CodecProfileLevel.AVCProfileBaseline }
.map { it.level }
}
companionobject {
privateconstvalMAX_DIMENSION_ALLOWED=1280privateconstvalBIT_RATE=3*1024*1024L// 3 MbpsprivateconstvalFRAME_RATE=30privateconstvalSUPPORTED_AVC_LEVEL=CodecProfileLevel.AVCLevel41
}
What I've tried
I've tried forcing the mime type to be "videos/avc" but no luck
for (format in inputFormats) {
val mime = format.getString(MediaFormat.KEY_MIME)
logDev("mime: $mime")
if (mime =="video/dolby-vision") {
logDev("Dolby Vision detected. Changing input format to H.264")
// Force input format to H.264 (This prevents the Dolby Vision decoder from being used)
format.setString(MediaFormat.KEY_MIME, "video/avc")
}
}
The text was updated successfully, but these errors were encountered:
Stacktrace
File
https://drive.google.com/file/d/1_LPev08GL2u41zPvKHYsviIJzjPlbVRG/view?usp=drive_link
Code
What I've tried
The text was updated successfully, but these errors were encountered: