Commit Graph

14 Commits

Author SHA1 Message Date
William Porter ea4d6b20a6 Serialize mixer output frame ordering via AsyncStream.
Replace unstructured Task {} in MediaMixerOutput and StreamOutput
conformances with AsyncStream channels that preserve FIFO ordering.

The previous pattern created a new Task for each audio/video callback,
which provides no ordering guarantee when entering an actor's serial
executor. This caused adjacent frames to arrive out of order, resulting
in RTMPTimestamp.invalidSequence errors (silent frame drops) and
AVAssetWriter failures in StreamRecorder.
2026-03-10 15:27:54 +10:00
shogo4405 e352610c3b Suppress warnings. 2025-11-24 20:48:15 +09:00
shogo4405 b718080c4a Made expectedFrameRate optional. (#1841) 2025-11-24 20:43:05 +09:00
shogo4405 3c234d20e5 Rename #1832 2025-11-21 23:30:18 +09:00
Tabber (인병윤) b119b56969 Add framerate to RTMP onMetaData (#1832)
* feat: Add framerate to RTMP onMetaData

Adds framerate field to RTMP onMetaData for RTMP servers like
nginx-rtmp-module to correctly parse stream frame rate statistics.

The framerate value is synchronized from VideoCodec.expectedFrameRate
when MediaMixer.setFrameRate() is called.

* feat: Move expectedFrameRate to VideoCodecSettings and add framerate to RTMP metadata

- Move expectedFrameRate from VideoCodec to VideoCodecSettings
- Remove setExpectedFrameRate() method from OutgoingStream and StreamConvertible
- Add framerate field to RTMP onMetaData message
- Synchronize expectedFrameRate in MediaMixer.setFrameRate() and addOutput()
- Add helper methods for frame rate synchronization
- Make MediaMixer.defaultFrameRate public

* feat: Rename expectedFrameRate to defaultFrameRate and add framerate to RTMP metadata

- Rename VideoCodecSettings.expectedFrameRate to defaultFrameRate to represent
  a different concept from MediaMixer.frameRate
- Remove synchronization code from MediaMixer.setFrameRate() and addOutput()
  to allow independent frame rate management per stream
- Remove VideoCodec.expectedFrameRate and OutgoingStream.expectedFrameRate properties
- Add framerate field to RTMP onMetaData message for RTMP servers like
  nginx-rtmp-module to correctly parse stream frame rate statistics
- Make MediaMixer.defaultFrameRate public

This change allows each stream to have its own independent defaultFrameRate
(e.g., Service A at 30 FPS, Service B at 60 FPS) while MediaMixer can output
at a different frame rate. The defaultFrameRate is used both for VideoToolbox
encoder configuration and RTMP metadata.

Breaking changes:
- VideoCodecSettings.expectedFrameRate renamed to defaultFrameRate
- MediaMixer.addOutput() no longer synchronizes frame rate (streams must
  explicitly set defaultFrameRate via VideoCodecSettings init or setVideoSettings())
2025-11-21 23:17:23 +09:00
shogo4405 4d9010b05d fix Can't RTMP playback. 2025-09-18 22:23:51 +09:00
shogo4405 8cb6f309a6 fixed an issue where streaming could fail to start in FME compatibility mode 2025-09-07 02:29:26 +09:00
shogo4405 87e14fd194 Add AudioCodecSettings.Format option. 2025-08-17 21:26:44 +09:00
shogo4405 4bc048d20a fix typo. 2025-08-12 01:02:46 +09:00
shogo4405 e9c562a0e8 Rename HKStream -> StreamConvertible. 2025-07-21 19:45:37 +09:00
shogo4405 c06bdc72af swiftlint --fix --format 2025-07-20 22:04:25 +09:00
shogo4405 7741aee8d3 Modified to throw an error for unsupported codecs. 2025-07-15 00:08:37 +09:00
shogo4405 d8f6f243bc fix typo BitRateStorategy -> BitRateStrategy. 2025-07-13 18:44:41 +09:00
shogo4405 68c0d1cfc8 Repackage RTMPHaishinKit. 2025-07-13 12:43:53 +09:00