Open NestorWetter opened 1 year ago
I have this problem too when sourcing an RTSP from my ip camera. Opening the camera directly there's no freezes. But opening via mediamtx freezes at least once every 2 minutes. I have tried udp/tcp and changing readBufferCount to 65536. No difference.
PS: It occurs WAY more frequently over WEBRTC. And it freezes all webrtc clients at the same time. Arm64/docker.
I have this problem too. I have tested with some pre-recorded mp4 file, and found that it freezes the same play position. I hope this information can help you fix this bug. With this 1 and half minute mp4 file, it freezes at 54:09 and 1:21:19. Here is my console command for this test.
ffmpeg -stream_loop -1 -re -i rtmp.mp4 -an -c:v copy -f flv rtmp://127.0.0.1/spark
Here is the mp4 link. https://1drv.ms/v/s!Ah_4wJEkmvj6rX7kUF0Ik1LG0Q6y?e=Rt9AsI
I'm also facing this problem with mp4 h264 files streamed to WebRtc clients in a ffmpeg rtsp -> mediamtx -> browser setup. On some video files, despite explicitly removing any fancy h264 stuff (baseline profile) to ensure full browser webrtc compatibility, the stream freezes for a second or two, always at the same timestamps.
When I use mediamtx to "provide" the rtsp stream to another go-based webrtc server (that does no reencoding either), the freezing does not occur, so there's something specific about the way mediamtx handles the video/webrtc that amplifies this issue. Sadly this is very vague since I cannot provide the example videos for legal reasons, but I can try to provide any file/meta information that could be helpful.
A complete explanation on why this bug happens is here: https://github.com/Glimesh/janus-ftl-plugin/issues/101
Which version are you using?
v0.22.0
Which operating system are you using?
Describe the issue
We're trying to stream a screen capture from a windows VM in Azure. We use ffmpeg and gdigrab to capture the desktop content and send it over rtsp to an rtsp-simple-server running on docker in another VM (also on azure). When we then try to view the stream using the built-in WebRTC player, the stream mostly works, but it periodically freezes. It usually freezes for 5-10s at least every 2 minutes. Is there perhaps a way to reduce this? Or do you know how we could analyze this further? Any help you can provide would be greatly appreciated :)
Describe how to replicate the issue
ffmpeg -r 10 -f gdigrab -i desktop -pix_fmt yuv420p -vcodec libx264 -b:v 1024k -maxrate 2058k -bufsize 2058k -profile:v main -preset ultrafast -tune zerolatency -bf 0 -f rtsp rtsps://<SOMEUSER>:<SOMEPASSWORD>@<UBUNTU_VM_IP>:8322/<STREAM_NAME>
https://<UBUNTU_VM_IP>:8889/<STREAM_NAME>/
Did you attach the server logs?
yes shortlogs.txt
Did you attach a network dump?
no, we did analyze the network traffic with wireshark, but found no changes in the traffic as the freezes were occurring. If its still necessary we can still find the tcpdump and provide it here.