I am working with an app now that streams data from a web url. I am able to implement the streaming using AVAsset and AVPlayer as its player. Now, what I want to do is to save the streamed bytes from AVAsset to a music file in local. It's basically writing AvAsset to a music file. What I have in mind is converting AVAsset to NSData but I think this one is not possible.
How can I achieve this? Is this possible?
Related
Good day.
Someone knows how to transfer the document url to the avplayer if you want to play the video file through DocumentBrowserView
Using documentUrl did not work for me
How can I save what AVPlayer is currently playing (both video and audio) from Live HLS stream?
I know how to load and play m3u8 video file using AVPlayer.
Please note that the HLS stream is live and not Video on demand so cannot use AVAggregateAssetDownloadTask In the perfect scenario will get CMSampleBuffer objects which can save to file easily. Also AVPlayerItemOutput is not entirely an option because I am unable to see how will get the audio channel.
Seems not possible with the current SDK. I've implemented it using ffmpeg
I use an NSURLConnection to get a media file downloaded. While downloading I store the content at a NEMutableData and write it down to a cache file.
Now I want to play this file while downloading with AVPlayer (Not AVAudioPlayer) because it could be video.
At the time the AVPlayer get the URL to the cache file it looks like the player copy the state of the file because the player don't get any changes and after a few seconds it holds because of the end of data.
Does anybody has a better solution but to download everything first until start playing, or is there a way to give the AVPlayer an Internet NSURL and preload the rest while streaming?
i'm using AFNetworking to download media files. Audio and Video. I use AFDownloadRequestOperation to get a better way to pause and resume large downloads.
i found lots of tutorials for download and for stream media but i need a way to start download and play the unfinished download from disk to get a better experience while playing large files.
does anybody know how to do this?
As Player i use AVPlayer with AVPlayerItem and AVAsset
if there is another way without this 3 Objects it would be great.
I have NSDATA which is recorded through AudioQueue , I want to play this audio through any AUDIO player on IOS, Please help on this.
Thanks
Djrecker
Save it as an audio file (e.g. WAV). AudioFile and ExtAudioFile APIs can help you write this.
You can't expect any audio player on iOS to interpret/guess a blob of sample data correctly. This is why file formats exist -- audio file formats can specify sample count, channel count, sample rate, sample format, and a ton of other information about the audio in the file. Using an audio file, you can exchange this recording in a format other programs are able to read (correctly).