How to use FLV in ios
Asked Answered
A

1

1

I have learned about livestream using files .flv, the answer is that it is not supported, or must be converted to mp4, or webm. Is there any way to directly handle the livestream of the file .flv, if you use html5 or reactjs, even better.

Amorphism answered 18/12, 2021 at 18:30 Comment(0)
G
3

For H5, you could use mpegjs.js to covert HTTP-FLV stream to fMP4, feed data to video tag by MSE. It works very well on PC/Android/iPadOS H5, except iOS H5. For more information about MSE, please see here and here.

For iOS H5, WebRTC(WHEP) is a good choice and it works good. For example, to convert RTMP to WHEP:

OBS --RTMP--> SRS --+---WHEP-----> iOS H5
                    +---HTTP-FLV---> H5 for PC/Android/iPadOS

For iOS H5, WASM is also a possible solution, but it seems not easy. And there is no proper open-source project, for example:

  • WasmVideoPlayer is built by FFmpeg+WASM, which is able to play HTTP-FLV on iOS H5, but the LICENSE is GPLv3 and performance is not good.
  • EasyPlayer also supports HTTP-FLV on iOS H5, but it's not open-source, there is a libDecoder.wasm which is about 2MB, and there is no LICENSE about the project.

WebCodecs and WebTransport can also be used to play live streams, but they are not yet stable and supported on all devices. Please refer to this post and WebCodecs API for more details.

For iOS native, ijkplayer is a choice, wrapped FFmpeg.

Glove answered 21/12, 2021 at 1:8 Comment(3)
For iOS H5, can you describe a specific solution?Amorphism
A minute, let me get help from my friends, hahaha.Glove
Thanks to xqq the maintainer of flv.js, I have updated the answer, please check it.Glove

© 2022 - 2024 — McMap. All rights reserved.