ossrs / WordPress-Plugin-SrsPlayer

SRS Player is a video streaming player, supports HLS/HTTP-FLV/WebRTC etc.

Home Page:https://wordpress.org/plugins/srs-player/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1.0.16 version cannot play HEVC streams in WordPress 6.2

endokousuke opened this issue · comments

I tried reinstalling version 1.0.16 of SRS Player but found it ineffective. In WordPress, it can only play H.264 FLV streams and is unable to play HEVC-encoded FLV streams.
I am using my own setup of SRS server with version 6.0 or higher. In the SRS HTTP server (on port 8080), HEVC-encoded FLV streams can be played without any issues. After implementing HTTPS through reverse proxy, it can also be played smoothly.
I tried installing mpegts.js on my own and added the following code to the functions.php file:


function enqueue_mpegts_script() {
    wp_enqueue_script( 'mpegts-script', get_template_directory_uri() . '/root/mpegts.js', array(), '1.0', true );
}
add_action( 'wp_enqueue_scripts', 'enqueue_mpegts_script' );

Afterward, I tried installing mpegts.js on my own and adding it to the functions.php file:


<script src="mpegts.js"></script>
<video id="videoElement"></video>
<script>
    if (mpegts.getFeatureList().mseLivePlayback) {
        var videoElement = document.getElementById('videoElement');
        var player = mpegts.createPlayer({
            type: 'mse',  // could also be mpegts, m2ts, flv
            isLive: true,
            url: 'http://example.com/live/livestream.ts'
        });
        player.attachMediaElement(videoElement);
        player.load();
        player.play();
    }
</script>

I can play HEVC live streams properly using both FLV and TS formats.

I suspect that the issue might be related to the invocation of mpegts.js. I have looked into the files of SRS Player but couldn't find any problematic configuration. I also tried replacing mpegts-1.7.2.min.js and mpegts-1.7.2.min.js.map with the latest version, but the problem still persists.

TRANS_BY_GPT3

commented

In version 1.0.17, we will address this issue, as HEVC is only supported by mpegts.js 1.7.3. If you use OBS to publish an HEVC stream, it utilizes an enhanced FLV protocol, which is a standard FLV protocol for HEVC. You can find more information at https://github.com/xqq/mpegts.js/releases/tag/v1.7.3

However, version 1.0.16 only supports mpegts.js 1.7.2, which exclusively provides HEVC support over FLV through a patched FFmpeg. This is a private protocol for HEVC over FLV.