While using the native AVfoundation for recording videos I am able to see black frames/ screen in the beginning and end of the video for 2 millisecond at the end and beginning .
func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {
guard isRecording, let assetWriter = assetWriter else { return }
let timestamp = CMSampleBufferGetPresentationTimeStamp(sampleBuffer)
if recordingStartTime == nil {
recordingStartTime = timestamp
let adjustedStartTime = CMTimeAdd(timestamp, CMTimeMake(value: -2, timescale: 1000)) // Adjust start time slightly earlier
assetWriter.startSession(atSourceTime: adjustedStartTime)
print("Status: \(assetWriter.status.rawValue)")
}
if output == videoOutput {
if videoInput?.isReadyForMoreMediaData == true {
videoInput?.append(sampleBuffer)
}
} else if output == audioOutput {
if audioInput?.isReadyForMoreMediaData == true {
audioInput?.append(sampleBuffer)
}
}
if let startTime = recordingStartTime, CMTimeSubtract(timestamp, startTime) >= recordingInterval {
isRecording = false
let adjustedEndTime = CMTimeAdd(timestamp, CMTimeMake(value: 2, timescale: 1000)) // Adjust end time slightly later
assetWriter.finishWriting { [weak self] in
print("Finished writing segment")
self?.startRecording() // Start a new recording segment
}
recordingStartTime = nil
}
}
Post
Replies
Boosts
Views
Activity
These were the commands included in run script:
"${PODS_ROOT}/FirebaseCrashlytics/run"
"${PODS_ROOT}/FirebaseCrashlytics/upload-symbols" -gsp "${PROJECT_DIR}//GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
And in build options -> Debug Information Format I have set it Dwarf with DSYM file
If the Bitcode is enabled in the build settings I'm not able run the app
What should I do to upload dsym from Xcode rather than manually uploading it ?