Closed ISnowFoxI closed 5 months ago
Good feature request.
A dirty workaround, just for debugging time, can be:
In CameraView add:
private val codecs = MediaCodecList(MediaCodecList.ALL_CODECS).codecInfos.filter {
it.isEncoder && it.supportedTypes[0].startsWith("video")
}
private val availableVideoCodecs: List<String> = codecs.map { it.name }
Then in init add a log:
Log.i(TAG, "Available Video Codecs: $availableVideoCodecs")
Open LogCat and, filter for TAG name, here CameraView and ... check Available Video Codecs
Available Video Codecs: [c2.android.avc.encoder, OMX.google.h264.encoder, c2.android.h263.encoder, OMX.google.h263.encoder, c2.android.hevc.encoder, c2.android.mpeg4.encoder, OMX.google.mpeg4.encoder, c2.android.vp8.encoder, OMX.google.vp8.encoder, c2.android.vp9.encoder, OMX.google.vp9.encoder]
;)
Nice find @drLeonymous - I definitely want to expose that API to JS!
I would suggest falling back to H264 when H265 is unavailable, that would be much safer
Instead of exposing it, you can just pass h265
and it will automatically fall back to h264
if h265
is not supported. Added in VisionCamera 4.0.0
What feature or enhancement are you suggesting?
Having a function/hook to get the available codes for a particular device would be great. We had issues with old devices where they wouldn't support the
h265
codec and the app would crash upon recording start (example: iPad mini 4 and iPad Air 2).What Platforms whould this feature/enhancement affect?
iOS, Android
Alternatives/Workarounds
Currently, I was not able to find any workarounds.
Additional information