ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.74k stars 5.28k forks source link

Usage example (RTMP player) does not work on Firefox #3957

Closed SirMangler closed 4 months ago

SirMangler commented 4 months ago

!!! Before submitting a new bug report, please ensure you have searched for any existing bugs and utilized the Ask AI feature at https://ossrs.io or https://ossrs.net (for users in China). Duplicate issues or questions that are overly simple or already addressed in the documentation will be removed without any response.

Describe the bug The first example / getting started steps do not work on Firefox.

Version Latest from docker (5.0.208(Bee))

To Reproduce Steps to reproduce the behavior:

  1. Run the docker run --rm -it -p 1935:1935 -p 1985:1985 -p 8080:8080 \ -p 8000:8000/udp -p 10080:10080/udp ossrs/srs:5 as per the Usage steps
  2. Start an ffmpeg RTMP stream, I used ffmpeg -re -i /dev/video1 -vcodec libx264 -f flv -y "rtmp://localhost/live/livestream" which is nearly identical to the usage, just using a webcam as the input instead.
  3. Per the usage steps, go to the localhost page and to the srs player at http://localhost:8080/players/srs_player.html?schema=http
  4. Plays properly on Chrome but not on Firefox.

Expected behavior It should play the RTMP stream on the Firefox. Tested on Linux (firefox version v120.0.1) and tested on Windows 10 (firefox v123.0, latest from windows store)

Screenshots image

Additional context

Thanks!!

SirMangler commented 4 months ago

As it turns out, I didn't realise that browsers (aside from Chrome desktop) just don't support the high10/high422/high444 profiles. This was being set by default because of my camera's pixel format. A shame but not SRS's fault.

So for anyone having the same problem as me, you need to convert your pixel format to one that profile high is compatible with, which can be done with ffmpeg by adding -pix_fmt yuv420p, or using sws_scale if using ffmpeg as an API.