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)
- 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.