{"id":23082560,"url":"https://github.com/datt1994/dpvideomerger-swift","last_synced_at":"2025-06-13T07:04:23.195Z","repository":{"id":54191105,"uuid":"121722602","full_name":"Datt1994/DPVideoMerger-Swift","owner":"Datt1994","description":"Multiple videos merge in one video with manage scale \u0026 aspect ratio and also merge videos to grid matrix layout for Swift.","archived":false,"fork":false,"pushed_at":"2022-08-16T12:53:20.000Z","size":18529,"stargazers_count":65,"open_issues_count":5,"forks_count":20,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-13T07:02:52.462Z","etag":null,"topics":["carthage","cocoapods","dpvideomerger-swift","grid","grid-layout","ios","matrix","merge-videos","merger","merging","swift","swift5","video","video-merge","video-merger","videos","xcode"],"latest_commit_sha":null,"homepage":"https://datt1994.github.io/DPVideoMerger-Swift/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Datt1994.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-16T06:51:22.000Z","updated_at":"2025-06-04T11:29:01.000Z","dependencies_parsed_at":"2022-08-13T08:50:23.484Z","dependency_job_id":null,"html_url":"https://github.com/Datt1994/DPVideoMerger-Swift","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/Datt1994/DPVideoMerger-Swift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPVideoMerger-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPVideoMerger-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPVideoMerger-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPVideoMerger-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Datt1994","download_url":"https://codeload.github.com/Datt1994/DPVideoMerger-Swift/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPVideoMerger-Swift/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259599321,"owners_count":22882353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","cocoapods","dpvideomerger-swift","grid","grid-layout","ios","matrix","merge-videos","merger","merging","swift","swift5","video","video-merge","video-merger","videos","xcode"],"created_at":"2024-12-16T14:54:53.233Z","updated_at":"2025-06-13T07:04:23.122Z","avatar_url":"https://github.com/Datt1994.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DPVideoMerger-Swift\n\n[![Platform](https://img.shields.io/cocoapods/p/DPVideoMerger-Swift.svg?style=flat)](http://cocoapods.org/pods/DPVideoMerger-Swift)\n[![Language: Swift 5](https://img.shields.io/badge/language-swift5-f48041.svg?style=flat)](https://developer.apple.com/swift)\n[![License](https://img.shields.io/cocoapods/l/DPVideoMerger-Swift.svg?style=flat)](https://github.com/Datt1994/DPVideoMerger-Swift/blob/master/LICENSE)\n[![Version](https://img.shields.io/cocoapods/v/DPVideoMerger-Swift.svg?style=flat)](http://cocoapods.org/pods/DPVideoMerger-Swift)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n| Sequence | Parallel | Grid |\n| --- | --- | --- |\n| ![Sequence](https://user-images.githubusercontent.com/19645535/109975106-4978a180-7d20-11eb-92b7-4d19ba2f3df0.gif) | ![Parallel](https://user-images.githubusercontent.com/19645535/109975267-7af16d00-7d20-11eb-9ba2-c52fbdf1ade8.gif) | ![Grid](https://user-images.githubusercontent.com/19645535/109975324-8a70b600-7d20-11eb-9d81-3679e8dbd31b.gif) |\n\n\n## Installation with CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C \u0026 Swift. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n#### Podfile\n\nTo integrate DPVideoMerger into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '9.0'\n\ntarget 'TargetName' do\nuse_frameworks!\npod 'DPVideoMerger-Swift'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n## Installation with Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate `DPVideoMerger-Swift` into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"Datt1994/DPVideoMerger-Swift\"\n```\n\nRun `carthage` to build the framework and drag the framework (`DPVideoMerger_Swift.framework`) into your Xcode project.\n\n\n## Installation with Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nTo add the library as package dependency to your Xcode project, select File \u003e Swift Packages \u003e Add Package Dependency and enter its repository URL `https://github.com/Datt1994/DPVideoMerger-Swift.git`\n\n\n## Add Manually \n  \n  Download Project and copy-paste `DPVideoMerger.swift` file into your project \n\n## Usage \n\n```swift\nimport AVKit\n\nlet fileURL = Bundle.main.url(forResource: \"1\", withExtension: \"mp4\")\nlet fileURL1 = Bundle.main.url(forResource: \"2\", withExtension: \"mp4\")\nlet fileURL2 = Bundle.main.url(forResource: \"3\", withExtension: \"MOV\")\nlet fileURL3 = Bundle.main.url(forResource: \"4\", withExtension: \"mp4\")\nlet fileURLs = [fileURL, fileURL1, fileURL2, fileURL3]\n\n\n/// Multiple videos merge in one video with manage scale \u0026 aspect ratio\n/// - Parameters:\n///   - videoFileURLs: Video file path URLs, Array of videos that going to merge\n///   - videoResolution: Output video resolution, (defult:  CGSize(width: -1, height: -1), find max width and height from provided videos)\n///   - videoQuality: AVAssetExportPresetMediumQuality(default) , AVAssetExportPresetLowQuality , AVAssetExportPresetHighestQuality\n///   - completion: Completion give  2 optional  values, 1)mergedVideoURL: URL path of successfully merged video   2)error: Gives Error object if some error occur in videos merging process\n///   - mergedVideoURL: URL path of successfully merged video\n///   - error: Gives Error object if some error occur in videos merging process\nDPVideoMerger().mergeVideos(withFileURLs: fileURLs as! [URL], completion: {(_ mergedVideoFile: URL?, _ error: Error?) -\u003e Void in\n    if error != nil {\n        let errorMessage = \"Could not merge videos: \\(error?.localizedDescription ?? \"error\")\"\n        let alert = UIAlertController(title: \"Error\", message: errorMessage, preferredStyle: .alert)\n        alert.addAction(UIAlertAction(title: \"OK\", style: .default, handler: { (a) in\n        }))\n        self.present(alert, animated: true) {() -\u003e Void in }\n        return\n    }\n    let objAVPlayerVC = AVPlayerViewController()\n    objAVPlayerVC.player = AVPlayer(url: mergedVideoFile!)\n    self.present(objAVPlayerVC, animated: true, completion: {() -\u003e Void in\n        objAVPlayerVC.player?.play()\n    }) \n})\n\n\n/// Merge  videos to grid matrix layout\n/// - Parameters:\n///   - videoFileURLs: Video file path URLs, Array of videos that going to grid merge\n///   - matrix: Video matrix position (eg 3x3, 4x2, 1x3, ...) (default:- 2x2)\n///   - audioFileURL: Optional audio file for Merged Video\n///   - videoResolution: Output video resolution\n///   - isRepeatVideo: Repeat Video on grid if one or more video have shorter duartion time then output video duration\n///   - isRepeatAudio: Repeat Audio if Merged video have longer duartion time then provided Audio duration\n///   - isAudio: Allow Audio for grid video (default :- true)\n///   - videoDuration: Output video duration (defult:  -1, find max duration from provided  videos)\n///   - videoQuality: AVAssetExportPresetMediumQuality(default) , AVAssetExportPresetLowQuality , AVAssetExportPresetHighestQuality\n///   - 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\n///   - mergedVideoURL: URL path of successfully grid merged video\n///   - error: gives Error object if some error occur in videos merging process\nDPVideoMerger().gridMergeVideos(withFileURLs: fileURLs, videoResolution: CGSize(width: 1000, height: 1000), completion: {(_ mergedVideoFile: URL?, _ error: Error?) -\u003e Void in\n    if error != nil {\n        let errorMessage = \"Could not merge videos: \\(error?.localizedDescription ?? \"error\")\"\n        let alert = UIAlertController(title: \"Error\", message: errorMessage, preferredStyle: .alert)\n        alert.addAction(UIAlertAction(title: \"OK\", style: .default, handler: { (a) in\n        }))\n        self.present(alert, animated: true) {() -\u003e Void in }\n        return\n    }\n    let objAVPlayerVC = AVPlayerViewController()\n    objAVPlayerVC.player = AVPlayer(url: mergedVideoFile!)\n    self.present(objAVPlayerVC, animated: true, completion: {() -\u003e Void in\n        objAVPlayerVC.player?.play()\n    })\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatt1994%2Fdpvideomerger-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatt1994%2Fdpvideomerger-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatt1994%2Fdpvideomerger-swift/lists"}