Questions tagged [avassetwriterinput]

37 questions
2
votes
1 answer

Get duration of video while it's being recorded with AVAssetWriter

I have a class to record video and audio into .mp4 file. I use AVAssetWriter, AVAssetWriterInput to do such task How can I get duration of a video while it's being recorded with such method (AVAssetWriter)?
user924
  • 8,146
  • 7
  • 57
  • 139
2
votes
1 answer

Rotate CMSampleBuffer by arbitrary angle and append to AVAssetWriterInput in swift 3

I convert the sample buffer to a CGContext. Then I apply a transformation to the context and create a CIImage from that, which in turn gets displayed in an UIImageView. At the same time I want to append this to the AVAssetWriterInput to create a…
Ramin Afshar
  • 989
  • 2
  • 18
  • 34
2
votes
1 answer

Writing video to file works correctly for about 5 seconds on iPad 3, then fails

I am creating this app that is a camera. Because it is being created for iOS 9, I have to test it on an old device. In that case an iPad 3. The app works perfectly on a new iPad Pro 9.7 but fails to write video after a while on iPad 3. What happens…
Duck
  • 34,902
  • 47
  • 248
  • 470
1
vote
1 answer

Getting an error when I try to compress/down-sample the audio file using AVAssetWriterInput swift

I'm trying to take a local m4a file and compress/down-sample this file (For the purposes of making a smaller file). Now I stuck with error when I try to append sample buffer. Error description: *** Terminating app due to uncaught exception…
nameIsErik
  • 13
  • 4
1
vote
0 answers

RPScreenRecorder - custom recording size

I'm recording screen on iOS using RPScreenRecorder and it works fine, my question is , is there a way to set specific portion of the screen that I want to record instead of the entire screen? So far I checked : AVAssetWriter, AVAudioSession,…
Gal Blank
  • 2,070
  • 2
  • 18
  • 18
1
vote
1 answer

AVAssetWriter is recording empty, 0kb, .mp4 files from a custom video stream on iOS device

I am seeing a video stream and making .mp4 files so I am doing most of this correctly. My problem is that my video files are 0kb, empty. I'm using an iOS device to control a separate device with a camera. This camera is sending a video stream to the…
1
vote
0 answers

avassetwriterinput readyformoredata is NO when audio sample buffer size is changing

I got readyformoredata always no if audio sample buffer data size is changing. But if set sample buffer size to changeless value, readyformoredata becomes yes again. Does anybody know why? and here is my audio recoding settings: NSDictionary…
1
vote
1 answer

Failure to append frames to video file using AVAssetWriterVideoInput. Fails with undocumented error -12738 at the end

I am using an AVAssetWriterVideoInput to append buffers to a file. I have this code: if ( _assetWriter.status == AVAssetWriterStatusWriting ) { // If the asset writer status is writing, append sample buffer to its corresponding asset writer…
Duck
  • 34,902
  • 47
  • 248
  • 470
1
vote
1 answer

Audio Frames repeating in AVFramework created *.mov file via AVAsset

I am running into some problems trying to create a ProRes encoded mov file using the AVFramework framework, and AVAsset. On OSX 10.10.5, using XCode 7, linking against 10.9 libraries. So far I have managed to create valid ProRes files that contain…
1
vote
1 answer

How to create an outputSettings Dictionary for use with an AVAssetWriterInput instance?

I am attempting to convert a MPMediaItem instance into a caf formatted audio file. I have been following the work of Chris Adamson and his post on From iPod Library to PCM Samples in Far Fewer Steps Than Were Previously Necessary As I was digging…
Peter Hornsby
  • 4,208
  • 1
  • 25
  • 44
0
votes
0 answers

macOS: AVAssetWriter crash upon markAsFinished / finishWriting

Using AVAssetWriter to save captured audio and video to a file. It works correctly on my own machines all the time, but Apple's App Review team reports a crash when finishing recording. In the report the thread crashes upon…
hotdogsoup.nl
  • 1,078
  • 1
  • 9
  • 22
0
votes
1 answer

AVAssetWriterInput ReadyForMoreMediaData always false

I'm trying to record CVPixelbuffer in realtime. But I can't append buffer because assetWriterInput.isReadyForMoreMediaData always return false. Can someone explain why this value always false? Thank's. class VideoRecorder{ static var shared =…
0
votes
1 answer

swift CVPixelBuffer video is darker than original image

My app takes a snapshot of view: ZStack ( image with opacity 0.4 , white rectangle with opacity 0.25 then text) and save it as a image then enables user to generate a video using that image and some audio, I followed…
user2814778
  • 296
  • 6
  • 14
0
votes
1 answer

AVAssetWriter sample rate AV drift

I have an AVAssetWriter and I do set audio compression settings dictionary using canApply(outputSettings: audioCompressionSettings, forMediaType: .audio) API. One of the fields in the compression settings is setting an audio sample rate using…
0
votes
0 answers

AVAssetWriter not working with videoChat mode of AVAudioSession (iPhone 14 Pro only)

I have a video conferencing app and we are setting up AVAudioSession to videoChat so that we can get echo cancellation. let options: AVAudioSession.CategoryOptions = [.mixWithOthers , .defaultToSpeaker, .allowBluetooth] try…