0
嗨发现很多很多的视频编码的链接通过的ffmpeg 1,2,3,4等,但他们都开始使用终端的命令,但是当我试图实现像终端的任何:FFMPEG为iPhone录制的视频编码
git clone git://github.com/lajos/iFrameExtractor.git
it says that
-bash:git:command not found。
也据我所知,它不可能在iPhone上使用终端命令。任何人都可以指出如何编码通过ffmpeg格式录制的视频,并且还可以缩小视频的大小?提前致谢。
编辑: 我已经实现这个方法来调整我的视频的大小,它成功地发生,我能够发送服务器上的视频,但然后在服务器端它给检索数据和使用它的问题。
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
[self convertVideoToLowQuailtyWithInputURL:videoURL1 outputURL:[NSURL fileURLWithPath:videoStoragePath] handler:^(AVAssetExportSession *exportSession)
{
if (exportSession.status == AVAssetExportSessionStatusCompleted)
{
NSLog(@"%@",exportSession.error);
printf("completed\n");
}
else
{
NSLog(@"%@",exportSession.error);
printf("error\n");
}
}];
}
- (void)convertVideoToLowQuailtyWithInputURL:(NSURL*)inputURL
outputURL:(NSURL*)outputURL
handler:(void (^)(AVAssetExportSession*))handler
{
[[NSFileManager defaultManager] removeItemAtURL:outputURL error:nil];
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:inputURL options:nil];
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetLowQuality];
exportSession.outputURL = outputURL;
exportSession.outputFileType = AVFileTypeQuickTimeMovie;
[exportSession exportAsynchronouslyWithCompletionHandler:^(void)
{
handler(exportSession);
[exportSession release];
}];
}
感谢Tornado.I使用uiimagepicker在我的应用程序中录制视频,现在我想将其转换为mp4格式并将其发送到服务器上。 AVFoundation框架是一个很好的选择吗?它实际上不会让我选择看看我在录制什么。我该怎么做? – Sarah 2011-12-16 07:05:06