Replies: 2 comments
-
Ok, I think I figured out the problem might be related to the first I-Frame of the stream being lost. Does this make sense? Is there any way I could wait for some seconds when trying to read the stream before getting that 404 error to solve this problem? Does somebody else have a solution? Thanks a lot |
Beta Was this translation helpful? Give feedback.
-
Hello, if you believe that the error is caused by the fact that the first I-frame is getting lost between the moment in which the stream is published and the moment in which the HLS stream is first requested, you can use hlsAlwaysRemux: true Keep also in mind that HLS requires at least two I-frames, therefore, if the I-frames interval is 10 seconds, you'll have to wait at least 10 seconds. |
Beta Was this translation helpful? Give feedback.
-
Question
Hi everyone,
I'm working in a project in which I receive h264 video from IP cameras and stream it to browsers using LL-HLS via mediamtx 1.9.2.
The project is working, but I'm finding problems with some cameras where the video takes a lot of time to be displayed (over 15 seconds) and I don't really know what to do or where to look at. The current workflow is the following one:
The problem is that since the stream is published to mediamtx, until the first frame is displayed in the browser, sometimes the waiting time is even greater than 10 seconds, which makes no sense.
Maybe some I-Frames that are present at the start of the stream are not received in the browser? Because using ffprobe with
-show_frames -show_entries frame=pkt_pts_time,pict_type
I can see how the first frame of the file is an I-FrameIs there any way I could improve this without re-encoding the stream? Does anyone have something that could guide me to find a solution?
I've also tried saving the video received from the camera as an mp4 file and stream it on demand using the following yaml configuration
However, the result is pretty much the same, it takes a lot of time to load.
In this case, I can see some FFMPEG warnings when reading the video file like
When opening the stream using webrtc, it seems to work a lot better, but webrtc is not always available in these scenarios, so I need to be able to use HLS.
Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions