AVMutableComposition and MP4 - Removing Audio Track
I have yet to make heads or tails of this....I'm trying this code but I get nothing. Tried with .mp4 - no dice. Here trying with a .mov - no dice. The files are valid and do play on my ipad. Using the latest iPad OS.
Anybody? Apple's documentation leaves me a little mystified...
You get this working, and post to the forum, and I'll paypal you 200 dollars. It *MUST* work with my mp4 videos on my iPad running 4.2....
All I need to do is remove the audio from a video and then save the result. Forcing the user to do it on their desktop isn't an option...and I can't force online content developers to do it either. So I'm thinking of offering users an option to "batch remove" the audio...so they can "mix" their own with the video when watching. Remember, Apple - in it infinite wisdom - made video intrinsically tied with the System's Audio level.
James A. Brannan
Quote:
Originally Posted by jamesbrannan
I have yet to make heads or tails of this....I'm trying this code but I get nothing. Tried with .mp4 - no dice. Here trying with a .mov - no dice. The files are valid and do play on my ipad. Using the latest iPad OS.
Anybody? Apple's documentation leaves me a little mystified...
I will test this out on Friday. If it works, cool. otherwise I'm just going to disable the audio track on playback. Seems AvFoundation does allow muting a videos audio. Not sure if that will mute an iPod audio resource too by disabling a videos audio track though (stranger things have happened). but, if your right and that is all it was then I'll honor my offer.
James
Quote:
Originally Posted by linkmx
The problem is that AVAssetExportSession is releasing before starting the exporting proccess, if you remove the autorelease like this:
Please note, if the one answer posted works I will honor the offer and will pay the guy, otherwise, note that I figured out what I think is a better solution, which I will post. It seems that AVFoundation can do a heck of a lot, even play a video with the audio track disabled! This was not possible using the media framework. so no answers needed.
James
Quote:
Originally Posted by jamesbrannan
You get this working, and post to the forum, and I'll paypal you 200 dollars. It *MUST* work with my mp4 videos on my iPad running 4.2....
All I need to do is remove the audio from a video and then save the result. Forcing the user to do it on their desktop isn't an option...and I can't force online content developers to do it either. So I'm thinking of offering users an option to "batch remove" the audio...so they can "mix" their own with the video when watching. Remember, Apple - in it infinite wisdom - made video intrinsically tied with the System's Audio level.
Yes, with AVPlayer you can disable the different tracks of a video, so if you want to play just the video without audio you can disable the audio tracks.
Yes, with AVPlayer you can disable the different tracks of a video, so if you want to play just the video without audio you can disable the audio tracks.
You sir are the proud recipient of 200 paypal. I'll send you an offline message to get your info. Lest someone ridicules me...remember, development is expensive...I recognize the value of a timely answer. I was so caught up in it not working, I overlooked the most basic of error...
However, I am RTFMing the AVFoundation stuff, and I'm thinking I'm going to remove the audio track instead and use it for playing. Besides, its got all this time-based stuff that I could use with a future API of the device that I'm working with. linkmx, I reserve the right to ask you one or two question on the playback if I need too, cool?
Here's the code that works....not production quality, no error handling etc. This AVFoundation stuff is cool. BTW, there are two WWDC10 videos on it that you can access via Apple Developer Connection. I'll post stuff on my playback as I get it done/working, as there is not much info on this, and a TON of posts on the web that predate 4.0 that basically say "mute a video, can't do it...."
I should mention, though, this is *very* slow as the file size gets large, I suppose as would be expected. But see my other thread, simply setting enabled to false for the audio track is *very* quick and easy.
Quote:
Originally Posted by jamesbrannan
Here's the code that works....not production quality, no error handling etc. This AVFoundation stuff is cool. BTW, there are two WWDC10 videos on it that you can access via Apple Developer Connection. I'll post stuff on my playback as I get it done/working, as there is not much info on this, and a TON of posts on the web that predate 4.0 that basically say "mute a video, can't do it...."
I should mention, though, this is *very* slow as the file size gets large, I suppose as would be expected. But see my other thread, simply setting enabled to false for the audio track is *very* quick and easy.
James, i set enabled to false, but it still can play the audio.