Comments (6)
I also have the same problem, but I tested with OBS Studio and found the following:
If I stream using the advanced settings and change the Output mode to "Advanced," then:
FFmpeg VAAPI H.264 --> Linux Chrome: OK, Android Chrome: OK
NVIDIA NVENC H.264 --> Linux Chrome: FPS drops (max 1-2 frames per second) - very laggy, Android Chrome: OK
I was able to reproduce the issue with a simple ffmpeg command:
Dropped frame rate: ffmpeg -re -stream_loop -1 -i clip2.mp4 -vcodec h264_nvenc -c:a copy -f flv rtmp://<host>
Correct frame rate: ffmpeg -re -stream_loop -1 -i clip2.mp4 -c copy -f flv rtmp://<host>
It seems that more expensive drones (or controllers) use another algorithm, which is not FFmpeg VAAPI H.264.
Are there any settings I can try to change? Unfortunately, I cannot change anything on the drone's side (no any option in the official DJI app), only on the SRS.
Tested on Ubuntu 22 with the default config, docker
from srs.
Please use h.264 profile baseline if need converting RTMP to WebRTC. Dup to #4052
from srs.
@winlinvip Do you mean in ffmpeg.transcode.conf
, because it will be the same as HTTP-FLV, there will be the same delay?
from srs.
Maybe it is the web browser don't support h.264 b-frame, because baseline profile don't support b-frame, that's the reason baseline works well.
@zeldan you can verify by disable the b-frame by -bf 0
. I don't have a NVidia gpu, so I can't verify, the h264_nvenc
, which is NVidia hardware encoder, must be encode the video frame to h.264 main/high profile with b-frames.
ffmpeg -re -stream_loop -1 -i clip2.mp4 -vcodec h264_nvenc -bf 0 -c:a copy -f flv rtmp://<host>
or just use baseline profile.
ffmpeg -re -stream_loop -1 -i clip2.mp4 -vcodec h264_nvenc -profile:v baseline -c:a copy -f flv rtmp://<host>
the params, -profile:v
, is libx264
's params, I don't know whether the h264_nvenc
support it or not.
from srs.
Sorry, I reproduced the Stuttering
or laggy
effect, the b-frame is laggy
+ part rect screen blur effect.
How to calculate or check webrtc fps? did anyone knows?
Here is my way to reproduce the Stuttering
effect?
./objs/srs -c conf/rtmp2rtc.conf
(don't forget to set CANDIDATE env);- publish a video with profile high:
ffmpeg -re -stream_loop -1 -i test.mp4 -vcodec h264 -profile:v high -acodec copy -f flv rtmp://localhost/live/livestream
- use ffmpeg to do transcode, publish the transcoded stream to
live/livestream_ff
ffmpeg -i rtmp://localhost/live/livestream -vcodec h264 -profile:v baseline -acodec copy -f flv rtmp://localhost/live/livestream_ff
(@dancixx don't useffmpeg.transcode.conf
, this cmd will have same effect, theffmpeg.transcode.conf
will result in avalanche effect, the transcoded stream will trigger another transcode process) - Now, we have two streams:
live/livestream
andlive/livestream_ff
,live/livestream
is profile high and have b-frames, whilelive/livestream_ff
is profile baseline without b-frame. You can verify byffprobe
:
ffprobe rtmp://localhost/live/livestream
ffprobe rtmp://localhost/live/livestream_ff
ffprobe -show_frames rtmp://localhost/live/livestream
ffprobe -show_frames rtmp://localhost/live/livestream_ff
(check thepict_type
: I, B, P) - ffplay
live/livestream
andlive/livestream_ff
, the videos play well. - check the webrtc
http://localhost:1985/rtc/v1/whep/?app=live&stream=livestream_ff
, this stream's profile is baseline, but video seemslaggy
.
If I do transcode in step 2, don't do next steps.
ffmpeg -re -stream_loop -1 -i test.mp4 -vcodec h264 -profile:v baseline -acodec copy -f flv rtmp://localhost/live/livestream
then play webrtc http://localhost:1985/rtc/v1/whep/?app=live&stream=livestream
, the video seems fine.
from srs.
from srs.
Related Issues (20)
- ajhua camera can not connect to srs HOT 1
- When using the Reuse Port function, the hls slice stream is not online and expires
- Is there a bug in the WebRTC desktop stream broadcasting?
- Webrtc over tcp use same port with Http Server and Http Api will cause http site unavailable
- WebRTC not playing in Wordpress
- No on_play callback in Oryx HOT 1
- WebRTC: Compatibility problem with AMD GPU Encoder (AMD HW H.264) HOT 2
- WebRTC: Server crashes on AV1 Encoder HOT 2
- WebRTC streaming was successful, but WebRTC play failed HOT 2
- on_hls_notify duplicate [stream] param
- dvr_plan=segment does not take effect if RTSP is H265
- ingree config ffmpeg rtsp_transport tcp cause the exec ffmpeg cli log part has error, and cause whole cli failed HOT 2
- using vlc play srt stream, play fail and coredump HOT 1
- WebRTC: h264 FU-A parse for both S and E flag HOT 1
- requesting the HTTP-FLV using the HEAD method will cause a nullptr crash HOT 8
- heap-use-after-free crash occurs after the streaming endpoint disconnects. HOT 3
- Need current number of client in on_play/on_stop webhook body. HOT 3
- Regarding the issue of static compilation not taking effect HOT 3
- The first few seconds of audio will be lost, only video without audio play HOT 7
- SRS5 WHEP have memory leaks HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from srs.