Skip to content

Commit

Permalink
1.5.9 #7 Add audio support
Browse files Browse the repository at this point in the history
  • Loading branch information
Datt1994 committed Aug 4, 2020
1 parent fc6d221 commit 3d3df40
Show file tree
Hide file tree
Showing 8 changed files with 159 additions and 72 deletions.
2 changes: 1 addition & 1 deletion DPVideoMerger-Swift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "DPVideoMerger-Swift"
s.version = "1.5.8"
s.version = "1.5.9"
s.summary = "Multiple videos merge in one video with manage scale & aspect ratio and also merge 4 videos to grid layout for Swift."

# This description is used to generate tags and improve search results.
Expand Down
8 changes: 6 additions & 2 deletions DPVideoMerger/DPVideoMerger.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
C63D872A2036B77A00DD8D91 /* 3.MOV in Resources */ = {isa = PBXBuildFile; fileRef = C63D87262036B77A00DD8D91 /* 3.MOV */; };
C63D872B2036B77A00DD8D91 /* 4.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = C63D87272036B77A00DD8D91 /* 4.mp4 */; };
C66392532371B5CF0004BFC8 /* DPVideoMerger.swift in Sources */ = {isa = PBXBuildFile; fileRef = C66392522371B5CF0004BFC8 /* DPVideoMerger.swift */; };
C67CCCE624DA111300846D8D /* file_example_MP3_1MG.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = C67CCCE524DA111300846D8D /* file_example_MP3_1MG.mp3 */; };
C68DDA612034360200789E3C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C68DDA602034360200789E3C /* AppDelegate.swift */; };
C68DDA632034360200789E3C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C68DDA622034360200789E3C /* ViewController.swift */; };
C68DDA662034360200789E3C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C68DDA642034360200789E3C /* Main.storyboard */; };
Expand Down Expand Up @@ -53,6 +54,7 @@
C63D87262036B77A00DD8D91 /* 3.MOV */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = 3.MOV; sourceTree = "<group>"; };
C63D87272036B77A00DD8D91 /* 4.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = 4.mp4; sourceTree = "<group>"; };
C66392522371B5CF0004BFC8 /* DPVideoMerger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DPVideoMerger.swift; sourceTree = "<group>"; };
C67CCCE524DA111300846D8D /* file_example_MP3_1MG.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = file_example_MP3_1MG.mp3; sourceTree = "<group>"; };
C68DDA5D2034360200789E3C /* DPVideoMerger_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DPVideoMerger_Example.app; sourceTree = BUILT_PRODUCTS_DIR; };
C68DDA602034360200789E3C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C68DDA622034360200789E3C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -87,6 +89,7 @@
C63D87232036B77A00DD8D91 /* SampleVideos */ = {
isa = PBXGroup;
children = (
C67CCCE524DA111300846D8D /* file_example_MP3_1MG.mp3 */,
C63D87242036B77A00DD8D91 /* 1.mp4 */,
C63D87252036B77A00DD8D91 /* 2.mp4 */,
C63D87262036B77A00DD8D91 /* 3.MOV */,
Expand Down Expand Up @@ -245,6 +248,7 @@
C63D87292036B77A00DD8D91 /* 2.mp4 in Resources */,
C63D872B2036B77A00DD8D91 /* 4.mp4 in Resources */,
C68DDA6B2034360200789E3C /* LaunchScreen.storyboard in Resources */,
C67CCCE624DA111300846D8D /* file_example_MP3_1MG.mp3 in Resources */,
C63D87282036B77A00DD8D91 /* 1.mp4 in Resources */,
C68DDA682034360200789E3C /* Assets.xcassets in Resources */,
C68DDA662034360200789E3C /* Main.storyboard in Resources */,
Expand Down Expand Up @@ -473,7 +477,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.5.8;
MARKETING_VERSION = 1.5.9;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.datt.DPVideoMerger-Swift";
Expand Down Expand Up @@ -503,7 +507,7 @@
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MARKETING_VERSION = 1.5.8;
MARKETING_VERSION = 1.5.9;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.datt.DPVideoMerger-Swift";
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
Expand Down
Binary file not shown.
210 changes: 144 additions & 66 deletions DPVideoMerger/DPVideoMerger/DPVideoMerger.swift

Large diffs are not rendered by default.

Binary file not shown.
5 changes: 3 additions & 2 deletions DPVideoMerger/Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ class ViewController: UIViewController {
fileURLs.append(url)
}
if fileURLs.count == self.arrIndex.count {
DPVideoMerger().gridMergeVideos(withFileURLs: fileURLs, videoResolution: CGSize(width: 1000, height: 1000),isRepeatVideo: true, videoQuality:AVAssetExportPresetHighestQuality ,completion: {(_ mergedVideoFile: URL?, _ error: Error?) -> Void in
let audioFile = Bundle.main.url(forResource: "file_example_MP3_1MG", withExtension: "mp3")
DPVideoMerger().gridMergeVideos(withFileURLs: fileURLs, audioFileURL: audioFile, videoResolution: CGSize(width: 1000, height: 1000),isRepeatVideo: true, isRepeatAudio: true, videoQuality:AVAssetExportPresetHighestQuality ,completion: {(_ mergedVideoFile: URL?, _ error: Error?) -> Void in
self.activityIndicatorView.stopAnimating()
self.view.isUserInteractionEnabled = true
self.activityIndicatorView.isHidden = true
Expand Down Expand Up @@ -172,7 +173,7 @@ class ViewController: UIViewController {
fileURLs.append(url)
}
if fileURLs.count == self.arrIndex.count {
DPVideoMerger().parallelMergeVideos(withFileURLs: fileURLs, videoResolution: CGSize(width: 1000, height: 900),isRepeatVideo: true, videoQuality:AVAssetExportPresetHighestQuality , alignment: .vertical ,completion: {(_ mergedVideoFile: URL?, _ error: Error?) -> Void in
DPVideoMerger().parallelMergeVideos(withFileURLs: fileURLs, audioFileURL: fileURLs.first, videoResolution: CGSize(width: 1000, height: 900),isRepeatVideo: true, isRepeatAudio: true, videoQuality:AVAssetExportPresetHighestQuality , alignment: .vertical ,completion: {(_ mergedVideoFile: URL?, _ error: Error?) -> Void in
self.activityIndicatorView.stopAnimating()
self.view.isUserInteractionEnabled = true
self.activityIndicatorView.isHidden = true
Expand Down
Binary file modified DPVideoMerger_Swift.framework.zip
Binary file not shown.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ DPVideoMerger().mergeVideos(withFileURLs: fileURLs as! [URL], completion: {(_ me
/// Merge 4 videos to grid layout
/// - Parameters:
/// - videoFileURLs: Video file path URLs, Array of 4 videos that going to grid merge
/// - audioFileURL: Optional audio file for Merged Video
/// - videoResolution: Output video resolution
/// - isRepeatVideo: Repeat Video on grid if one or more video have shorter duartion time then output video duration
/// - isRepeatAudio: Repeat Audio if Merged video have longer duartion time then provided Audio duration
/// - videoDuration: Output video duration (defult: -1, find max duration from provided 4 videos)
/// - videoQuality: AVAssetExportPresetMediumQuality(default) , AVAssetExportPresetLowQuality , AVAssetExportPresetHighestQuality
/// - completion: completion give 2 optional values, 1)mergedVideoURL: URL path of successfully grid merged video 2)error: gives Error object if some error occur in videos merging process
Expand All @@ -133,8 +135,10 @@ DPVideoMerger().gridMergeVideos(withFileURLs: fileURLs, videoResolution: CGSize(
/// Merge side by side videos layout
/// - Parameters:
/// - videoFileURLs: Video file path URLs, Array videos that going to parallel merge
/// - audioFileURL: Optional audio file for Merged Video
/// - videoResolution: Output video resolution
/// - isRepeatVideo: Repeat Video on grid if one or more video have shorter duartion time then output video duration
/// - isRepeatVideo: Repeat Video if one or more video have shorter duartion time then output video duration
/// - isRepeatAudio: Repeat Audio if Merged video have longer duartion time then provided Audio duration
/// - videoDuration: Output video duration (defult: -1, find max duration from provided videos)
/// - videoQuality: AVAssetExportPresetMediumQuality(default) , AVAssetExportPresetLowQuality , AVAssetExportPresetHighestQuality
/// - alignment: Video merge alignment -1) vertical 2) horizontal (defult: vertical)
Expand Down

0 comments on commit 3d3df40

Please sign in to comment.