Sitelet https://github.com/theshiftstudio/rtmp-rtsp-stream-client-java/pull/6
Skip to content

Update Rtmp Library - #6

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

daroltidan wants to merge 1402 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 June 18, 2026 13:51
Bumps `ktor` from 3.5.0 to 3.5.1.

Updates `io.ktor:ktor-network` from 3.5.0 to 3.5.1
- [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.0 to 3.5.1
- [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.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: io.ktor:ktor-network-tls
  dependency-version: 3.5.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
* add whip module

* creating whip client

* testing post request

* fix post request

* add whip stun

* adding srtp support

* add srtcp support and fix calculate iv

* fix compilation

* update socket and add gathering

* add write offer

* read stun command correctly

* finish read and write stuns

* fix fingerprint crc32

* parse sdp answer

* add stun connection flush

* fixing integrity attribute

* finish gathering stun candidates

* request finally working

* stun connection finished

* adding dtls handshake

* update java socket

* doing dtls connection

* dtls handshake worked

* fix conexion

* connection working

* remove unnecessary files

* fix connection

* create send whip

* extract crypto provisional

* send packets working

* remove unused files

* stream audio working

* fix whip only video

* refactoring

* update readme

* fix send video info on rtp keyframes

* refactor rtp sockets

* fix app example
 dependencies
pedroSG94 and others added 30 commits August 20, 2026 13:25
Bumps `agp` from 9.3.1 to 9.3.2.

Updates `com.android.application` from 9.3.1 to 9.3.2

Updates `com.android.library` from 9.3.1 to 9.3.2

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

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [gradle-wrapper](https://github.com/gradle/gradle) from 9.6.1 to 9.7.1.
- [Release notes](https://github.com/gradle/gradle/releases)
- [Commits](gradle/gradle@v9.6.1...v9.7.1)

---
updated-dependencies:
- dependency-name: gradle-wrapper
  dependency-version: 9.7.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Bump gradle-wrapper from 9.6.1 to 9.7.1
With TCP backpressure (server ACKs not arriving, send window full) the sender
blocks in a java.io socket write, which ignores coroutine cancellation.
disconnect() stopped the sender first (BaseSender.stop -> job.cancelAndJoin)
and closed the socket only afterwards, so the join waited until the network
recovered or TCP gave up. A reConnect hung for the whole time.

Try a cooperative stop first (keeps the graceful close in the normal case) and,
if the sender does not stop within 1 s, close the socket to unblock the write
and stop again. RTSP over TCP (interleaved) writes to the same socket and has
the same issue. SRT/UDP are not affected (UDP sends do not block on ACKs).
SrtSender does not wait for ACKs and handleServerPackets swallows receive
timeouts, so a silent path (NAT rebind, black hole, frozen server) is never
reported: the stream keeps sending into the void. setServerSilenceTimeout(ms)
reports onConnectionFailed("No response from server") when no packet from
the server arrived for the given time. Disabled by default (0).
…g or paused

Co-authored-by: Cursor <cursoragent@cursor.com>
…oders-while-record-starting

keep encoders running in stopStream while a recording is starting or paused
…nce-timeout

srt: optional server silence timeout to detect a dead path
Receivers with periodic NAK reports (e.g. gosrt) report every missing
packet again on each NAK interval (20 ms minimum). reSendPackets resent
all reported packets unconditionally, so under a bottleneck one lost
packet could be sent up to latency / 20 ms times and loss amplified itself.

- Token bucket for retransmissions: 25 % of the measured media rate by
  default (libsrt SRTO_OHEADBW), burst of up to 0.5 s of media.
- Resend oldest first; stop resending once the budget is exhausted.
- Skip packets that cannot arrive before their latency expires and
  already retransmitted packets reported again within
  max(rtt + 4 * rttVariance, 20 ms).
- setRetransmitOverhead(percent), <= 0 restores the unlimited behavior.
- packetsLostUnique counts each lost sequence number once.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
MediaCodec emits the audio codec config (for AAC the AudioSpecificConfig) as its
first output buffer, flagged with BUFFER_FLAG_CODEC_CONFIG. AudioEncoder.checkBuffer
only validated the timestamp, so that buffer was forwarded like a regular frame:
senders transmitted it as a tiny bogus AAC frame and AndroidMuxerRecordController
wrote it into the recording as a sample.

The resulting MP4 files start with a 2-byte audio sample that is identical to the
track extradata. FFmpeg and VLC skip it, but Chrome aborts playback of the whole
file with PIPELINE_ERROR_DECODE.

Dropping the buffer is safe because the configuration is derived independently on
every path: RTMP builds the AudioSpecificConfig in AacPacket.sendAudioInfo from
sample rate and channel count, RTSP signals it through the SDP body, and the muxer
takes it from the MediaFormat passed to setAudioFormat, which already carries csd-0.
This mirrors how VideoEncoder keeps SPS/PPS out of the frame path.
…ssions

srt: limit retransmissions to avoid a NAK-driven retransmit storm
…-buffer

Do not forward the audio codec config buffer as an encoded frame
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