Replies: 3 comments 1 reply
-
2. 3 Bitrate strategyI’m referring to the class names in the current main branch. In version 2.0.0, class names may differ due to typo fixes and other changes, so please interpret them accordingly. I'm provided a protocol called StreamBitRateStrategy. By customizing this, you should be able to achieve what you’re aiming for. let myStrategy = MyBitRateStrategy()
let stream = RTMPStream()
stream.setBitRateStrategy(myStrategy) The current output bitrate can be obtained via the NetworkMonitorEvent used in the adjustBitrate method: Please refer to it for details. |
Beta Was this translation helpful? Give feedback.
-
1. Bitrate "spikes"This is a characteristic behavior of VideoToolbox. Try specifying the dataRateLimits as shown below. You can finely control the bitrate to ensure it does not exceed 1.5 times the specified bitrate. var videoCodecSettings = VideoCodecSettings()
videoCodecSettings.dataRateLimits = [0, 0]
stream.setVideoCodecSettings(videoCodecSettings) HaishinKit.swift/HaishinKit/Sources/Codec/VideoCodecSettings.swift Lines 185 to 192 in ee08ab4 |
Beta Was this translation helpful? Give feedback.
-
@shogo4405 Thank you for your prompt response! ❤️ Couple of followup questions:
P.S. Also we'd be happy to ask you for the personal consultation but I didn't manage to find a contact info to contact you directly. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
We're using HaishinKit.swift for our RTMP broadcasting app on iOS and are curious about a few things regarding controlling outgoing stream parameters.
If somebody has already solved this and knows what might be the reason — please share:
1. Bitrate "spikes" at the start of the stream: We noticed that bitrate "spiked" for a moment at the start of the broadcast, sometimes much above the target value (we don't know what triggers this exactly): e.g, we're broadcasting at 2,000 kbit/s and it spiked to, like, 20,000. Some streaming platforms "don't like" this and drop the RTMP connection.
2. "Bitrate strategy" inconsistency for audio&video: When the internet connection quality drops — video & audio bitrate also drop, as expected. But as soon as the connection quality restores: video bitrate restores to target values as well, but audio bitrate stays the same regardless (using Constant Bitrate strategy). Any ideas why this might happen?
3. Actual outgoing bitrate monitoring: Regarding the first 2 "issues" — we hoped to implement some kind of internal monitoring to keep track of the actual bitrate for audio&video. But we didn't find any public properties to obtain such information during the broadcast. If you managed to find a way to monitor the actual outgoing bitrate for audio&video — please share.
Beta Was this translation helpful? Give feedback.
All reactions