How to use FLV in ios

2.2k Views Asked by At

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.

1

There are 1 best solutions below

3
On

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.