Skip to content

Update Rtmp Library - #6

Open
daroltidan wants to merge 1367 commits into
theshiftstudio:masterfrom
pedroSG94:master
Open

Update Rtmp Library#6
daroltidan wants to merge 1367 commits into
theshiftstudio:masterfrom
pedroSG94:master

Conversation

@daroltidan

Copy link
Copy Markdown

No description provided.

@daroltidan daroltidan closed this Mar 8, 2023
@daroltidan daroltidan reopened this Mar 8, 2023
@daroltidan daroltidan closed this Mar 8, 2023
@daroltidan daroltidan reopened this Mar 8, 2023
@pedroSG94
pedroSG94 force-pushed the master branch 2 times, most recently from d54eeb0 to 1af26b2 Compare November 7, 2025 08:32
pedroSG94 and others added 24 commits April 24, 2026 21:03
…match

fix: addresses slow frame emission due to time unit mismatch
…ns.kotlin.android-2.3.21

Bump org.jetbrains.kotlin.android from 2.3.20 to 2.3.21
Bumps `agp` from 9.1.1 to 9.2.1.

Updates `com.android.application` from 9.1.1 to 9.2.1

Updates `com.android.library` from 9.1.1 to 9.2.1

---
updated-dependencies:
- dependency-name: com.android.application
  dependency-version: 9.2.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.android.library
  dependency-version: 9.2.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps `coroutines` from 1.10.2 to 1.11.0.

Updates `org.jetbrains.kotlinx:kotlinx-coroutines-android` from 1.10.2 to 1.11.0
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](Kotlin/kotlinx.coroutines@1.10.2...1.11.0)

Updates `org.jetbrains.kotlinx:kotlinx-coroutines-test` from 1.10.2 to 1.11.0
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](Kotlin/kotlinx.coroutines@1.10.2...1.11.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…1.11.0

Bump coroutines from 1.10.2 to 1.11.0
Bumps [androidx.media3:media3-inspector](https://github.com/androidx/media) from 1.10.0 to 1.10.1.
- [Release notes](https://github.com/androidx/media/releases)
- [Changelog](https://github.com/androidx/media/blob/release/RELEASENOTES.md)
- [Commits](androidx/media@1.10.0...1.10.1)

---
updated-dependencies:
- dependency-name: androidx.media3:media3-inspector
  dependency-version: 1.10.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
dependabot Bot and others added 30 commits August 3, 2026 18:23
Bumps `ktor` from 3.5.1 to 3.5.2.

Updates `io.ktor:ktor-network` from 3.5.1 to 3.5.2
- [Release notes](https://github.com/ktorio/ktor/releases)
- [Changelog](https://github.com/ktorio/ktor/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ktorio/ktor/commits)

Updates `io.ktor:ktor-network-tls` from 3.5.1 to 3.5.2
- [Release notes](https://github.com/ktorio/ktor/releases)
- [Changelog](https://github.com/ktorio/ktor/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ktorio/ktor/commits)

---
updated-dependencies:
- dependency-name: io.ktor:ktor-network
  dependency-version: 3.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: io.ktor:ktor-network-tls
  dependency-version: 3.5.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
fix reloadcodec and perfer color 19 on low api if possible
fix camerax stop and file sources loop
Bumps [androidx.media3:media3-inspector](https://github.com/androidx/media) from 1.10.1 to 1.11.0.
- [Release notes](https://github.com/androidx/media/releases)
- [Changelog](https://github.com/androidx/media/blob/release/RELEASENOTES.md)
- [Commits](androidx/media@1.10.1...1.11.0)

---
updated-dependencies:
- dependency-name: androidx.media3:media3-inspector
  dependency-version: 1.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
In SURFACE mode VideoEncoder.checkBuffer rebases every frame on firstTimestamp —
the PTS of the first frame this encoder produced. AudioEncoder.calculatePts
rebases on presentTimeUs, the origin StreamBase hands to every encoder in
startSources(). The two timelines therefore start at different moments: audio at
the instant the stream started, video at the instant its first frame came out of
the encoder. Whatever sits between them — opening the camera, warming up GL —
becomes a constant offset, with the picture running ahead of the sound.

Measured on a Samsung SM-A065F (Android 15, camera source, built-in mic, RTMP):
video ran 470 ms ahead of audio, 18 clap pairs, spread 427-517 ms. Lips move,
speech follows. Both TimestampMode branches perform the same rebase, so switching
CLOCK/BUFFER makes no difference — verified by measuring both.

Rebasing on presentTimeUs is safe here: GlStreamInterface stamps frames through
GlTimestamp, which anchors the first frame to TimeUtils and clamps later frames to
within one frame of that clock, and StreamBase reads the same TimeUtils to start
the encoders. Both sides are on CLOCK_BOOTTIME microseconds, so the subtraction is
meaningful and matches what the audio path already does. Non-surface paths are
untouched, and the old behaviour still applies when the encoder was started
without a shared origin.

With the same test the 490 ms cluster disappears; what remains is inside the
resolution of a clap measurement.
…origin

Fix/surface pts shares audio origin
VideoEncoder stores width/height exactly as prepareVideoEncoder received them and
keeps rotation separately; at 90 or 270 it configures the codec as height x width.
A portrait broadcast prepared with (1920, 1080, rotation = 90) therefore produces
1080x1920 frames, while getVideoResolution() reported 1920x1080.

That pair goes straight into onMetaData:

  GenericStream.kt:111  val resolution = super.getVideoResolution()
  RtmpStream.kt:73      val resolution = super.getVideoResolution()
  MultiStream.kt:188    val resolution = super.getVideoResolution()

so every portrait broadcast through the newer API told the server it was landscape.
Players trust onMetaData: YouTube opens a 16:9 window and pillarboxes the vertical
picture, which is what our users reported. MultiCamera1/2 already swapped at their
call sites (MultiCamera2.kt:197-201), so only the newer classes were affected.

Fixed in getVideoResolution() rather than at the three call sites, so anything else
reading it gets the shape that is actually on the wire.

Verified on a Samsung SM-A065F: prepared 1920x1080 with rotation 90, the encoder
emits 1080x1920 (confirmed from the SPS of the captured stream), and the metadata
now matches instead of claiming landscape.
Announce the rotated resolution so portrait streams are not pillarboxed
…dia3-media3-inspector-1.11.0

Bump androidx.media3:media3-inspector from 1.10.1 to 1.11.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants