How can I extract the audio from a mp4 video in bytes format (so, in memory) in flutter? (I want to save it as mp3 file). All the references I can find online using ffmpeg retrieve the file from storage, but I have the file in bytes in memory and don't want to save the file into storage just for the conversion.
Thank you.
Related
I have downloaded the bytes of a movie and stored them in a database.
I need a way to convert it back to a movie to give it to the video_player package to play.
How to convert it without creating a file?
I don't want my users to access the video files.
i will like to convert itunes music files in to a low bandwidth PCM for uploading.
How to convert m4a file to aac adts file in Xcode?
Real-time converting the PCM buffer to AAC data for iOS using Remote IO and Audio Convert Service
iOS: Create an MP3 on device
i saw a few threads but not too sure how do i go about it. Could anyone provide me a tutorial link please ?
any comment are greatly appreciated.
The easiest way to convert your audio files is by using the EXTAudioFileConvert API from Apple.
Tutorial on using the EXTAudioFileConvert can be found at: Easy AAC compressed audio conversion on iOS.
I am working on a project that requires me to send raw headerless ulaw or linear pcm data to a server.
I am using the AVAudioRecorder and I can save out audio files to the phone quite easily, but the problem is that it no matter what I try and do, they get wrapped in a caf file or stamped with some kind of header.
It's my understanding that a caf file is just a wrapper file for raw audio data and that this audio data can be in various formats including linear pcm and ulaw.
So my questions are, how can I generate a raw audio file without the caf wrapper to begin with (ie just the headerless raw audio stuffed into a file) or if I record a caf that contains the raw Ulaw or linear pcm audio data, how can I easily go in and extract just the raw audio data from the caf file and leave everything else behind.
If the audio data in the CAF is already in the format you need it in, I'd use the AudioFile API to grab the caf file's audio data and write them to a headerless/RAW file before uploading to my server.
If you need to convert the CAF's data, use the ExtAudioFile API instead. Either way, pretty straightforward.
http://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/AudioFileConvertRef/Reference/reference.html
http://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/ExtendedAudioFileServicesReference/Reference/reference.html
If you use the Audio Queue API for recording, instead of AVAudioRecorder, you will have access to raw PCM sample buffers, and can write those out to a flat file for later sending to your server.
Are there any easy solutions for saving a number of images into a video file in iOS?
Example: I have 300 frames all saved as separate images and want to turn them into a single video file (e.g., mp4) that a user could email or post on YouTube.
No support in iOS, you may have to use open source libraries such as ffmpeg.
I have some music that loops. The .wav file size is about 8 meg. I load this and just loop it... everything was working fine until I added another 4 meg .wav file. Now the game crashes... removing the additional audio file fixed the crashing.
So how can I reduce the size of these .wav files? I thought about releasing the memory after I'm done with the 4 meg file but what I tried didn't work (and I'd rather the game itself be a smaller file size so it's easier to download).
Thanks!
If you're only playing one sound file at a time, just use mp3 or aac. That way you also get hardware decoding, for improved performance and battery life.
Unfortunately, the iPhone can only play one hardware decoded sound file at a time. So if you're looking to ever play more than one at once, you'll need to do your own decoding of the second file; IMA 4:1 is recommended, though you'll have to find or implement your own decoder, Apple doesn't give you one.
This is all based off of this blog post, which goes into a bit more detail.
Actually .WAV is a container. The contents can be compressed or uncompressed, it all depends on the WAVEFORMATEX structure contained in the first "fmt " tag in the .WAV file.
For instance, in Windows 7 all of the built-in sounds are .WAV files that contain MP3 data.
You can just author your .WAV files as MP3 files and (assuming that the iPhone correctly handles the .WAV container) they should work.
Wav in a uncompressed format will inevitably take up tons of space. 8 Megs is not really big for an uncompressed wav.
You should consider an alternate, compressed format such as mp3 or aac. You might need to link in a decoding library though.
Check out this link on including mp3 files in your iphone app:
If your WAV files are stereo, you could try making them mono. This would basically half the file size. The disadvantage would obviously be that your sound is now mono.
I wouldn't use WAV. Take a look at ffmpegx. It's free, runs on the mac and will convert your waves files to MP3 or a host of other formats.