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
7
votes
1 answer
AVAssetWriter sometimes fails with status AVAssetWriterStatusFailed. Seems random
I'm writing a MP4 video file with a AVAssetWriter using a AVAssetWriterInputPixelBufferAdaptor.
The source is a video from a UIImagePickerController, either freshly captured from the camera or from the asset library. Quality right now is…

Kasper Welner
- 545
- 3
- 11
7
votes
4 answers
iPhone - AVAssetWriter - Error creating movie from photos at 1920×1080 pixels
I am trying to create a movie from some pictures. It works just fine with hd pictures ({720, 1280}) or lower resolutions . But when i try to create the movie with full hd pictures {1080, 1920} , the video is scrambled. Here is a link to see how it…

flaviusilaghi
- 677
- 3
- 10
- 27
7
votes
1 answer
Using AVAssetWriter to create QuickTime movie from raw H.264 / AAC files
Using Mac OSX Objective-C, I'm trying to create a command line tool that takes a single H.264 and a single AAC file as inputs - encoded from the same source material - and, using AVAssetWriter, create a single QuickTime-compatible mov (and/or m4v)…

Chuck at Cimarron Systems
- 71
- 1
- 2
7
votes
2 answers
RTP iPhone camera - How to read AVAssetWriter file while its being written?
I'm trying to stream RTSP/RTP iPhone camera capture to a Wowza server.
Apple's API does not allow direct access to H264 encoded frames, but only allow you to write it into a container '.mov' file.
Either way, I cannot get access to that file content…

Avishay Cohen
- 2,418
- 1
- 22
- 40
7
votes
1 answer
Performance issues when using AVCaptureVideoDataOutput and AVCaptureAudioDataOutput
I'm having lag issues when I'm recording audio+video by using AVCaptureVideoDataOutput and AVCaptureAudioDataOutput. Sometimes the video blocks for a few milliseconds, sometimes the audio is not in sync with the video.
I inserted some logs and…
user711495
7
votes
1 answer
Optimization of CVPixelBufferRef
I am working on a project in which I generate a video from UIImage, with code I found around here, and I am struggling for some days now in order to optimize it (for about 300 images, it takes like 5 minutes on the simulator, and simply crashes on…

Grhyll
- 145
- 3
- 10
7
votes
0 answers
What data does AVAssetWriter metadata expect?
I am trying to add metadata to a video I am transcoding via AVAssetWriter. I tried creating AVMutableMetadataItem object, inserting it in an array and setting metadata property of the AVAssetWriter object. The result file does not include the…

Oren Meiri
- 71
- 3
6
votes
2 answers
Rotate AVAssetWriter's output 180 deg about the x-axis
I'm creating a Quicktime movie file using AVAssetWriter. Currently the output video is "upside down". In theory I can correct this by rotating the video 180 degrees about the horizontal axis (essentially "flipping" the video). What's the best way to…

SundayMonday
- 19,147
- 29
- 100
- 154
6
votes
0 answers
Capturing the screen with AVAssetWriter-- Works fine on simulator but on device creates black video
i m trying to capture the frame buffer data and convert into video for my iphone game..
i m using AVAssetWriter to accomplish this thing.
The code is working fine on simulator but not on device itself.. on device it generates a black video
i m using…

Tornado
- 1,069
- 12
- 28
6
votes
1 answer
AVAssetImageGeneratorCompletionHandler - how to set or return variables?
i´m using the AVAssetImageGenerator to get images from a movieclip without playing it before. Now i´ve got a question how to set up variables in the loop of a handler?
Is it possible?
I´m getting this error message and have no idea what does that…

geforce
- 2,593
- 3
- 28
- 44
6
votes
1 answer
Is it possible to use a quality between AVAssetExportPresetMediumQuality and AVAssetExportPresetHighestQuality with AVAssetExportSession?
I am using AVAssetExportSession to export a video out of my iOS app, like this:
AVAssetExportSession *exportSession=[AVAssetExportSession exportSessionWithAsset:composition presetName:AVAssetExportPresetMediumQuality];
I want to upload the exported…

Walchy
- 1,150
- 3
- 11
- 18
6
votes
4 answers
iOS how to correctly handle orientation when capturing video using AVAssetWriter
I am making a sample application that utilizes AVFoundation to record video. The whole point is so I can have more control over how the video is recorded. In my sample project I have the video capturing but am struggling with handling orientation…

miken.mkndev
- 1,821
- 3
- 25
- 39
6
votes
2 answers
Swift Video Resizer AVAsset
I have this code that resizes a video from 1280 x 720 to 640 x 360
But i want a resize with no crop.
Is there a way to do a full resize the don't crop ?
Here's the code
class func resizer(inputURL : NSURL , completion: (outPutURL : NSURL?) -> Void…

unwosu
- 238
- 1
- 3
- 10
6
votes
1 answer
AVAssetWriter continuous segments
I want to record a series of clips that when played together via a video player or ffmpeg -f concat play back seemlessly.
In either scenario right now, I'm getting a very noticeable audio hiccup at each segment join point.
My current strategy is to…

Stefan Kendall
- 66,414
- 68
- 253
- 406
6
votes
1 answer
AVAssetWriterInput - black screen, 46 hours long
I'm trying to take an AVCaptureSession and encode to mp4. It seems like this should be straightforward, and I'm trying to encode a single 960x540 video stream; I'm not worried about audio for the purpose of this issue.
When I run the following code…

Stefan Kendall
- 66,414
- 68
- 253
- 406