Replies: 4 comments 22 replies
-
|
It’s difficult to give proper advice without knowing how to reproduce the issue. First, please tell me how to reproduce it. For example:
Also, even if we both say “camera stutter,” our understanding of that term might not be exactly the same, so a video would be very helpful. |
Beta Was this translation helpful? Give feedback.
-
|
Hi,
This issue also appears in the Example project without any modification. We’ve also shared these videos directly to your personal email for easier review.
Below is our setup code: // MARK: - 1. Audio Monitoring
let isHeadphoneConnected = DeviceUtil.isHeadphoneConnected()
await mixer.setMonitoringEnabled(isHeadphoneConnected)
// MARK: - 2. Mixer Setup
await mixer.setSessionPreset(.hd1920x1080)
var videoMixerSettings = await mixer.videoMixerSettings
videoMixerSettings.mode = .offscreen
await mixer.setVideoMixerSettings(videoMixerSettings)
let _ = await mixer.screen.registerVideoEffect(videoEffect)
await multipleStreamManager.setPreferences()
setCamerePreviewFullscreenIfNeed()
// MARK: - 3. Codec Settings
let audioConfig = 128000
let videoBitrate = 6000 * 1000
let audioSetting = AudioCodecSettings(
bitRate: audioConfig.bitrate,
sampleRate: audioConfig.sampleRate
)
var videoSetting = VideoCodecSettings(
videoSize: CGSize(width: 1920, height: 1080),
bitRate: videoBitrate,
scalingMode: .letterbox,
bitRateMode: .average,
maxKeyFrameIntervalDuration: 2
)
if #available(iOS 16.0, *) {
videoSetting.bitRateMode = .constant
}
videoSetting.profileLevel = kVTProfileLevel_H264_Main_AutoLevel as String
// MARK: - 4. Setup Streams
let stream = await streamManager.getStream()
try? await stream.setAudioSettings(audioSetting)
try? await stream.setVideoSettings(videoSetting)
await mixer.addOutput(stream)
await stream.addOutput(cameraScreenPreview)
await stream.addOutput(recorder)
// MARK: - 5. Start Mixer
await mixer.startRunning()
// MARK: - 6. Frame Rate Configuration
do {
// Input frame rate
try? await mixer.configuration(video: 0) { video in
do {
try video.setFrameRate(60)
} catch {
logger.error(error)
}
}
// Output frame rate
try await mixer.setFrameRate(60)
} catch {
}Thanks & best regards, |
Beta Was this translation helpful? Give feedback.
-
Audio issueI tested both with and without the StreamRecorder feature enabled, but I wasn’t able to reproduce the issue on my end. My hypothesis is that:
These events can cause an interruption request, which leads to I recommend adding logging as shown in the following documentation to check whether any interruption requests are occurring: |
Beta Was this translation helpful? Give feedback.
-
Yes, I implemented However, in some cases (though I’m not yet sure how to reproduce them), at least five users have reported that over time, the audio and video gradually drift out of sync. I’ll continue monitoring and investigating this issue to determine the root cause.
Do you know what might cause this? It happens in all of my live streams. I also tested it using your Example project, and the issue still occurs, although less frequently. Here’s my current setup:
Best regards, |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
First of all, thank you for this excellent library — it works very well overall.
However, I’ve been encountering two recurring issues when running the Example project directly from this repository:
Camera stutter
When panning or moving the camera, both the local preview and the live stream show noticeable frame stuttering.
This happens on both iPad and iPhone 16 Pro.
I suspect it may be related to
displayLinktiming or frame processing threads, but I’m not entirely sure.I’ve also tested the latest
mainbranch with GPU integration, and the issue still persists.Audio issues
Occasionally, the audio becomes desynchronized from the video or produces crackling sounds.
In some sessions, the audio becomes completely muted for several minutes before recovering on its own.
This issue is intermittent and difficult to reproduce consistently, but it happens often enough to be noticeable.
It might be related to StreamRecorder.Error 6 when stopRecording after long live (90m) – video not saved (30–40% cases) #1812 — once this issue occurs, the video also fails to save properly.
→ I believe there should be a controller or mechanism to monitor A/V timestamps.
If the audio and video timestamps drift out of sync, the stream could automatically restart or adjust timing to recover synchronization.
Currently, I have to manually restart the app and begin a new live session for audio and video to realign.
I’d really appreciate it if you could take a look or suggest possible debugging or optimization approaches. We can sponsor a small contribution to support further development.
Thank you again for your great work on this project.
Beta Was this translation helpful? Give feedback.
All reactions