Comments (9)
@themaxsmith I was able to find another workaround, while still using the Main or High profiles. I modified the H264Encoder.swift file to disable frame reordering in the encoder:
Change:
kVTCompressionPropertyKey_AllowFrameReordering: !isBaseline as NSObject,
To:
kVTCompressionPropertyKey_AllowFrameReordering: kCFBooleanFalse,
I'm not sure if there are any drawbacks to this, but I haven't experienced any so far.
from srthaishinkit.swift.
https://en.wikipedia.org/wiki/Packetized_elementary_stream
from srthaishinkit.swift.
https://github.com/shogo4405/HaishinKit.swift/blob/master/Sources/ISO/TSWriter.swift
from srthaishinkit.swift.
ffprobe shows this error Invalid timestamps stream=1, pts=8999, dts=11999, size=3497 throughout stream - stream 1 = video stream. also missing ts metadata service_name and serivce_provider.
from srthaishinkit.swift.
@themaxsmith Did you ever figure this out?
from srthaishinkit.swift.
@themaxsmith Did you ever figure this out?
I ended up using srt-live-server instead of srs on the server-side. It will accept the SRT output then you can use an HTTP callback to create an FFmpeg instance that generates the correct timestamps then you can send it to SRS or any type of media server.
from srthaishinkit.swift.
@themaxsmith I actually got it working by simply changing the profile level to baseline.
Example:
srtStream.videoSettings = [.profileLevel: kVTProfileLevel_H264_Baseline_3_1]
from srthaishinkit.swift.
@themaxsmith I actually got it working by simply changing the profile level to baseline.
Example:
srtStream.videoSettings = [.profileLevel: kVTProfileLevel_H264_Baseline_3_1]
Good to know there is a workaround. The only problem is that the baseline profile is significantly worse on picture quality compared to high and uses 50% more bandwidth to create a similar quality picture. Can't use it on commercial products were paying customers may be limited on bandwidth and expect a high-quality stream. It is okay where you may not have to worry about bandwidth. It is also possible that since srt standard is not well defined when it comes to the TS format that SRS follows ffmpeg default values (so does OBS) and TSWriter may be following the HLS default values. It may be fixed in the future but for now, I think the best idea is to switch it to RTMP with generated timestamps on the server-side to prevent corruption. This is what we are doing at SeasonCast for a few hundred srt streams every night using this library and we have gotten a good result from it (extremely better than RTMP). From what I learned, you want to also build in some type of adaptive bitrate handling.
from srthaishinkit.swift.
stream.videoSettings[.allowFrameReordering] = false
option is now available.
shogo4405/HaishinKit.swift#1050
from srthaishinkit.swift.
Related Issues (15)
- Two way connections HOT 2
- How to compile SRT packages to xcode? HOT 1
- Not able to run project in xcode 11.2 HOT 2
- Adding Framework to project HOT 1
- Connecting to srt-live-server v1.4.x or ffplay endpoint fails/disconnect HOT 1
- Building the project: Library not found for -lcrypto
- Can't connect to sever HOT 5
- Connection setup failure: connection time out
- connect method is not available HOT 1
- unable to set passphase
- VTDecompressionSessionDecodeFrame fails with OSStatus=-12909 HOT 1
- Can't add the package HOT 1
- .
- Getting performanceData crash the app
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 srthaishinkit.swift.