宴のバージョン:宴3.12.8
UnityのバージョンとOS:Unity 2022.3.53f1 Windows10 Android13
現在、Android版のビルドを試みています。ファイルの読み込み方法はlocalです。最終的な出力は順調で、簡単なテストを行った限りでは他にバグは見つかりませんでした。
唯一確認できた問題は、透明度を含むすべての動画が機能せず、ゲーム内で真っ黒に表示されることです。公式ドキュメントの説明に従ってエンコードを行い、設定方法は画像の通りです。修正できる方法があるか知りたいです。
Codecについては、Auto、VP8、H264を試しましたが、いずれも効果がありませんでした。H265を試した際には、Unityがエラーを出しました。
すべての動画はWindowsでは正常に動作しています。
.png?part=0.2&view=1)
.png?part=0.1&view=1)
ご返信ありがとうございます!
Unityでこのファイルを適用しようとしましたが、次のエラーが発生しました:
cannot change access modifiers when overriding 'internal' inherited member 'AdvGraphicBase.CheckFailedCrossFade(AdvGraphicInfo)'
再度の修正、ありがとうございます!再びビルドを試みましたが、黒画面はもう表示されなくなりましたが、動画は依然として正常に再生されませんでした。
おっしゃった通り、Android Logcat を使用して状況を監視したところ、動画が再生されるべきタイミングでエラーが発生していることがわかりました。
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec string mime = "video/x-vnd.on2.vp8"
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int64_t durationUs = 733333
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int32_t track-id = 1
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int32_t width = 3840
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int32_t height = 1080
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int32_t display-width = 3840
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int32_t display-height = 1080
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int32_t tp-ux-tid = 9297
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int32_t flags = 0
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int32_t vendor.mtk.vdec.buffer.fetch.timeout.ms.value = 500
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int64_t vendor.oplus.vpp.white.list.value = 0
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec int32_t android._color-format = 19
01/06 03:37:20.231 5435 9297 Error NdkMediaCodec }
原因がどこにあるのか確信が持てないため、この問題に関連すると思われるエラーログを多めにコピーしました。
01/06 03:42:12.335 5435 10034 Debug CCodecConfig c2 config diff is c2::u32 vendor.mtk.vdec.buffer.fetch.timeout.ms.value = 500
01/06 03:42:12.336 5435 10034 Warn ColorUtils expected specified color aspects (2:0:0:0)
01/06 03:42:12.336 5435 10034 Warn CCodec failed to configure c2 params
01/06 03:42:12.336 5435 10033 Error MediaCodec Codec reported err 0xffffffea/BAD_VALUE, actionCode 0, while in state 3/CONFIGURING
01/06 03:42:12.336 5435 10033 Debug MediaCodec flushMediametrics
01/06 03:42:12.337 5435 10033 Debug MediaCodec [0xb40000758a169000] setState: 0
01/06 03:42:12.337 5435 9297 Error MediaCodec configure failed with err 0xffffffea, resetting...
01/06 03:42:12.337 5435 9297 Debug MediaCodec [0xb40000758a169000] [c2.mtk.vpx.decoder] release
01/06 03:42:12.337 5435 10033 Debug MediaCodec [0xb40000758a169000] setState: 10
01/06 03:42:12.337 5435 10033 Debug OplusCCodec initiateShutdown [887]: (0xb4000075280a0a00) keepComponentAllocated=0
01/06 03:42:12.337 5435 10033 Info OplusFeedbackInfo [sendFeedbackInfo:L432] send:MM_FB_EventID#21001#ClientPid#5435#ReportLevel#0#timeUsage#0#videoComponent#c2.mtk.vpx.decoder#videoHeight#1080#videoMime#video/x-vnd.on2.vp8#videoWidth#3840
01/06 03:42:12.337 5435 10033 Debug AtlasEventUploadUtils setEvent event:atlas_event_atlasserver_feedback
01/06 03:42:12.339 5435 10033 Debug MediaCodec [0xb40000758a169000] [c2.mtk.vpx.decoder] kWhatReleaseCompleted
01/06 03:42:12.339 5435 10033 Debug MediaCodec [0xb40000758a169000] setState: 0
01/06 03:42:12.339 5435 10034 Info hw-BpHwBinder onLastStrongRef automatically unlinking death recipients
01/06 03:42:12.340 5435 9297 Debug OplusCCodec ~OplusCCodec [188]: (0xb4000075280a0a00)
01/06 03:42:12.343 5435 9297 Debug CCodecBufferChannel mBufferCountDebug=0 mIsUserLoad=1
01/06 03:42:12.343 5435 9297 Debug OplusCCodec OplusCCodec [169]: (0xb4000075280a0a00)
01/06 03:42:12.344 5435 9297 Warn libc Access denied finding property "vendor.oplus.media.vpp.stutter"
01/06 03:42:12.345 5435 9297 Debug OplusFeedbackInfo OVFR is supported in video side
01/06 03:42:12.346 5435 9297 Debug ListServiceUtils checkInListByUid module:video-setsurface-error uid:10242 cost 584us return 0
01/06 03:42:12.346 5435 9297 Debug CCodecBufferChannel mBufferCountDebug=0 mIsUserLoad=1
01/06 03:42:12.347 5435 9297 Debug OplusFeedbackInfo ~OplusAnalysisFPS
01/06 03:42:12.347 5435 9297 Debug AtlasEventUploadUtils setEvent event:atlas_event_video_monitor_network_switch
01/06 03:42:12.347 5435 9297 Debug OplusFeedbackInfo [notifyFpsToSF:L855] fixFps=0 currentFps=0 isRelease=1
01/06 03:42:12.348 5435 9297 Debug MediaCodec [0xb40000758a169000] init: CCodec 0xb4000075280a0a00, CCodecBufferChannel 0xb400007583d2ce18
01/06 03:42:12.348 5435 10033 Debug MediaCodec [0xb40000758a169000] setState: 1
01/06 03:42:12.348 5435 10034 Debug CCodec allocate(c2.mtk.vpx.decoder)
01/06 03:42:12.350 5435 10034 Info CCodec setting up 'default' as default (vendor) store
01/06 03:42:12.361 5435 10034 Info CCodec Created component [c2.mtk.vpx.decoder]
01/06 03:42:12.361 5435 10034 Debug CCodecBufferChannel [0xb400007583d2ce18] setComponent: mName c2.mtk.vpx.decoder#438, mPipelineWatcher 0xb400007583d2d280
01/06 03:42:12.361 5435 10034 Debug CCodecBufferChannel PipelineWatcher debug info [c2.mtk.vpx.decoder#438] enable=0
01/06 03:42:12.361 5435 10034 Debug CCodecConfig read media type: video/x-vnd.on2.vp8
01/06 03:42:12.364 5435 10034 Debug ReflectedParamUpdater extent() != 1 for single value type: algo.buffers.max-count.values
01/06 03:42:12.365 5435 10034 Debug ReflectedParamUpdater extent() != 1 for single value type: output.subscribed-indices.values
01/06 03:42:12.365 5435 10034 Debug ReflectedParamUpdater extent() != 1 for single value type: input.buffers.allocator-ids.values
01/06 03:42:12.365 5435 10034 Debug ReflectedParamUpdater extent() != 1 for single value type: output.buffers.allocator-ids.values
01/06 03:42:12.365 5435 10034 Debug ReflectedParamUpdater extent() != 1 for single value type: algo.buffers.allocator-ids.values
01/06 03:42:12.365 5435 10034 Debug ReflectedParamUpdater extent() != 1 for single value type: output.buffers.pool-ids.values
01/06 03:42:12.365 5435 10034 Debug ReflectedParamUpdater extent() != 1 for single value type: algo.buffers.pool-ids.values
01/06 03:42:12.367 5435 10034 Debug ReflectedParamUpdater ignored struct field coded.color-format.locations
01/06 03:42:12.371 5435 10034 Debug CCodecConfig ignoring local param raw.size (0xd2001800) as it is already supported
01/06 03:42:12.371 5435 10034 Debug CCodecConfig ignoring local param raw.crop (0xd2001801) as it is already supported
01/06 03:42:12.371 5435 10034 Debug CCodecConfig ignoring local param default.color (0x5200180b) as it is already supported
01/06 03:42:12.371 5435 10034 Debug CCodecConfig ignoring local param raw.hdr-static-info (0xd200180a) as it is already supported
01/06 03:42:12.372 5435 10034 Info CCodecConfig query failed after returning 17 values (BAD_INDEX)
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2 config diff is Dict {
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::i32 algo.priority.value = 1
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::float algo.rate.value = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::float coded.frame-rate.value = 30
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 coded.pl.level = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 coded.pl.profile = 20481
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 coded.vui.color.matrix = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 coded.vui.color.primaries = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 coded.vui.color.range = 2
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 coded.vui.color.transfer = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 default.color.matrix = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 default.color.primaries = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 default.color.range = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 default.color.transfer = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 input.buffers.max-size.value = 2097152
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 input.delay.value = 4
01/06 03:42:12.373 5435 10034 Debug CCodecConfig string input.media-type.value = "video/x-vnd.on2.vp8"
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 output.delay.value = 12
01/06 03:42:12.373 5435 10034 Debug CCodecConfig string output.media-type.value = "video/raw"
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 raw.color.matrix = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 raw.color.primaries = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 raw.color.range = 2
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 raw.color.transfer = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 raw.crop.height = 239
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 raw.crop.left = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 raw.crop.top = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::u32 raw.crop.width = 319
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::float raw.hdr-static-info.mastering.blue.x = 0
01/06 03:42:12.373 5435 10034 Debug CCodecConfig c2::float raw
01/06 03:42:12.374 5435 10034 Warn ColorUtils expected specified color aspects (2:0:0:0)
01/06 03:42:12.374 5435 10033 Debug MediaCodec [0xb40000758a169000] setState: 2
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec configure: err(-22), failed with format: AMessage(what = 0x00000000) = {
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec string mime = "video/x-vnd.on2.vp8"
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int64_t durationUs = 1040000
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int32_t track-id = 1
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int32_t width = 3840
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int32_t height = 1080
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int32_t display-width = 3840
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int32_t display-height = 1080
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int32_t tp-ux-tid = 9297
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int32_t flags = 0
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int32_t vendor.mtk.vdec.buffer.fetch.timeout.ms.value = 500
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int64_t vendor.oplus.vpp.white.list.value = 0
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec int32_t android._color-format = 19
01/06 03:42:12.375 5435 9297 Error NdkMediaCodec }
01/06 03:42:12.376 5435 9297 Warn Unity AndroidVideoMedia: Error -10000 while configuring codec.
01/06 03:42:12.376 5435 9297 Debug MediaCodec [0xb40000758a169000] [c2.mtk.vpx.decoder] stop
01/06 03:42:12.376 5435 10033 Debug MediaCodec [0xb40000758a169000] setState: 9
01/06 03:42:12.376 5435 10033 Debug OplusCCodec initiateShutdown [887]: (0xb4000075280a0a00) keepComponentAllocated=1
01/06 03:42:12.376 5435 10033 Debug MediaCodec [0xb40000758a169000] [c2.mtk.vpx.decoder] kWhatStopCompleted
01/06 03:42:12.376 5435 10033 Debug MediaCodec [0xb40000758a169000] setState: 2
01/06 03:42:12.376 5435 9297 Debug MediaCodec [0xb40000758a169000] [c2.mtk.vpx.decoder] release
01/06 03:42:12.378 5435 10033 Debug MediaCodec [0xb40000758a169000] setState: 10
01/06 03:42:12.378 5435 10033 Debug OplusCCodec initiateShutdown [887]: (0xb4000075280a0a00) keepComponentAllocated=0
01/06 03:42:12.379 5435 10033 Debug MediaCodec [0xb40000758a169000] [c2.mtk.vpx.decoder] kWhatReleaseCompleted
01/06 03:42:12.379 5435 10033 Debug MediaCodec [0xb40000758a169000] setState: 0
01/06 03:42:12.380 5435 10050 Info hw-BpHwBinder onLastStrongRef automatically unlinking death recipients
01/06 03:42:12.381 5435 9297 Debug MediaCodec [0xb40000758a169000] ~MediaCodec
01/06 03:42:12.382 5435 9297 Debug MediaCodec flushMediametrics
01/06 03:42:12.383 5435 9297 Info BpBinder onLastStrongRef automatically unlinking death recipients: android.media.IResourceManagerService
01/06 03:42:12.383 5435 9297 Debug OplusCCodec ~OplusCCodec [188]: (0xb4000075280a0a00)
01/06 03:42:12.383 5435 9297 Debug OplusFeedbackInfo ~OplusAnalysisFPS
01/06 03:42:12.393 5435 5435 Verbose AutofillManager requestHideFillUi(null): anchor = null
01/06 03:42:12.611 5435 5435 Verbose AutofillManager requestHideFillUi(null): anchor = null
01/06 03:42:12.771 5435 5435 Verbose AutofillManager requestHideFillUi(null): anchor = null
01/06 03:42:12.971 5435 5435 Verbose AutofillManager requestHideFillUi(null): anchor = null
01/06 03:42:13.171 5435 5435 Verbose AutofillManager requestHideFillUi(null): anchor = null
01/06 03:42:13.438 5435 5435 Verbose AutofillManager requestHideFillUi(null): anchor = null
01/06 03:42:20.714 5435 5435 Debug CompatibilityChangeReporter Compat change id reported: 150939131; UID 10242; state: ENABLED
テストを行った結果、唯一正常に処理されたのはサイズが小さめの透明動画でした。エラーログの内容を考慮すると、サイズが問題の原因である可能性があると推測しています。
しかし、サイズを縮小しつつ、画面が正常に表示されるようにするにはどうすればよいでしょうか?
例えば、私は「film」という名前の透明動画ファイルを使用して、古い映画のノイズをシミュレートしています。
補足として、正常に表示される動画の属性サイズは300x150で、他の動画ファイルは1920x1080です。
最終的に、Unityでコードを作成し、プレイヤーが現在使用しているプラットフォームを検知して、それをパラメータとしてUtageに渡しました。
その後、Utageのマクロ機能を利用し、Androidプラットフォームでは設定シートで拡大された特定のスプライトを再生するようにしました。
現在、すべての動作は正常です。これからはWebGLの構築を引き続き試みます。