on OS X API, you use an AVAssetWriter object to write media data to a new file of a specified audiovisual container type, such as a QuickTime movie file or an MPEG-4 file, with support for automatic interleaving of media data for multiple concurrent tracks
Questions tagged [avassetwriter]
529 questions
10
votes
1 answer
AVAssetWriter fails once App goes in background
I am working on iOS app in which i am creating video from images. I am using AVAssetWriter to achieve this. Everything works fine. But When app goes in background and switched back, the video writing fails. AVAssetWriter's…

Unnati
- 2,441
- 17
- 37
10
votes
2 answers
AvFoundation - How to connect AVCaptureSession and AVAssetWriter?
I'm trying to use AVCaptureSession to capture video from the camera and then I would like to use AVAssetWriter to write the results to a file (specifically, use multiple AVAssetWriters to write the capture to chunk videos, but we don't need to…

golmschenk
- 11,736
- 20
- 78
- 137
10
votes
1 answer
AVAssetWriter How to write down-sampled/compressed m4a/mp3 files
I'm trying to take a local m4a or mp3 file and compress/down-sample this file (for the purposes of making a smaller file).
Originally, I was using the AVAssetExportSession to export an AVAsset to a temp directory, but I didn't have any control over…

Dfowj
- 739
- 9
- 25
9
votes
2 answers
AVAssetWriterInputPixelBufferAdaptor pixelBufferPool goes NULL after some time
I'm using the pixelBufferPool within an AVAssetWriterInputPixelBufferAdaptor to create pixel buffers for use with the append method. After creating 4 buffers, the pixelBufferPool property becomes NULL;
I setup my writer, input and adaptor like…

davidbitton
- 818
- 10
- 20
9
votes
2 answers
AVAssetWriterInput appendSampleBuffer: Cannot append sample buffer: Must start a session (using -AVAssetWriter startSessionAtSourceTime:) first'
I'm using ARVideoKit to record a screen (ReplayKit won't work for this) and sometimes I record and save with no problem. Other times I record and when I go to save I get a crash:
** Terminating app due to uncaught exception…

Lance Samaria
- 17,576
- 18
- 108
- 256
9
votes
6 answers
AVAssetWriterInputPixelBufferAdaptor returns null pixel buffer pool
I'm sure something's wrong with my buffer attributes, but it's not clear to me what -- it's not well documented what's supposed to go there, so I'm guessing based on CVPixelBufferPoolCreate -- and Core Foundation is pretty much a closed book to me.
…

David Moles
- 48,006
- 27
- 136
- 235
9
votes
2 answers
Issue with setting and retrieving the value of AVMetadataCommonKeyCreator
I have a video recording app for the iPhone. I am using AVAssetWriter for writing the recorded video data to a file. I am also interested in embedding custom metadata to the file. For eg: I want to identify my application as the creator of the…

Sahana Kamath
- 201
- 2
- 8
9
votes
4 answers
OpenGL to video on iPhone
I'm currently working on a project to convert a physics simulation to a video on the iPhone itself.
To do this, I'm presently using two different loops. The first loop runs in the block where the AVAssetWriterInput object polls the EAGLView for…

aToz
- 2,463
- 1
- 24
- 34
9
votes
2 answers
Making a real slow motion video that are all slow motion
I am creating this app of mine and shooting videos at 120 and 240 fps.
When I watch these videos on my mac I see these markers below the timeline.
These markers are editable and represent the area that is in slow motion. So, the video starts at…

Duck
- 34,902
- 47
- 248
- 470
9
votes
2 answers
How would I put together a video using the AVAssetWriter in swift?
I'm currently making a small app that timelapses the webcam on my mac, saves the captured frame to png, and I am looking into exporting the captured frames as a single video.
I use CGImage to handle the original images and have them set in an array…

Luke Parker
- 126
- 1
- 1
- 7
9
votes
3 answers
Rotating video without rotating AVCaptureConnection and in the middle of AVAssetWriter session
I'm using PBJVision to implement tap-to-record video functionality. The library doesn't support orientation yet so I'm in the process of trying to engineer it in. From what I see, there are three ways to rotate the video - I need help on deciding…

Jai Govindani
- 3,181
- 21
- 26
9
votes
1 answer
Using AVAssetWriter with raw NAL Units
I noticed in the iOS documentation for AVAssetWriterInput you can pass nil for the outputSettings dictionary to specify that the input data should not be re-encoded.
The settings used for encoding the media appended to the output. Pass nil to…

bsirang
- 473
- 4
- 14
8
votes
0 answers
AVAssetWriterInputPixelBufferAdaptor memory management
I'm writing some frames to video with AVAssetWriterInputPixelBufferAdaptor, and when I write a lot of frames my app crashes because of memory allocation. How can I prevent that? Here is the code:
AVAssetWriterInput *writerInput =…

Igor Bidiniuc
- 1,540
- 1
- 16
- 27
8
votes
0 answers
iOS: Cropping a CMSampleBufferRef before appending to AVAssetWriterInput
I'm currently experimenting with CoreImage, learning how to apply CIFilters to a camera feed. Presently I'm succeeded in taking a camera feed, applying a filter and writing the feed to an AVAssetWriter in the form of a video, but one issue I'm…

Grinneh
- 871
- 1
- 8
- 14
8
votes
3 answers
How can you make a CVPixelBuffer directly from a CIImage instead of a UIImage in Swift?
I am recording filtered video through an iPhone camera, and there is a huge increase in CPU usage when converting a CIImage to a UIImage in real time while recording. My buffer function to make a CVPixelBuffer uses a UIImage, which so far requires…

Chewie The Chorkie
- 4,896
- 9
- 46
- 90