HarmonyOS 鸿蒙Next avplay 播放封装类型为FMP4格式的m3u8的在线点播资源提示格式不支持

发布于 1周前 作者 h691938207 来自 鸿蒙OS

HarmonyOS 鸿蒙Next avplay 播放封装类型为FMP4格式的m3u8的在线点播资源提示格式不支持 avplay播放封装类型为FMP4格式的m3u8的在线资源提示格式不支持,视频封装格式(FMP4)不能改变的情况下,如何解决该问题。

异常日志如下:

01-21 11:24:02.753   18642-18642   A0ff00/[myAPP]    ohos.samp...launcher I   AVPlayManager, avPlayer state initialized called.
01-21 11:24:02.753   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #1785 JsSetSurfaceID set surface first in initialized state
01-21 11:24:02.753   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #1726 get surface, surfaceStr = 1756641624887
01-21 11:24:02.753   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #1734 get surface, surfaceId = (1756641624887)
01-21 11:24:02.753   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #1803 0xA88EF0 JsSetSurfaceID Out
01-21 11:24:02.753   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #1820 JsGetSurfaceID Out Current SurfaceID: 1756641624887
01-21 11:24:02.753   18642-18642   A0ff00/[myAPP]  ohos.samp...launcher I   AVPlayManager, avPlayer.surfaceId = 1756641624887
01-21 11:24:02.753   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #264 JsPrepare In
01-21 11:24:02.753   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #281 0xA88EF0 JsPrepare EnqueueTask In
01-21 11:24:02.753   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #283 0xA88EF0 JsPrepare EnqueueTask out
01-21 11:24:02.755   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #299 0xA88EF0 JsPrepare Out
01-21 11:24:02.755   18642-18753   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #1743 0xA88EF0 SetSurface Task
01-21 11:24:02.755   18642-18663   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #290 Wait Prepare Task Start
01-21 11:24:02.755   18642-18753   C02b2b/PlayerServiceProxy   ohos.samp...launcher I   #707 0x951580 surfaceFormat is 12!
01-21 11:24:02.756   18642-18753   C02b2b/PlayerServiceProxy   ohos.samp...launcher I   #100 0x951580 Proxy: SendRequest task: Player::SetVideoSurface is received
01-21 11:24:02.758   18642-18753   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #227 0xA88EF0 Prepare Task In
01-21 11:24:02.758   18642-18753   C02b2b/PlayerServiceProxy   ohos.samp...launcher I   #100 0x951580 Proxy: SendRequest task: Player::PrepareAsync is received
01-21 11:24:04.759   18642-18663   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #294 Wait Prepare Task End
01-21 11:24:05.226   18642-18751   C02b2b/AVPlayerCallback     ohos.samp...launcher I   #750 0xAA9B68 Instance OnStateChanged is called, current state: 0
01-21 11:24:05.226   18642-18751   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #2770 0xA88EF0 notify error
01-21 11:24:05.227   18642-18751   C02b2b/PlayerListenerStub   ohos.samp...launcher I   #97 DisableMonitor, type = 5, extra = 0.
01-21 11:24:05.227   18642-18751   C02b2b/AVPlayerCallback     ohos.samp...launcher I   #750 0xAA9B68 Instance OnStateChanged is called, current state: 0
01-21 11:24:05.227   18642-18751   C02b2b/AVPlayerCallback     ohos.samp...launcher E   #672 OnErrorCb:errorCode 5400106, errorMsg Unsupport Format: unsupport interface
01-21 11:24:05.227   18642-18642   A0ff00/[myAPP]  ohos.samp...launcher I   AVPlayManager, avPlayer state unknown called.
01-21 11:24:05.228   18642-18642   A0ff00/[myAPP]  ohos.samp...launcher E   AVPlayManager, avPlayer failed, code is 5400106, message is Unsupport Format: unsupport interface
01-21 11:24:05.228   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #561 JsReset In
01-21 11:24:05.228   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #574 0xA88EF0 JsReset EnqueueTask In
01-21 11:24:05.228   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #576 0xA88EF0 JsReset EnqueueTask Out
01-21 11:24:05.228   18642-18642   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #599 0xA88EF0 JsReset Out
01-21 11:24:05.228   18642-18663   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #591 Wait Reset Task Start
01-21 11:24:05.228   18642-18753   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #529 0xA88EF0 Reset Task In
01-21 11:24:05.228   18642-18753   C02b2b/PlayerServiceProxy   ohos.samp...launcher I   #100 0x951580 Proxy: SendRequest task: Player::Reset is received
01-21 11:24:05.231   18642-18643   C02b2b/AVPlayerCallback     ohos.samp...launcher I   #750 0xAA9B68 Instance OnStateChanged is called, current state: 1
01-21 11:24:05.232   18642-18643   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #2770 0xA88EF0 notify idle
01-21 11:24:05.232   18642-18753   C02b2b/AVPlayerNapi     ohos.samp...launcher I   #549 0xA88EF0 Reset Task Out

主要异常提示信息如下:

01-21 11:24:05.227   18642-18751   C02b2b/AVPlayerCallback     ohos.samp...launcher E   #672 OnErrorCb:errorCode 5400106, errorMsg Unsupport Format: unsupport interface
01-21 11:24:05.227   18642-18642   A0ff00/[myAPP]  ohos.samp...launcher I   AVPlayManager, avPlayer state unknown called.
01-21 11:24:05.228   18642-18642   A0ff00/[myAPP]  ohos.samp...launcher E   AVPlayManager, avPlayer failed, code is 5400106, message is Unsupport Format: unsupport interface

更多关于HarmonyOS 鸿蒙Next avplay 播放封装类型为FMP4格式的m3u8的在线点播资源提示格式不支持的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html

4 回复

您好,m3u8的在线点播资源有地址吗?我们这边用demo试一下

更多关于HarmonyOS 鸿蒙Next avplay 播放封装类型为FMP4格式的m3u8的在线点播资源提示格式不支持的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


可以播放的m3u8地址:https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8

不能播的FMP4封装格式的地址: https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/v16/prog_index.m3u8

播放结果可以告诉我一下,看看我们的问题是不是同一个,

目前avplayer对于fmp4格式是不支持视频播放的;建议先转化成可播放的mp4格式等;另外也可以尝试给鸿蒙提需求。

针对HarmonyOS(鸿蒙)系统中avplay播放封装类型为FMP4格式的m3u8在线点播资源时提示“格式不支持”的问题,以下提供可能的解决方案:

鸿蒙系统的avplay组件在支持的视频格式和编码上可能有一定的限制。对于FMP4格式的m3u8文件,如果系统内置的解码器不支持该格式,就会出现无法播放的情况。

首先,确认FMP4格式的m3u8文件是否确实为标准的HLS(HTTP Live Streaming)流。有时,文件的封装格式或编码参数可能不完全符合标准,导致播放器无法正确解析。

其次,检查鸿蒙系统的avplay组件是否支持通过扩展或插件的方式增加对特定格式的支持。虽然鸿蒙系统可能不直接支持Java或C语言的扩展,但可能会提供其他方式(如使用鸿蒙特定的API或框架)来实现格式支持。

如果以上方法都无法解决问题,那么可能需要考虑使用其他支持该格式的播放器库或组件来替代avplay,或者将视频资源转换为鸿蒙系统支持的格式。

如果问题依旧没法解决请联系官网客服,官网地址是:https://www.itying.com/category-93-b0.html

回到顶部