I run the export on the simulator and everything works great. I run it on the device and the video gets exported but there's no audio. This leads me to believe that I must be using an audio format that the device doesn't support but OS X does, as the simulator uses what OS X uses. I've tried m4a, aiff, and aifc and have had no luck! Any ideas??
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
I have a very similar problem. It does not seem to do with codecs, as I made a separate test case that runs fine with the same video. There’s a related question that says the problem might be in playing the same assets using
MPMoviePlayerController
. That got me on the right track (sort of).In my case the trouble stem from using the assets in an
AVPlayer
during the export. I was not able to find the exact combination that causes the export to drop the audio track – in the separate test project the export runs fine even though the asset plays inAVPlayer
at the same time. After several hours of trying to find the exact cause I gave up and simply popped the asset out of the player usingreplaceCurrentItemWithPlayerItem:nil
during export. It’s a hack, but it works.AVFoundation
is a very powerful framework, but God I wish it wasn’t so finicky or at least logged more errors instead of silently producing garbage.