rtmp_streaming 3.0.0
rtmp_streaming: ^3.0.0 copied to clipboard
A Flutter plugin for Camera and Microphone streaming library via RTMP.
3.0.0 #
- Integrate PR #14 with fixes for CameraX idle recording, audio preparation, snapshots, encoder/source release and surface loss. Incorporate the orientation fix proposed in PR #15 with matching Dart/Android display geometry.
- Preview contract:
previewSizenow means displayed pixel dimensions andaspectRatiois width / height. Native rotation, capture-preset and overlay changes update Flutter throughpreview_geometry_changed; native backends apply orientation without additional Flutter rotation. - Bind iOS orientation to the Flutter host's actual window scene. Serialize geometry updates, cancel superseded tasks, observe layout/transition completion instead of a fixed delay, and stop updates during disposal. Resolve automatic dimensions before RTMP/SRT/WHIP, multi-streaming and standalone recording; preserve explicit video/overlay canvas sizes. Active outputs retain their encoded dimensions until restarted.
- Serialize camera session transitions, reject concurrent starts, retain stop requests during startup and discard late results after disposal or disconnect. Keep recording/network state independent, preserve recording when stopping multi-streaming, roll back combined starts, make stop-all idempotent and update pause state only after success. Stop/dispose wait for outstanding native operations and cleanup.
- Add native build/source capability queries, common camera controls, typed capture presets and named Android GPU effects. Add Android
setRtmpMetadata,requestKeyFrame,getCameraControls,setZoom,setAutoFocus,tapToFocus, Camera2setManualExposureand rate-limitedsetCaptureTelemetry. Reject unsupported platform, hardware, pause, codec, authentication and multitasking requests explicitly. - Use protocol-specific StreamBase clients so RTMP/RTSP can use AV1, VP8, VP9 and new audio codecs. Validate URLs and protocol/codec combinations before replacing a session; default WHIP audio to OPUS with codec-appropriate sample rates and channels.
- Apply custom dimensions and keyframe intervals on preparation; retain mute, filters, overlays and pitch across pipeline recreation. Restore Android zoom, autofocus, exposure/white-balance locks and torch per camera, clamp zoom to the new source range and skip unsupported controls. Update StreamBase preview geometry after surface resize.
- Defer Android BT.709 changes until the next encoder preparation when idle preview already owns a prepared encoder. Preserve settings when live changes are rejected and allow repeated identical settings. Fix asynchronous video-overlay preparation and player resource leaks; use the configured bitrate budget for queue-aware adaptation. Enable the modern Android back callback in the example.
- Add the MediaProjection foreground service and handle consent cancellation/revocation. Screen sessions require fresh consent after stopping; do not reuse Android 14+ capture tokens.
- Fix permission results, Activity reattachment and pending initialization cleanup. Complete Android pre-mount error callbacks for capture, overlays, camera controls, PCM and multi-streaming while retaining configuration caching. Isolate stale callbacks and multi-destination retries; normalize destination IDs and preserve
destinationIdin events. - Enable TLS hostname verification for RTMPS/RTSPS, disable native client logs by default and avoid logging stream URLs/tokens. Normalize numeric statistics and units; report unavailable metrics as null.
- Fix iOS settings persistence, SRT bitrate mode, recorder compression settings, active-camera torch, overlay alpha/scale and snapshot framing. Add separate iOS
PlayerController/PlayerPreviewfor RTMP/WHEP and keep playback separate from capture/recording state. - iOS migration: require Swift Package Manager and Xcode with Swift 6; CocoaPods is unsupported. Add FlutterFramework and static SRT/RTC linker dependencies, migrate the example away from Pods, serialize native method requests and clean up initialization/disposal, event subscriptions and textures. Migrate the example to UIScene and register plugins through
FlutterImplicitEngineDelegateto support the iOS 27 SDK. - Deprecate no-op OpenGL/warmup flags, ambiguous audio/canvas names and integer filter APIs while preserving compatibility entry points. Audio aliases mute encoded audio without detaching capture;
setOverlayCanvascontrols composition rather than screen capture. - Upgrade AGP to 9.4.1, Gradle to 9.8.1 (with checksum), Kotlin to 2.4.21, AndroidX Annotation to 1.11.0 and compile SDK to 37.2. Retain NDK 30.0.16248370 / Build Tools 37.0.0; update example packages, pin permission_handler and require Flutter >=3.44 / Dart >=3.12. Use RootEncoder 2.8.1 and HaishinKit SPM 2.2.5.
- Expand controller lifecycle, geometry, native method-policy, URL/codec, permission and platform regression tests, and demonstrate camera controls, codecs, sources and metadata in the example. Android/iOS builds and local tests pass; real-device capture quality and live-server interoperability still require validation.
2.1.1 #
- Android: Fix front camera resetting to rear on
startVideoStreaming(camera2 / CameraX / WHIP / StreamBase / multi / record). - Android: Route filters, overlays, mute, pitch, flashlight, AE/WB lock, and tap-to-meter through the active pipeline (GenericCamera2, GenericStream, WhipStream, MultiCamera2).
- Android:
enableBufferAudiowhile GenericCamera2 is live migrates the session to StreamBase;startVideoRecording/ record+stream work on StreamBase/WHIP; WHIP ABR enabled. - Docs: Clarify
setVideoSourcefacing behavior (CameraX front/back; UVC/screen N/A) and idle preview remaining Camera2 until stream start.
2.1.0 #
- Android build: AGP 9.4.0, Gradle 9.7.1, plugin
android/converted to Kotlin DSL (.gradle.kts). Plugin-levelgradle/wrapperandgradle.propertiesremoved (host/example owns Gradle/AndroidX). - RootEncoder 2.8.1:
library+extra-sources; overlay filter renames (GifFilterRender/ImageFilterRender/TextFilterRender);SpriteGestureController.setSprite; queue-aware ABR viaQueueAwareBitrateAdapter. - Android codecs / audio:
setVideoCodec/setAudioCodec;setAudioProcessing(echo cancel + noise suppressor). - Android camera controls: white-balance lock;
tapToMeter(exposure / WB). - Android multi-streaming:
startMultiStreaming/stopStreamingDestination/stopMultiStreamingviaMultiCamera2(aligned with iOS Dart API; WHIP/WHEP excluded). - Android sources:
setVideoSource(camera2/cameraX/uvc/screen),requestScreenCapture,enableBufferAudio/feedPcmAudio(StreamBase path for non-camera2). - Stats:
StreamStatisticsaddsqueueBytesOut,bytesOutPerSecond,queueCongestionPercent,totalBytesOut. - Hardening: dispose no longer double-completes MethodChannel; MediaProjection stopped on replace/dispose; GenericStream parity for retry/codecs/bitrate/BT.709; start-while-streaming restarts; pending cache for codecs/source/AEC.
- Breaking:
CameraValue.isStreamingVideoRtmprenamed toisStreaming(covers all protocols). Empty Androidclose()stub removed. - WHEP: still Android ❌ (RootEncoder has WHIP only).
2.0.1 #
- Android: Fix
Camera not initializedwhen calling encoder settings afterinitializebut beforeCameraPreviewmounts.setAudioSettings/setVideoSettings/setFrameRate/setForceBt709Color/setRtmpShouldSendPingsnow cache values and apply them when the platform view is created (and keep the cache on remount).
- Docs: Clarify Android timing for these APIs and that
CameraPreviewis still required before starting a stream.
2.0.0 #
-
Multi-protocol streaming
- Added
StreamingProtocol(rtmp/rtsp/srt/udp/whip/whep) forstartVideoStreaming. - Android (RootEncoder 2.8.0): RTMP, RTSP, SRT, UDP, WHIP.
- iOS (HaishinKit 2.2.5): RTMP, SRT; WHIP/WHEP via
RTCHaishinKit(alpha, Flutter SPM).
- Added
-
Overlay / watermark (Android + iOS)
setOverlayText/setOverlayImage/clearOverlay.- iOS: when overlay is enabled, canvas / encoder size follows portrait or landscape (avoids stretched/shrunk preview).
-
Multi-streaming (iOS only; Android since 2.1.0)
startMultiStreaming/stopStreamingDestination/stopMultiStreaming(WHIP/WHEP not allowed).- Example defaults to one RTMP + one SRT destination.
-
SRT URL compatibility (iOS)
SrtURLHelpersupports SRS/ZLMediaKit-style URLs such as
srt://host:10080?streamid=#!::r=live/livestream,m=publish
(#is applied viaSRTO_STREAMID, not as a URL fragment).- Clearer SRT connect error messages (
unsupportedUri/ reject reason).
-
iOS EventChannel
- Native → Flutter events are always posted on the platform (main) thread.
-
Android extras
setPitchShift(RootEncoder pitch effect;1.0disables).lockExposure/unlockExposure/isExposureLocked(after preview/stream start).- Target / toolchain updates (e.g. compileSdk 37, AGP 9.x).
-
Docs & example
- README / README_zhCN and example app updated for protocols, overlay, and iOS multi-streaming.
1.0.8 #
- Fixed an error in the prepareVideo parameter that could cause compilation errors.
1.0.7 #
-
Dependency upgrades
- iOS:
HaishinKitpod bumped from2.0.9to2.2.5(aligned with Swift Package; Xcode 26.4, multitasking camera, etc.). - Android:
com.github.pedroSG94.RootEncoder:librarybumped to2.7.5.
- iOS:
-
Cross-platform API alignment (previously iOS-only or Dart-only without native wiring)
prepareForVideoStreaming(): iOS pre-attaches audio to reduce start latency; Android no-op.getHasAudio/setHasAudio: query/set temporary mute while streaming (does not detach the mic).getHasVideo/setHasVideo: query/set temporary video mute (Android sends black frames; iOS mixer mute).setAudioSettings(bitrate): audio encoder bitrate in bps; applied on nextprepareAudio.setVideoSettings({ bitrate, ... }): video encoder settings; Android can hot-updatebitrateviasetVideoBitrateOnFlywhile live.setFrameRate(frameRate): target capture/encode frame rate (call before streaming when possible).switchAudio: now available on both Android and iOS (toggles mic capture; different fromsetHasAudio).
-
Stream statistics
StreamStatisticsaddsisVideoMuted.- iOS
getStreamStatisticsnow returnsisAudioMuted,isVideoMuted,bytesSend, etc. - Android
getStreamStatisticsaddsisVideoMuted.
-
Documentation
- README / README_zhCN updated method lists and cross-platform API usage.
1.0.6 #
- fix android issue #8 question
- update package name
1.0.5 #
-
update HaishinKit.swift to 2.2.5 fix xcode 26.4 build error
-
update com.github.pedroSG94.RootEncoder to 2.7.1
-
Documentation: Added usage notes in README / README_zhCN for the following
CameraControllermethods:- Android (RootEncoder 2.7.0+):
setForceBt709Color,setRtmpShouldSendPings— BT.709 color matrix for encoding; RTMP periodic ping for RTT (seegetStreamStatistics/rttMicroswhen pings are enabled). - iOS (HaishinKit 2.2.1+ / 2.2.2+ / 2.2.5+):
setVideoSettings— optionalexpectedFrameRate(onMetaDataframerate) andbitRateMode(average/constant/variable);setMultitaskingCameraAccessEnabled— multitasking / PiP camera access (iOS 17+ when supported).
- Android (RootEncoder 2.7.0+):
-
CHANGELOG: This entry records the above API documentation and usage guidance; behavior matches implementations added in plugin development for RootEncoder 2.7.x and HaishinKit 2.2.x.
1.0.3 #
- fix android permission bug
1.0.2 #
- update package
- fix bug not removeFilter
1.0.1 #
- update package
- add - 📸 Take snapshot during streaming:
takePicture
1.0.0 #
- Updated iOS HaishinKit to version 2.0.0 (stable release).
- Completely refactored iOS code, now managing dependencies via Swift Package Manager.
- Added numerous new methods for iOS.
- Updated examples: revised
camera.dart, removed redundant fields and duplicate methods. - Upgraded Android Gradle to 9.0, updated RTMP package to the latest version, unified return values with iOS, and improved disposal methods.
- Added filter functionality for Android.
0.0.6 #
- Updated iOS HaishinKit to version 2.0.0 (preview version, not stable, may contain bugs).
0.0.5 #
- Optimized Android example project.
- Added pause/resume recording functionality for Android.
0.0.4 #
- Fixed Android crash errors when switching cameras. Added camera switching and audio toggle features. Optimized the example project.
- Cleaned up unused methods.
0.0.3 #
- Upgraded iOS HaishinKit to version 1.9.9.
- Rewrote some deprecated methods.
0.0.2 #
- Removed redundant Android packages to reduce build size.
0.0.1 #
- Completely refactored the Android version. Upgraded Gradle and the RTMP streaming plugin
com.github.pedroSG94.RootEncoderto the latest version. - Added filters for the Android version.
- Improved deprecated methods and fixed crashes caused by camera switching on Android.
- Fixed the issue where live recording could not be captured on Android.
- Added a toggle for low-light environment settings on Android.