bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
10.71k stars 1.4k forks source link

fmp4 recordings don't play in Safari #3313

Closed moenodedev closed 1 month ago

moenodedev commented 2 months ago

Which version are you using?

v1.8.0

Which operating system are you using?

Describe the issue

Description

Describe how to replicate the issue

  1. Enable recordings for a path
  2. List recordings for a path with the /list endpoint
  3. Try to display a recording from the /get endpoint

The video doesn't load or display in Safari

<video controls>
  <source src="https://example.com:9996/get?path=outdoor&amp;start=2024-05-03T11%3A46%3A53.141439Z&amp;duration=337.247275"
    type="video/mp4" />
</video>

Adding the format=mp4 query param also doesn't work

<video controls>
  <source src="https://example.com:9996/get?path=outdoor&amp;start=2024-05-03T11%3A46%3A53.141439Z&amp;duration=337.247275&amp;format=mp4"
    type="video/mp4" />
</video>

Did you attach the server logs?

no

Did you attach a network dump?

no

aler9 commented 1 month ago

you are url-encoding the entire path of the URL instead of url-encoding just the start date. This is the right URL:

<video controls>
  <source src="https://example.com:9996/get?path=outdoor&start=2024-01-14T16%3A33%3A17%2B00%3A00&duration=337.247275"
    type="video/mp4" />
</video>

for more informations and examples, take a look at the README.

moenodedev commented 1 month ago

With Firefox, if I open the URL directly or as the src of a <video/> element the video loads.

But Safari says Failed to load resource: Plug-in handled load

moenodedev commented 1 month ago

/list returns 2024-05-06T11:32:34.935427Z but your example has +00:00 at the end without the microseconds. Both Z and +00:00 work in Firefox if the microseconds are included.

/list?path=outdoor
[{"start":"2024-05-06T11:32:34.935427Z","duration":2375.209548}]
/get?path=outdoor&duration=10.0&start=2024-05-06T11%3A32%3A34.935427Z
/get?path=outdoor&duration=10.0&start=2024-05-06T11%3A32%3A34.935427%2B00%3A00
volk234 commented 1 month ago

Same problem. IPhone can't play recorded video. Tried with Safari and Chrome. Android and windows works fine with same url.