Many developers mentioned that in the current open source player so widespread, why still need to do self-developed framework RTMP player, self-developed and open source player, exactly what is good? Here are some of our experiences. If you are interested, you can follow Github:
1. Low latency: If the delay is too large, it will seriously affect the experience. Therefore, low delay is a very important indicator to measure a good RTMP player. At present, the RTMP live playback delay of Daniulive SDK is better than that of open source player (daniulive SDK delay is about 1 second, open source player such as VLC, The delay is 5-7 seconds), and the playback end of DANIu Live SDK will not cause delay accumulation when it runs for a long time. Open source or third-party player is prone to delay accumulation when it runs for a long time.
Some servers will cache GOP to ensure that the first screen playback can be realized quickly without affecting the delay. In this regard, we designed a quick start interface to render the first frame quickly and catch up with the latest playback data:
2. Audio and video synchronization processing: In order to pursue low latency, most players do not even do audio and video synchronization, and directly play audio video, resulting in a/ V synchronization, and random timestamp jumping and other problems. Players provided by DANIu Live SDK have good timestamp synchronization and abnormal timestamp correction mechanisms;
Note: In ultra-low delay mode, 0 buffer can be used without audio and video synchronization:
3. Support for multiple instances: The RTMP live playback SDK provided by Daniu live streaming SDK supports multiple instances of RTMP stream data when the device performance allows. Most open source players are not friendly to multi-instance support;
With more conventional solid exceptions, such as domestic monitoring scenarios, although we CPU was already in the industry is very low, but a lot of manufacturers, not every road to full frame, according to the situation, we made a real-time playback only key frames and the whole frame of interface design, such as eight instance, one of the less important data a few road, You can set only key frames to play, and click full frame rate to play when you need to pay attention, which not only saves system overhead, but also realizes the purpose of multi-channel playback:
4. Support buffer time Settings: In some scenarios with network jitter, players need to support buffer time Settings. Generally speaking, in milliseconds, open source players are not friendly enough to support buffer time Settings.
5. Real-time mute: For example, if RTMP stream is played in multiple Windows, if every audio is played, the experience is very bad, so the real-time mute function is very necessary, and the open source player does not have real-time mute function;
6. Video View rotation: Many cameras have inverted images due to installation limitations, so a good RTMP player should support real-time video view rotation (0° 90° 180° 270°), horizontal reversal, vertical reversal, open source or third party players do not have this function;
7. Support audio/video data output after decoding: Daniu Live SDK has contacted many developers, hoping to obtain YUV or RGB data for face matching algorithm analysis while playing, which is not available in open source player;
8. Real-time snapshot: it is very necessary to capture interesting or important pictures in real time. Generally, players do not have the snapshot ability, and open source players do not have this function.
9. Network jitter handling (such as network disconnection and reconnection) : stable network handling mechanism and support, such as network disconnection and reconnection, etc. Open source player has poor support for network exception handling;
10. Long-term operation stability: the RTMP live broadcast playing SDK provided by Daniu Live Broadcast SDK is suitable for long-term operation, while the open source player has poor support for long-term operation stability;
11. Real-time download speed feedback: Daniu Live SDK provides real-time download callback of audio and video streams, and can set the callback interval to ensure real-time download speed feedback, so as to monitor network status. Open source player does not have this ability;
12. Abnormal state handling and Event state callback: if the playing process is interrupted, the player provided by DANIu Live SDK can call back the relevant state in real time to ensure that the upper module is aware of the processing, which is not well supported by the open source player;
13. Set the video fill mode (equal proportion display) : In many cases, some scenes need to be played with full view, and some scenes can be set to equal proportion display in order to prevent video stretching;
14. D3D detection: Generally speaking, most Windows on the market support D3D, some niche, only support GDI mode drawing, so in order to better compatibility, this interface is very necessary;
15. Real-time volume adjustment: Real-time volume adjustment, especially in multi-channel playing scenarios, such as large-screen window environment, can achieve better playing experience through fine-grained volume adjustment;
16. Playing only key frames: especially when playing large-screen multi-instance scenes, although our CPU usage is very low, it is a very good function point to play only key frames if we just view the general monitoring scene and achieve more playback. If original frames need to be played, real-time adjustment can be made.
17. Hard decoding for specific models: Hard decoding for specific models is also mainly used for multi-channel playback scenarios to achieve lower CPU usage through hard decoding.