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
5
votes
3 answers
CMSampleBuffer from OpenGL for video output with AVAssestWritter
I need to get a CMSampleBuffer for the OpenGL frame. I'm using this:
int s = 1;
UIScreen * screen = [UIScreen mainScreen];
if ([screen respondsToSelector:@selector(scale)]){
s = (int)[screen scale];
}
…

Matthew Mitchell
- 5,293
- 14
- 70
- 122
5
votes
2 answers
Output Video Size Huge Using HEVC Encoder on iOS
I have a project that currently uses the H.264 encoder to record video on iOS. I wanted to try using the new HEVC encoder in iOS 11 to reduce file sizes, but have found that using the HEVC encoder causes file sizes to balloon enormously. Here's a…

jpetrichsr
- 247
- 2
- 11
5
votes
2 answers
Issue with AVAssetWriter Input: MPEG4
I am compressing videos with AVAssetWriter. If i set the video compression file to Quicktime movie it works fine, however i would like to export it to MPEG4, but it gives me this error while running:
In order to perform passthrough to file type…

Kyle Gustov
- 89
- 9
5
votes
0 answers
AVAssetWriter - How do I get a byte count of what has been written?
I am writing a MOV file, in which I am supplying a bunch of CMSampleBuffers to pass along to an AVAssetWriterInput object.
While this is going on, I am tracking the byte size of the compressed data inside the CMSampleBuffers to write to a log file…

Bob-GlueTools
- 117
- 7
5
votes
0 answers
How to convert CMSampleBufferRef(audio +video) to a video file(.mp4 or .mov) using AVAssetWriter every 10 seconds in iOS?
I am using AVFoundation's AVCaptureSession to capture video for live streaming ( to send to the server using RTMP protocol).
The callback delegate methods of AVCaptureVideoDataOutputSampleBufferDelegate and…

abhimuralidharan
- 5,752
- 5
- 46
- 70
5
votes
1 answer
What does a CMSampleBuffer's sample presentation time represent?
Our app is using AVFoundation to capture video, display, manipulate, and export the video using its sample buffers. I am trying to understand what the CMSampleBufferGetPresentationTimeStamp(_:) CMTime actually represents.
For example, when video…

Ivan Lesko
- 1,274
- 13
- 26
5
votes
2 answers
Recording gapless audio with AVAssetWriter
I'm trying to record segments of audio and recombine them without producing a gap in audio.
The eventual goal is to also have video, but I've found that audio itself creates gaps when combined with ffmpeg -f concat -i list.txt -c copy out.mp4
If I…

Stefan Kendall
- 66,414
- 68
- 253
- 406
5
votes
0 answers
AVAssetWriter - Max supported resolution for each device
the title says it, I want to know the max resolution for each device before I start encoding a video and getting an error.
I was thinking if there is something like the AVCaptureDevice supportsAVCaptureSessionPreset: .. but for regular encoding…

Eph Bee
- 265
- 1
- 13
5
votes
1 answer
How to convert AudioBufferList to CMSampleBuffer?
I have an AudioTapProcessor attached to AVPlayerItem.
which will call
static void tap_ProcessCallback(MTAudioProcessingTapRef tap, CMItemCount numberFrames, MTAudioProcessingTapFlags flags, AudioBufferList *bufferListInOut, CMItemCount…

Alex Chan
- 1,116
- 3
- 15
- 33
5
votes
4 answers
iOS reverse audio through AVAssetWriter
I'm trying to reverse audio in iOS with AVAsset and AVAssetWriter.
The following code is working, but the output file is shorter than input.
For example, input file has 1:59 duration, but output 1:50 with the same audio content.
-…

Sasha
- 764
- 1
- 13
- 21
5
votes
1 answer
iphone iOS : [AVAssetWriterInput appendSampleBuffer:] Cannot call method when status is 0
I am trying to append CMSampleBufferRefs to an AVAssetWriterInput and I keep getting a crash with error:
[AVAssetWriterInput appendSampleBuffer:] Cannot call method when status is 0
Code:
in viewDidLoad
NSArray *cachePaths =…

Zigglzworth
- 6,645
- 9
- 68
- 107
5
votes
1 answer
AVAssetWriter goes AVAssetWriterStatusFailed after appendSampleBuffer:
I am trying to perform screen-recording using AVAssetWriter, which also accepts audio input. However, I have been stuck on this error, where AVAssetWriter sometimes becomes AVAssetWriterStatusFailed after a few calls on appendSampleBuffer: (inside…

Ayrkrane
- 51
- 3
5
votes
2 answers
Music convert and how to know if writing are completed
i had to convert big file size song from iTunes library to a smaller 8K song file.
As i did the converting async, the bool always return true even though writing to doc folder are not completed. At the moment i'm using a delay of 10sec before i…

Desmond
- 5,001
- 14
- 56
- 115
5
votes
0 answers
GPUImageMovieWriter - crashing with "Cannot call method when status is 2"
Trying to get started with the really great GPUImage framework so graciously shared by Brad Larson, but having an issue.
When running the SimpleVideoFileFilter sample it always crashes at completion with the following error:
[AVAssetWriterInput…

tiltem
- 4,952
- 3
- 23
- 26
5
votes
0 answers
how to add fade in/out effect in avassetwriter (img to video) in iphone
I'm creating a .mov from the array of images with audio using avassetwriter and i want to add the fade in/out effect in the creating video, have anyone used any code? Thanks in advance for any help!
...
for(UIImage * img in imageArray)
{
…

BADRI
- 643
- 8
- 26