3 2 | I would like to, depending on the device and the settings in my application, transcode a video to a specific video format. For an example, if the user has an iPhone 4S and chooses medium settings in my application I would like to convert the video to 540p before I start processing. If he chooses high then I would like to transcode to 720p. I could read the video frame by frame, resize and save to disc but this does not seem very effective. What would be the easiest and fastest way to transcode a video that I can feed to my video processing libraries? I have tried using the videoQuality settings on my UIImagePickerController but seems like it is not working as even when I set it to UIImagePickerControllerQualityTypeIFrame960x540 my video comes out as 720p (640x480 is working but I need to be more granular). | ||||||||
|
2 | You might want to look at AVAssetExportSession, which makes it reasonably simple to re-encode videos. I think it's also hardware-supported when possible like the rest of AVFoundation: Note that it will never make the video larger than it already is, so you aren't guaranteed to get the output size you request. The following code might be a start for what you want, assuming you have an instance of ALAsset:
You would want to pass a quality of AVAssetExportPreset960x540 for 540p and AVAssetExportPreset1280x720 for 720p, for example. | ||||||||||||||||
|
'iPhone dev.' 카테고리의 다른 글
In-app purchase 정리 (1) | 2014.12.14 |
---|---|
UIImage 방향 바꾸기 (0) | 2013.01.10 |
아이폰 빈 공간(사용량) 구하기 (0) | 2012.12.01 |
UIButton 이미지 비율 조절하기 (0) | 2012.12.01 |
아이폰 3GS/4/4S와 5 화면 구분하기 (0) | 2012.11.15 |