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.67k stars 430 forks source link

Capture lag via restreamer vs. qv4l2 #543

Open JB-Prof opened 1 year ago

JB-Prof commented 1 year ago

Subject of the issue Hello. I am having an issue with lagging when using Restreamer. As a troubleshooting step, I installed qv4l2 and tried to capture using that, and the lagging issue did not appear. I am very new to all this so I am hoping for some help please.

Your environment I have a PowerEdge T320 with 4 x Xeon CPU E5-2403@1.80 GHz and 24 GB RAM. I am running a clean install of Lubuntu 22.04.2 LTS.

The capture card is a Pyle LiveGamer PLINK4 PCI-e card natively recognized by Linux as 'Bus 004 Device 002: ID 32ed:3200 Pyle Pyle LiveGamer PLINK4' and the product website is: https://pyleusa.com/products/plink4?variant=39422162337827 and Amazon link is: https://www.amazon.ca/HDMI-Video-Capture-Card-HDMI/dp/B09L3FPRG9

I am running Restreamer as per the installation documents on the main website. I am also running qv4l2 which is part of v4l-utils.

Files I have attached the process-report. I do not have a publication report as I am only using the built-in player. Restreamer-Process-report.txt

Steps to reproduce

  1. Attach 1920x1080p video output to PLINK4 HDMI input port and reboot computer
  2. To confirm all connections working, start qv4l2 from GUI and use default settings to capture from /dev/video0. Video quality is great and lag is imperceptible ( < 1 second )
  3. Close qv4l2, start up restreamer
  4. Click to add new stream. Stream starts correctly, but the lab is in excess of 45 to 90 seconds.
  5. Double-check setting using restreamer virtual source - no lag issues.
  6. Reopen qv4l2 to retest - no lag issue.

So I am not sure what I am missing -- I appreciate any suggestions.

Thank you.

ioppermann commented 1 year ago

Keep in mind that the player uses HLS for playing the stream in a browser. HLS introduces a delay of some seconds because it is buffering the video. LLHLS (low latency HLS) is not yet available. Encoding the video introduces also a delay.

In the stream settings you can enable output to the RTMP and/or SRT server (https://docs.datarhei.com/restreamer/knowledge-base/manual/edit-livestream/processing-and-control). If you watch the stream from RTMP or SRT you will not have a delay. Be aware that a player for RTMP or SRT might add a delay as well.

JB-Prof commented 1 year ago

Hello @ioppermann

Thank you for the reply. You mentioned:

In the stream settings you can enable output to the RTMP and/or SRT server (https://docs.datarhei.com/restreamer/knowledge-base/manual/edit-livestream/processing-and-control). If you watch the stream from RTMP or SRT you will not have a delay. Be aware that a player for RTMP or SRT might add a delay as well.

I am not familiar with many of these concepts and I am learning as I go along. Can RTMP or SRT be played natively in a mobile browser with no additional add-ons? My goal is to provide the viewers with a QR code for the URL, and when they open it, they see the HDMI stream playing on their phone. Would either / both RTMP and SRT allow this?

Thank you so much.