97
questions
0
votes
1
answer
31
views
Reading remote audio file using AVAssetReader aborts
I have a iOS app that tries to read an audio file using an AVAssetReader from a remote server. However the AVAssetReader never gets created, during creation it throws an error "Process aborted&...
1
vote
1
answer
716
views
How to apply Vision Framework to Video Playback
I only found examples mainly using the live camera capture to apply the vision framework, which I already have working. I also want to apply the body pose detection and drawing upon video playback. I ...
1
vote
0
answers
247
views
Is there any function to extract all the frames of a video that is downloaded and picked from Documents Directory in iOS Swift?
I am trying to extract all the frames from a video. Code is working fine for the video in Bundle Path, but it fails when i give a link of the video or I try to pick the video from File Manager.
...
0
votes
0
answers
194
views
Force GPU usage with copying video sample buffers via AVAssetReader/AVSampleBufferDisplayLayer
I am looping 1 second mp4/h264 videos with no audio on an M1 Mac Mini. AVPlayer was causing hitches with scrolling.
Now I read videos using AVAssetReader and feed those CMSampleBuffers into a ...
0
votes
0
answers
169
views
Re-encode Any Arbitrary Video File to a Single Standardized FPS, Resolution, Rotation, etc
What would be the simplest approach to re-encoding arbitrary video files chosen from a user's photo library on their iPhone to match desired parameters? Namely: 720p (aspect fill), portrait (with no ...
0
votes
1
answer
194
views
How to add a callback to AVAssetReader copyNextSampleBuffer?
I am trying to read audio frames and decode them with AVAssetReader. I want to be able to read the frames asynchronously and add some kind of callback when a sample buffer was read. So after calling:
....
1
vote
1
answer
622
views
AVAssetReader fails to initialise?
I am trying to export iCloud assets through AVAssetReader and AVAssetWriter but AVAssetReader fails to initialise using that asset. All other videos are working fine. Only iCloud shared album videos ...
1
vote
1
answer
1k
views
Using AVAssetReader and copyNextSampleBuffer without polling
I am using AVAssetReader to read audio data from a file, on a secondary thread. Every code example I have seen has at the heart of it a loop like this:
while (assetReader.status == ...
2
votes
1
answer
603
views
AVAssetWriter fails only in iOS when writing audio from specific videos
I have a sample project for resizing videos that works well for most videos. However, AVAssetWriter fails to write the audio from specific videos with the error:
Error Domain=AVFoundationErrorDomain
...
1
vote
0
answers
133
views
kCMSampleBufferAttachmentKey_TrimDurationAtStart crash
I have the following function that takes a url of an existing video file and compresses it into an output file. I am using Avasset Reader and writter.
var assetReader:AVAssetReader?
var assetWriter:...
1
vote
1
answer
802
views
First audio CMSampleBuffer lost when reading mp4 file using AVAssetReader
I'm using AVAssetWriter to write audio CMSampleBuffer to an mp4 file, but when I later read that file using AVAssetReader, it seems to be missing the initial chunk of data.
Here's the debug ...
0
votes
0
answers
507
views
AVVideoComposition fails while trying to read video frame
I have a source video and I want to generate a new video from it by taking a region of each frame of the source video. For example, if I have a video with resolution A x B, a content size of X x Y and ...
0
votes
2
answers
7k
views
How to make waveform for my recorded audio?
I am using AVFoundation to record audio with the setting below.
After recording successfully, I need to show the waveform of the recorded file to the user. Can anyone help me with this task?
Here is ...
2
votes
1
answer
2k
views
AVAssetReader, how to use with a stream rather than a file?
AVAssetReader is fantastic, but I can only see how to use it with a local asset, a file, or I guess a composition,
So,
assetReader = try AVAssetReader(asset: self.asset)
...
assetReader.addOutput(...
1
vote
1
answer
1k
views
After compressing my audio file, why can I not play the file?
Audio file will not play after reducing it using AVAssetReader/ AVAssetWriter
At the moment, the whole function is being executed fine, with no errors thrown.
For some reason, when I go inside the ...
0
votes
1
answer
292
views
compressing Video Error: Terminated due to memory issue
I want to first trimming video that choose from photoLibrary, and then compress video file for custom size and bitrate. I'm using PryntTrimmerView for Trimming video, and then use trimmed video for ...
3
votes
1
answer
729
views
How does one obtain image buffers in their original format from a video stream using AVFoundation?
In Apple's documentation for AVAssetReaderTrackOutput, it indicates the following about the parameter for outputSettings when instantiating an instance using +[AVAssetReaderTrackOutput ...
0
votes
0
answers
188
views
How to export .aac file using AVAssetReader?
I'm using SDAVAssetExportSession to convert MPMedaiItem to .m4a file and it's working great.
Link : Here
This is my code, end result will be .m4a file, when in pass fileName as 1.aac this code not ...
4
votes
1
answer
1k
views
When reading frames from a video on an iPad with AVAssetReader, the images are not properly oriented
A few things I want to establish first:
This works properly on multiple iPhones (iOS 10.3 & 11.x)
This works properly on any iPad simulator (iOS 11.x)
What I am left with is a situation where ...
2
votes
1
answer
2k
views
AVAssetReader trouble getting pixel buffer from copyNextSampleBuffer(), Swift
I'm trying to read the image frames from a Quicktime movie file using AVFoundation and AVAssetReader on macOSX. I want to display the frames via a texture map in Metal. There are many examples of ...
6
votes
1
answer
2k
views
How to get the timestamp of each video frame in iOS while decoding a video.mp4
Scenario:
I am writing an iOS app to try decode a videoFile.mp4. I am using AVAssetReaderTrackOutput with AVAssetReader to decode frames from the video file. This works very well. I get each & ...
1
vote
0
answers
466
views
AVAssetReader , call method " startReading " fail ,return NO, Error Domain=AVFoundationErrorDomain Code=-11841 (AVErrorInvalidVideoComposition)
I read a MP4 video, frame by frame, so I use AVAssetReader , it always work ok, but 1/100 probability fail in "startReading" method. Error Domain=AVFoundationErrorDomain Code=-11841 (...
2
votes
0
answers
562
views
AVFoundation decode prores4444 movie with alpha channel
I'm trying to decode a prores4444 video with alpha channel on iOS with Swift to overlay as a complex animation over a user video and to export it to his library. The AVFoundation documentation is not ...
11
votes
2
answers
1k
views
Sample accurate extraction of chunks of audio using AVFoundation
Problem
I am looking to extract sample-accurate ranges of LPCM audio from audio tracks within video files. Currently, I'm looking to achieve this using AVAssetReaderTrackOutput against an AVAssetTrack ...
4
votes
1
answer
1k
views
How to read a timecode track with AVAsset and Swift 3?
I'd like to read the time value of a timecode track. There is an
excellent documentation from Apple (see Technical Note 2310)
but it's written in Objective C.
I have translated the core logic to ...
1
vote
0
answers
319
views
AVAssetReader failing when entering foreground again
In my app I'm processing videos with a AVAssetReader → AVAssetWriter combination.
When the app is sent to the background, I pause the video writing (and thus also don't read any longer). When ...
4
votes
0
answers
772
views
copyNextSampleBuffer returns NULL when reading two-video-track movie second time
I have a movie with two video tracks. I need to read frames from the two tracks interleaved - that is, one frame from track 1, then one frame from track 2, then from track 1 and so on.
I'm using an ...
0
votes
0
answers
248
views
Reading multiple video files using "AVAssetReaderTrackOutput" simultaneously freaks out OSX
I need to read all frames from three short video files (3min each) into the memory (NSArray of CMSampleBufferRef).
I used typical approach with AVAsset, AVAssetReader, AVAssetReaderTrackOutput and ...
1
vote
0
answers
571
views
AVAssetReader - Can not decode MOV
I am trying to get an array of frames from a video.
Here is my code:
var frames = [UIImage]()
let url = NSBundle.mainBundle().URLForResource(name, withExtension: ext, ...
3
votes
0
answers
282
views
iOS how to insert background for an existing video
I need to make a background for an existing video. The background should be a pre-provided image (png type).
Summary, I have an existing video and an existing image. How can I make the image as the ...
2
votes
1
answer
367
views
Coping CMSampleBufferRef to array causes crash
I want to change the order of movie frames and then write them back to new video file. It would be much easier for me to have them all in array, but process of coping buffer samples to array causes ...
1
vote
0
answers
501
views
How to decode m4a to PCM using AVFoundation's AVAsetReader
Trying to convert M4A to PCM goes well in the start.
i am able to convert and read the bytes.
however i am not sure if this is the correct way to do this.
as i am getting 16384 bytes when i try to ...
2
votes
1
answer
1k
views
AVAssetReaderOutput memory issue
I am using AVAssetReaderOutput (more specifically AVAssetReaderTrackOutput) to process video on a frame by frame basis. I get successive frames of the video using the copyNextSampleBuffer() method. I ...
0
votes
2
answers
102
views
How to merge a video,uiimage and a uiwebview in a video formate in objective c to share in social media website?
I need to merge a video,UIImage and a UIWebView in a video format in Objective-C to share in social media website. I tried AVAssetWriter but could not implement it properly. I have shown video in my ...
1
vote
1
answer
657
views
iOS - Trimming mp4 on device
I thought I might be able to use an AVAssetReader/Writer to trim an MP4, but when I attempt to read the audio (haven't tried video yet), I get this:
AVAssetReaderOutput does not currently support ...
4
votes
1
answer
633
views
AVAssetReader/AVAssetWriter preview of current frame
I'm using AVAssetReader/AVAssetWriter to convert my video on iOS.
My question is: what's the most efficient way to show preview of current frame with real time conversion.
I was thinking about ...
7
votes
1
answer
2k
views
Swift 2 : AVAssetReader and NSInputStream Audio Graph
I'm trying to convert an example from Bob McCune's Learning AVFoundation book and having some issues using AVAssetReader and NSInputStream. The graph should be a pure sine wave but the values seem ...
8
votes
1
answer
954
views
Getting value from unSafeMutablePointer Int16 in Swift for audio data purposes
I'm working to convert to Swift this code which helps get me get audio data for visualizations. The code I'm working with in Obj C, which works well, is:
while (reader.status == ...
1
vote
1
answer
2k
views
Read AVAsset into frames and compile back to video
everyone! The idea in my project is to gather a video, split it into frames, then apply specific effect frame by frame(not the topic) and then compile everything back.
Using following code I am able ...
1
vote
0
answers
680
views
MAC - AVAssetReader for TRIM - reading samples OUT OF ORDER
I am trying to read and write the samples from a video file at a specific start point and end point for trimming a video. I am using AVAssetReader and AVAssetWriter.
The logic used here is -
STEP A:...
1
vote
1
answer
580
views
How to decode multiple videos simultaneously using AVAssetReader?
I'm trying to decode frames from multiple video files, and use them as opengl texture.
I know how to decode a h264 file using AVAssetReader object, but it seems you have to read the frames after you ...
0
votes
0
answers
292
views
How read fragmented media data in iOS
I have developed an iOS application which can records videos for long durations , i have used AVCaptureSesssion to use recording
But now i want to split recorded media data according to timestamp ...
4
votes
2
answers
5k
views
AVAsset not recognising NSURL - Crashing - iOS
I am making an iOS app. One of its features is that it can save record and save audio files.
In order to save the URL's of the recorded audio files, I storing them in NSUserDefaults as filePaths like ...
1
vote
1
answer
2k
views
Using AVAssetWriter and AVAssetReader for Audio Recording and Playback
My app uses AVAssetReader to play songs in the iPOD library. Now I want to add the audio recording capability.
I recorded audio using AVAssetWriter. I checked the resulting audio file(MPEG4AAC ...
1
vote
1
answer
546
views
Getting Exc_Bad_access in AVAssetReader
I am getting Exc_bad_Access exception while reading a file with AVAssetReader .
The File is located in document directory and is in m4a format. Here is the code i am using. Not able to figure out ...
1
vote
1
answer
3k
views
Get a particular frame by time value using AVAssetReader
I have checked this http://www.7twenty7.com/blog/2010/11/video-processing-with-av-foundation to get a video frame by frame. But my real requirement is to get a frame at particular time. I know that it ...
0
votes
1
answer
587
views
Strange data in PCM Samples from AVAssetReader
I'm extracting samples from music on an iOS device, using an AVAssetReader. Near the end of each track, I encounter some odd data:
18834289801492731920107175936.000000(0x6e736d70)
somesample
...
7
votes
1
answer
2k
views
AVfoundation Reverse Video
I tried to make video in reverse. While playing asset in AVPlayer i set the rate = -1 to make it work in reverse format. But how to export that video? I looked into docs. read about avassetwrite, ...
0
votes
1
answer
178
views
Implementing fast-forward with AVAssetReaderOutput
I’m trying to add a fast-forward functionality in my app, which heavily uses GPUImage, but am running into some memory issues.
At the top of -[GPUImageMovie readNextVideoFrameFromOutput:], I replace ...
0
votes
1
answer
753
views
CMSampleBufferRef and AVAssetReaderMixAudioOutput and PCM problems
So I am using a AVAssetReaderMixAudioOutput to extract audio samples from a quicktime file.
In this case it is a ProRes video with multiple tracks of audio.
(4 track, 16bit, interleaved samples ...