Comments (5)
Steps to reproduce
- download this video sample recorded from the problem drone. https://drive.google.com/file/d/1UEMoMxv76D9W5pzOE9RQuBQ1bT4qIp06/view?usp=sharing
- start srs:
./objs/srs -c conf/rtmp2rtc.conf
, don't forget to config env$CANDIDATE
. - rtmp publish step 1 video:
ffmpeg -re -stream_loop -1 -i drone_1.flv -vcodec copy -f flv rtmp://localhost/live/livestream
- check webrtc play in ios flutter_live app. if the main branch of flutter_live can't compile well with your flutter toolchain, use this branch https://github.com/suzp1984/flutter_live/tree/debug/4052-webrtc
- compare the video with the chrome pc version. the chrome pc webrtc play well, the ios webrtc play stuttering.
- check the safari mac: the webrtc play also has same problem, the http-flv can't play only show one picture with error indicator.
What I found have three problems: ios flutter_live webrtc play, mac safari webrtc play and mac safari http-flv & http-ts play.
Note: use
export SRS_VHOST_HTTP_REMUX_HAS_AUDIO=off; ./objs/srs -c conf/http.ts.live.conf
to reproduce http-ts play problem.
Cause
the ios & mac hardware decoder (Video Toolbox) dislike to feed it so many SEI NALU between NonIDR and IDR NALU packets.
The general NALU type sequence of a Normal rtmp video stream is like this:
SEI -> IDR -> SEI -> IDR -> ... NonIDR -> IDR -> ... NonIDR
But the problem video stream is like this:
SEI -> IDR -> SEI -> IDR -> SEI -> NonIDR -> (repeat SEI, NonIDR | IDR).
Solutions
add filter to delete the SEI NALU for rtc, which is works well.
for the http-flv on safari mac, need to do similar thing to filter the flv video tags with SEI NALU.(not yet verified).
from srs.
I believe this problem is related to #4050 (see my comment #4050 (comment)), where I am experiencing the same issue (but in the browser, not in the application).
from srs.
Same issue for me too. I get the same codec information in all cases which is h264 but on iOS in some cases, I have a huge fps drop. I thought there was some experimental codec issue related to VP9/AV1, but the default SRS settings for transcoding is the copy engine, so actually there is no transcoding process.
from srs.
In the previously closed issue, you mentioned that the profile should be set to baseline.
I am unable to make any changes to the drone (there are no available options).
Where should I change this setting? Could you please point out where and what I should change in the SRS configuration?
I also tried transcoding with ultrafast and baseline settings, but it was slow (around 2-3 seconds), and I need the streaming to be under 0.5 seconds.
from srs.
Let's reproduce this issue first on iOS device.
My Env
MacOS 14.4.1 M2 chip
iphone 11 + ios 17.4.1
My MacOS's ip address: 192.168.12.100
Here is my steps to do it.
1. prepare a video source to testing
I used this video source https://www.youtube.com/watch?v=-B2jRTTmYwk
, restore it to mp4 file by youtube-dl
.
(I like this song, you're welcome).
store the video source as test.mp4
.
ffprobe test.mp4
and ffprobe -show_frames | grep -i 'pict_type'
to check the mp4 file video codec profile and I/P/B frames.
Above video is h.264 high profile without b-frame.
2. start srs
export CANDIDATE=192.168.12.100
./objs/srs -c conf/rtmp2rtc.conf
replace ip address to yours.
3. rtmp publish to srs
- publish to srs with b-frame
ffmpeg -re -stream_loop -1 -i test.mp4 -vcodec h264 -profile:v high -acodec copy -f flv rtmp://localhost/live/livestream
- publish to srs without b-frame
ffmpeg -re -stream_loop -1 -i test.mp4 -vcodec h264 -profile:v high -bf 0 -acodec copy -f flv rtmp://localhost/live/livestream
or
ffmpeg -re -stream_loop -1 -i test.mp4 -vcodec copy -acodec copy -f flv rtmp://localhost/live/livestream
or
ffmpeg -re -stream_loop -1 -i test.mp4 -vcodec h264 -profile:v baseline -acodec copy -f flv rtmp://localhost/live/livestream
4. build and install flutter_live
use the branch in https://github.com/ossrs/flutter_live/pull/20
.
In https://github.com/ossrs/flutter_live/pull/20/files#diff-69396fa518b81aa9d2099ead13c33e18bc8e570098408f2f50ee114adf6898d1
, I upload my DEVELOPMENT_TEAM = 4X75RZ9C85;
, that's a mistake, if you knows a tiny of xcode
, you know how to replace this identify to your own one.
What I did in this draft is to upgrade flutter
and flutter_webrtc
and remove the camera_with_rtmp
dependency.
5. play webrtc videos in ios
click webrtc option.
input: webrtc://192.168.12.100/live/livestream
. (replace the ip address to yours).
click play.
compare the video quality.
My conclusion
I think the video stream without b-frame seems not that bad, just the same result to play webrtc in web browser (both safari and chrome in MacOS, check my comments in #4050)
from srs.
Related Issues (20)
- 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
- RTMP to WebRTC fps drop by DJI mini 3. HOT 6
- Console: The HTTPS API and the HTTPS server share the same port. HOT 1
- 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
- SRT:How to support Origin Cluster HOT 2
- WebRTC: Support G711A audio codec HOT 6
- RTC2RTMP: No sound in the audio for the first six seconds HOT 2
- SRS only supports H.264 Baseline profile in WebRTC, not High profile HOT 1
- Forward and Cluster.
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.