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
11.41k stars 1.45k forks source link

publishing RTSP stream and using hls lowLatency or fmp4 does not create init.mp4. returns 404 NOT FOUND #1706

Closed johnvoipguy closed 1 year ago

johnvoipguy commented 1 year ago

Which version are you using?

v0.22.0

Which operating system are you using?

5.15.0-69-generic #76-Ubuntu SMP Fri Mar 17 17:19:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Describe the issue

Publishing RTSP stream and using hls lowLatency or fmp4 does not create init.mp4 file. works fine with mpegts as the hls format. When I choose hls lowLatency or fmp4 the client receives an 404 not found for the init.mp4 file. the index.m3u8 and stream.m3u8 return 200 ok.

Describe how to replicate the issue

  1. start mediamtx
  2. publish with with ffmmpeg -loglevel info -stats -fflags +discardcorrupt+nobuffer -rtsp_transport udp+tcp -max_delay 0 -rtsp_flags prefer_tcp -reorder_queue_size 15 -allowed_media_types video -i 'rtsp://127.0.0.1:8554/Frontyard' -rtsp_transport +udp+tcp -max_delay 0 -rtsp_flags prefer_tcp -f rtsp -muxdelay 0 'rtsp://127.0.0.1:8554/xstack'
  3. any ol' browser to http://x.x.x.x:8888/xstack/

Did you attach the server logs?

yes

Did you attach a network dump?

no

mediamtx.log no it's the same box. using the loopback IP.

timerlan commented 1 year ago

Similar problem. 404 for the init.mp4 in fmp4 mode https://github.com/aler9/mediamtx/issues/1696

aler9 commented 1 year ago

@johnvoipguy @timerlan i've updated the server in order to print an error in case init.mp4 can't be generated. Please test this nightly release and let me know whether it prints errors. Thanks

[link removed]

timerlan commented 1 year ago

@aler9 Thanks for the quick response!

Now the behavior has changed. The browser is make a request to file: index.m3u8 Server log: log.txt

image

If open index.m3u8 link in VLC, video freezes after 2-4 seconds.

I check change codec in source to h.265 and h.265+. The problem is the same. My suggestion: maybe problem in codec and player cannot play stream.

index.m3u8 content

#EXTM3U
#EXT-X-VERSION:9
#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-STREAM-INF:BANDWIDTH=7176925,AVERAGE-BANDWIDTH=964244,CODECS="hvc1.1.6.L120.0",RESOLUTION=1920x1080,FRAME-RATE=25.000
stream.m3u8
aler9 commented 1 year ago

@timerlan check if your browser is able to play H265, from what i know only Windows Chrome on a pc with a compatible GPU can. Click here:

https://jsfiddle.net/4msrhudv

johnvoipguy commented 1 year ago

it isn't doing now after using the latest build you sent.... However for completeness, here are the logs for hls/fmp with remux_always=no and yes. mediamtx_fmp4_remux_no.log mediamtx_fmp4_remux_yes.log mediamtx_llhls_remux_no.log mediamtx_llhls_remux_yes.log

aler9 commented 1 year ago

@johnvoipguy can you confirm me that the changes included in the nightly release are able to solve the issue?

johnvoipguy commented 1 year ago

Based on the current testing, the issues have been resolved.

timerlan commented 1 year ago

Problem solved

github-actions[bot] commented 9 months ago

This issue is being locked automatically because it has been closed for more than 6 months. Please open a new issue in case you encounter a similar problem.