Does anyone know if it is possible to separate the audio from a video file such as h.264 encode mpeg (or other such formats) and than save that audio data to a separate file such as an mp3 file? This relates to the iPhone SDK.
Any pointers in the right direction would be much appreciated. Thanks.
Sounds like a job for AVFoundation. I can't tell you the details, but opening a video file into an AVURLAsset
should give you access to its tracks
. Identify the tracks whose mediaType
is AVMediaTypeAudio
.
Not sure about the output part, but I would try creating an AVMutableComposition
object to which I'd then add the tracks you want to export. Then use AVAssetExportSession
or AVAssetWriter
to write the result to a new file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With