-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(0.1-rc.9 linux/amd64) WebRTC Streaming Video Freezing with Working Audio #190
Comments
This command does not transcode anything Tell me exactly what codec, on what technology and on what device worked with freezes. |
@AlexxIT Sorry, I copy pasted the wrong line, my bad The source codec is H265 transcoded with the line above on many hikvison brand cctv some of which Hikvision DS-2CD3367WDV3-L |
You can enable trace log level for go2rtc and check some useful info there. What about H265? Have you enable this codec in iPhone Safari? |
@AlexxIT I don't know that safari h265 codec is not even enabled by default. But the main issue still persist, now no matter what codec it is (h264/h265) the WebRTC video still freezing and skipping lot of time while it is playing smoothly with MSE streaming Here is my trace log source rtsp with no sound (rtsp://user:[email protected]/Streaming/Channels/101)
When using FFmpeg source (ffmpeg:rtsp://user:[email protected]/Streaming/Channels/101#video=copy#audio=aac#audio=opus#hardware=nvidia)
|
It's very strange that both H265 and H264 freezing. Try to play using different browsers from different devices. |
already tried different browser also try to use substream and all have same problem, the weird par is that all playing smoothly with MSE only WebRTC had this issue, not sure where to find the root cause The camera model is DS-2CD3347WDV3-L or DS-2CD3367WDV3-L and some other variant with same brand of Hikvision |
As far as I know, Hikvision uses a proprietary version of the H265 codec. They call it H265+. |
Sure that what I though at first, so I tried to transcode it to h264 also tried to change the source back to h264 and even tried to use substream to lower the resolution but with no luck so far while the MSE is playing smoothly Is there anyway to add opus sound to webrtc without using FFmpeg? Thanks for the help btw |
If your camera not support PCMU/OPUS - you need FFmpeg for transcoding. But you can pass only audio through ffmpeg:
|
I already tried to do that but it messed up the frigate MSE liveview (no video/audio output), maybe another bug or the feature not quite ready yet because i'm using 0.12.0 Beta 5. I found out
Do you have any reference of the highest camera setting that can be handled by WebRTC smoothly in current state? |
My best camera has 2560x1440x25fps (Dahua). Delay lower than 0.5 seconds. |
Can you show the config you tried with that? I don't think adding a second line |
@NickM-27 Sorry for not describing it clearly
Even after setting those all, my frigate MSE cannot load the video/audio |
Can you show me your go2rtc stream config in order to achieve such WebRTC performance? |
That's not what was being suggested though. I'd remove |
streams:
TestCam1:
- rtsp://user:[email protected]/Streaming/Channels/101
- ffmpeg:TestCam1#video=h264#audio=copy#audio=opus @LckySndays with this settings you always get H265 for clients that support H265. Example, Safari WebRTC and other browsers MSE. Because it is first supported codec in the list. Also you don't need This performance works for a regular RTSP stream from Dahua camera. It has a lot of customization and excellent standards support. Including great streams H264, H265, MJPEG. As well as audio codecs - AAC and PCMU/PCMA. |
Already did that as well sadly with no luck. for the main freezing issue, I already tried to isolate it with using go2rtc v1.0.0 - 2023-01-20 docker with my camera set to h264 with lower resolution of 1280x720 and lower fps and no transcoding still got the video image stuttering. I even go as far as transcode the video to #video=h264#width=480 for it to finally playing smoothly without skipping. so there is clearly something wrong with my setup. the reason to why I added the |
@NickM-27 |
FF never support H265 |
I already gave up on h265 beside my camera source need to h265 And what I'm saying is that this config below work best beside the WebRTC video freezing go2rtc:
streams:
TestCam1: ffmpeg:rtsp://user:[email protected]/Streaming/Channels/101#video=h264#audio=opus
webrtc:
candidates:
- 192.168.1.109:8555
- stun:8555
log:
level: trace
cameras:
TestCam1:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/TestCam1
roles:
- restream
hwaccel_args: preset-nvidia-h264
input_args: preset-rtsp-restream But this one made FF browser MSE failed for me and I don't know why though it is out of topic and different problem go2rtc:
streams:
TestCam1:
- rtsp://user:[email protected]/Streaming/Channels/101
- ffmpeg:TestCam1#video=h264#audio=opus
webrtc:
candidates:
- 192.168.1.109:8555
- stun:8555
log:
level: trace
cameras:
TestCam1:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/TestCam1?video=h264
roles:
- restream
hwaccel_args: preset-nvidia-h264
input_args: preset-rtsp-restream
|
@AlexxIT @NickM-27 But this way there are 2 ffmpeg process for single camera, is it normal behavior or it can be improved? mqtt:
enabled: False
birdseye:
enabled: False
detect:
enabled: False
go2rtc:
streams:
TestCam1: ffmpeg:rtsp://user:[email protected]/Streaming/Channels/101#video=h264#audio=aac#audio=opus#hardware
webrtc:
candidates:
- 192.168.1.109:8555
- stun:8555
log:
level: error
cameras:
TestCam1:
ffmpeg:
inputs:
- path: rtsp://127.0.0.1:8554/TestCam1
roles:
- restream
hwaccel_args: preset-nvidia-h264
input_args: preset-rtsp-restream |
Of course |
It was mentioned by @NickM-27 here blakeblackshear/frigate#5187 for me to try out. Anyway is it normal to have 2 hardware acceleration process for a single camera? |
Ok. Right value is Two transcoding because:
|
H265 > H264 - live view ( This one I'm pretty much get it because my source is h265 so the transcoding here needed ) |
Maybe you need to create issue inside Frigate repo about two ffmpeg. You can check the arguments of both ffmpeg to see which one is for. |
Frigate right now always runs the detect stream even when object detection is disabled, it is still used for motion detection and birdseye. This is working as expected. |
Camera RTSP Source H.265 / HEVC (3200x1800) 20fps
Tried to use WebRTC on iPhone Safari and got no Video with Audio Working (AlexxIT/Blog#5)
Tried to transcode it into h264 with
#video=h264#audio=copy#audio=opus#hardware=nvidia
Video is Freezing and skipping every few second while the Audio working flawlessly even when the Video freezing
More info here:
blakeblackshear/frigate#5187
The text was updated successfully, but these errors were encountered: