-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AVAssetWriterInput appendSampleBuffer:] Cannot append sample buffer: Must start a session (using -[AVAssetWriter startSessionAtSourceTime:) first #101
Comments
help,same problem |
iPhone 7 plus 13.3, 13.3.1 |
@DPRuin it appears that the AudioSession queue is beginning before the start session method is executed. Looking into it. |
audioSettings = audioDataOutput.recommendedAudioSettingsForAssetWriter(writingTo: .m4a) as? [String : Any]----fix audio .m4v to .m4a, success fix iphone 7 plus 13.3.1 13.3 problem |
update : |
What should I do |
Was a resolution for this ever found @AFathi ? |
same problem |
Any solutions for this? Getting the same problem. |
Same problem |
What if we check assetWriter status while we append to buffer in captureOutput ? @AFathi |
I think it's fixed here. #122 Let me know if it helps someone. |
I have the vc setup the same exact way that you have it in your sample project except I grab the url once it's time to save:
Also in viewDidLoad I have this because I display a
SKVideoNode
and I need it for sound:When I first start recording the recorder works fine. The problem occurs when I go the background and come back then start recording again. Once I press the stop/save button I get a crash:
In
viewWillAppear
I runrecorder?.prepare(configuration)
In
viewWillDisappear
if running I stop it and regardless I callrecorder?.rest()
.I tried grabbing the url in the delegate method:
But the same problem occurs even when I first try to record before going to the background.
The crash always occurs when I go to the background and back then record and save but it also occasionally happens when I successfully record/save the first time but the second or third time is the same exact crash.
UPDATE:
Looking at the StackTrace the problem seems to stem from
thread 83 __pthread_kill
:let audioBufferQueue = DispatchQueue(label: "com.ahmedbekhit.AudioBufferQueue")
UPDATE:
I posted the question on Stack Overflow. Somebody tried to help me but their answer didn't work. There is something else causing the issue:
https://stackoverflow.com/q/60146678/4833705
UPDATE
Without having to go to the background it crashes randomly and more often then not when saving using:
recorder?.stop({ [weak self](url) in ...
Same crash result when using:
func recorder(didEndRecording path: URL, with noError: Bool) {
The text was updated successfully, but these errors were encountered: