datarhei / restreamer

The Restreamer is a complete streaming server solution for self-hosting. It has a visually appealing user interface and no ongoing license costs. Upload your live stream to YouTube, Twitch, Facebook, Vimeo, or other streaming solutions like Wowza. Receive video data from OBS and publish it with the RTMP and SRT server.
https://docs.datarhei.com/restreamer/
Apache License 2.0
3.74k stars 433 forks source link

Issues with low framerate sources #669

Open fabianonline opened 7 months ago

fabianonline commented 7 months ago

Subject of the issue My source is a MJPEG stream running with 5fps. Ingesting it and outputting it via the player basically works, but somewhere is a problem with the framerate: Basically the player buffers about 10 seconds of video, only to play them back in about 2 seconds. Then it buffers for 8 seconds to get up to 10 seconds of buffer only to play it back in 2 seconds again. I played around with setting different framerates and switching between constant framerate and adaptive framerate and tried the framerate interpolation, but nothing changed.

Your environment The camera is a raspberry Pi cam managed by motionEye, which exports an MJPEG stream at about 5fps. My server running Restreamer v16.13.1 in a docker container is connected via a Wireguard tunnel.

Files The Restreamer process report is attached. report.txt

Steps to reproduce Ingest a MJPEG stream with a framerate of 5fps, I guess.

Awesome ⭐⭐⭐⭐⭐

If the Restreamer has problems processing your video signals, it would be constructive if you send us this origin stream by mail with the GitHub issue number to support@datarhei.com. This way, we can better see why the Restreamer is not working correctly.

This is not easily done... but if it would help you, I could probably find a way to achieve this.

Expected behavior The stream should be played back in the player with the correct 5fps.

Actual behavior The stream is played back in the player at 25fps, often stopping to buffer more frames.

ioppermann commented 7 months ago

This is a bit tricky. For MJPEG you have to tell Restreamer what the framerate is.

In the settings for the channel, you have to open the "Advanced Settings" for the network source and deselect "Read input at native speed" and select "Force input framerate". In the field below set the actual framerate of your MJPEG stream. At the bottom of the "Advanced Setting" select "use_wallclock_as_timestamps".

image image

w3bprinz commented 3 months ago

Same here, using a Wyze Cam V3 with rtsp this cam has only 20FPS @ Day and 15 FPS @ Night (IR) and the Stream is buffering every 10-30 Seconds...