Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Multiple videos merge in one video with manage scale & aspect ratio and also merge 4 videos to grid layou for Objective C.

License

NotificationsYou must be signed in to change notification settings

Datt1994/DPVideoMerger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

For Swift and new features :-DPVideoMerger-Swift

Installation with CocoaPods

CocoaPods is a dependency manager for Objective-C. You can install it with the following command:

$ gem install cocoapods

Podfile

To integrate DPVideoMerger into your Xcode project using CocoaPods, specify it in yourPodfile:

source'https://github.com/CocoaPods/Specs.git'platform:ios,'8.0'target'TargetName'dopod'DPVideoMerger'end

Then, run the following command:

$ pod install

Add Manually

Download Project and copy-pasteDPVideoMerger.h &DPVideoMerger.m files into your project

Usage

    #import"DPVideoMerger.h"    #import<AVKit/AVKit.h>    #import<AVFoundation/AVFoundation.h>NSString *filePath = [[NSBundlemainBundle]pathForResource:@"1"ofType:@"mp4"];NSURL *fileURL = [NSURLfileURLWithPath:filePath];NSString *filePath1 = [[NSBundlemainBundle]pathForResource:@"2"ofType:@"mp4"];NSURL *fileURL1 = [NSURLfileURLWithPath:filePath1];NSString *filePath2 = [[NSBundlemainBundle]pathForResource:@"3"ofType:@"MOV"];NSURL *fileURL2 = [NSURLfileURLWithPath:filePath2];NSString *filePath3 = [[NSBundlemainBundle]pathForResource:@"4"ofType:@"mp4"];NSURL *fileURL3 = [NSURLfileURLWithPath:filePath3];NSArray *fileURLs = @[fileURL, fileURL1,fileURL2,fileURL3];        [DPVideoMergermergeVideosWithFileURLs:fileURLscompletion:^(NSURL *mergedVideoFile,NSError *error) {if (error) {NSString *errorMessage = [NSStringstringWithFormat:@"Could not merge videos:%@", [errorlocalizedDescription]];            UIAlertController *alert = [UIAlertControlleralertControllerWithTitle:@"Error"message:errorMessagepreferredStyle:UIAlertControllerStyleAlert];            [selfpresentViewController:alertanimated:YEScompletion:nil];return;        }                AVPlayerViewController *objAVPlayerVC = [[AVPlayerViewControlleralloc]init];        objAVPlayerVC.player = [AVPlayerplayerWithURL:mergedVideoFile];        [selfpresentViewController:objAVPlayerVCanimated:YEScompletion:^{            [objAVPlayerVC.playerplay];        }];    }];        [DPVideoMergergridMergeVideosWithFileURLs:fileURLsandVideoResolution:CGSizeMake(2000,2000)andRepeatVideo:truecompletion:^(NSURL *mergedVideoURL,NSError *error) {if (error) {NSString *errorMessage = [NSStringstringWithFormat:@"Could not merge videos:%@", [errorlocalizedDescription]];            UIAlertController *alert = [UIAlertControlleralertControllerWithTitle:@"Error"message:errorMessagepreferredStyle:UIAlertControllerStyleAlert];            [alertaddAction:[UIAlertActionactionWithTitle:@"OK"style:UIAlertActionStyleDefaulthandler:^(UIAlertAction * _Nonnull action) {}]];            [selfpresentViewController:alertanimated:YEScompletion:nil];return;        }                AVPlayerViewController *objAVPlayerVC = [[AVPlayerViewControlleralloc]init];        objAVPlayerVC.player = [AVPlayerplayerWithURL:mergedVideoURL];        [selfpresentViewController:objAVPlayerVCanimated:YEScompletion:^{            [objAVPlayerVC.playerplay];        }];    }];

About

Multiple videos merge in one video with manage scale & aspect ratio and also merge 4 videos to grid layou for Objective C.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp