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.
Related Issues (20)
- Standalone binary HOT 1
- Version 6.0/5.0 configuration parsing options: Configuration file not found at conf/docker.conf. HOT 1
- API: The VmSize of SRS is huge and incorrect, if enabled asan. HOT 2
- WebRTC WHEP URL playback is stuttering in Google Chrome browser.
- C++ HOT 1
- When the DVR generates a segment, it sends a request to /ws/v1/update. HOT 1
- http_hooks always connect to localhost on Docker compose HOT 4
- Console: The HTTPS API and the HTTPS server share the same port. HOT 1
- RTMP2WebRTC: Stuttering when using flutter WebRTC HOT 5
- IO: network i/o and block i/o is shooting high HOT 1
- FFmepg: Transcode will result in endless ffmpeg process HOT 1
- High latency on raspberry pi 5 HOT 1
- WebRTC: Occasionally issue the SSRC is not found. HOT 2
- GB28181: Large latency when playing WebRTC. HOT 3
- it can generate and audio url like .mp3 or other HOT 1
- DVR: The mp4 file from DVR for camera can't play on window, MacOS, iOS HOT 5
- Quality of video over webRTC with SRS compared to OvenMediaEngine (GPU enabled) HOT 4
- WHEP: The 'Access-Control-Allow-Origin' header is missing for CORS HOT 2
- FFmpeg concurrent streaming. 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.