[Technical Tutorial] How to optimize the H.265 encoding EasyWasmPlayer player in the RTSP protocol video platform EasyNVR?

In the previous blog post, we said that in order to adapt to the development of H265 encoding at this stage, TSINGSEE Green Rhinoceros Video has added the function of choosing a player independently in EasyNVR for the first time. You can choose to use the EasyPlayer player to play H264 encoded videos, or you can choose to use EasyWasmPlayer. The player plays H265 encoded video.

123.png

When the EasyWasmPlayer player is used in EasyNVR, it takes a certain time to wait for the video stream data and decoding before playing the video. This causes the player to be in a black screen state for a period of time after the video starts. After our discussion, this is a short time The black screen status can be used to display video snapshots. Let’s share our implementation process.

20.png

First of all, we need to generate tags in the player box to display the photos of the snapshot, and then create a function to pass the url data of the snapshot. When we call this function, we will display the tag and create a function to hide the snapshot box. When the video stream is obtained, the snapshot is ended. The reference code is as follows:

    // 设置快照
    setSnap(url){
        this.startLoding() 
        this.Snap.src=url;
        this.Snap.style='position:absolute;top:0px;left:0px;width:100%;height:100%;z-index:1;display:block';
    }
    // 隐藏快照
    endSanp(){
        this.endLoding();
        this.Snap.style='display:none';
    }

After this setting, the EasyWasmPlayer player will not produce a short black screen after the start of the broadcast, and the user experience is more friendly. About the introduction of EasyWasmPlayer player and EasyPlayer player, we have introduced it to you in the article " Introduction to the difference between EasyPlayer and EasyWasmPlayer, the newly added H265 player in EasyNVR ", you can take a look.

If you want to learn more about the video program, you can directly follow my blog. At the same time, we welcome your exchanges and discussions.

Guess you like

Origin blog.csdn.net/Black_3717/article/details/111578028