{"id":20936172,"url":"https://github.com/bandarhl/bhvideomanager","last_synced_at":"2025-05-13T21:30:57.511Z","repository":{"id":56902893,"uuid":"201512955","full_name":"BandarHL/BHVideoManager","owner":"BandarHL","description":"Video tool manager","archived":false,"fork":false,"pushed_at":"2019-10-14T21:04:44.000Z","size":217,"stargazers_count":19,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T06:17:22.846Z","etag":null,"topics":["audio","cut","objective-c","swift","video","video-editing","video-encoding"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BandarHL.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":"2019-08-09T17:28:48.000Z","updated_at":"2024-04-16T17:42:07.000Z","dependencies_parsed_at":"2022-08-21T01:50:52.878Z","dependency_job_id":null,"html_url":"https://github.com/BandarHL/BHVideoManager","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BandarHL%2FBHVideoManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BandarHL%2FBHVideoManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BandarHL%2FBHVideoManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BandarHL%2FBHVideoManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BandarHL","download_url":"https://codeload.github.com/BandarHL/BHVideoManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254030884,"owners_count":22002666,"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":["audio","cut","objective-c","swift","video","video-editing","video-encoding"],"created_at":"2024-11-18T22:18:13.166Z","updated_at":"2025-05-13T21:30:56.909Z","avatar_url":"https://github.com/BandarHL.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![CI Status](https://img.shields.io/travis/BandarHL/BHVideoManager.svg?style=flat)](https://travis-ci.org/BandarHL/BHVideoManager)\n[![Version](https://img.shields.io/cocoapods/v/BHVideoManager.svg?style=flat)](https://cocoapods.org/pods/BHVideoManager)\n[![License](https://img.shields.io/cocoapods/l/BHVideoManager.svg?style=flat)](https://cocoapods.org/pods/BHVideoManager)\n[![Platform](https://img.shields.io/cocoapods/p/BHVideoManager.svg?style=flat)](https://cocoapods.org/pods/BHVideoManager)\n\n# BHVideoManager\nVideo tool manager\n\n# Features:\n- Trim video or audio.\n- Convert audio to video.\n- Convert video to audio.\n- Merge video with audio.\n- Export video with different quality.\n\n# Export video with different quality\n- for example i have mp4 file(old.mp4 (720p)) i want to convert video quality to 480p:\n```objective-c\n    NSString *documentsDirectoryPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0];\n    NSURL *filePath = [[NSURL fileURLWithPath:documentsDirectoryPath] URLByAppendingPathComponent:@\"old.mp4\"];\n    // you can select another quality by typing AVAssetExportPreset and xcode will show you :)\n    [BHVideoManager ExportVideo:filePath WithQuality:AVAssetExportPreset640x480 SaveFileToPath:[NSURL fileURLWithPath:documentsDirectoryPath] TitleFile:@\"videoExported\" CompletionHandler:^(AVAssetExportSession *exportsession) {\n    if (AVAssetExportSessionStatusFailed == exportsession.status) {\n    NSLog(@\"faild:%@\", exportsession.error);\n    } else if (AVAssetExportSessionStatusCompleted == exportsession.status) {\n    NSLog(@\"Done\");\n    }\n    }];\n```\n\n# Trim Audio\n\n- for example i have m4a file(CleanBandit-Rockabye.m4a) i want trim half of time:\n ``` objective-c\n NSString *documentsDirectoryPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0];\n NSURL *filePath = [[NSURL fileURLWithPath:documentsDirectoryPath] URLByAppendingPathComponent:@\"CleanBandit-Rockabye.m4a\"];\n \n AVURLAsset *asset = [AVURLAsset URLAssetWithURL:filePath options:nil];\n \n [BHVideoManager TrimAudioWithPath:filePath StartTime:kCMTimeZero EndTime:CMTimeMake(asset.duration.value /2, asset.duration.timescale) SaveFileToPath:[NSURL fileURLWithPath:documentsDirectoryPath] TitleFile:@\"test\" CompletionHandler:^(AVAssetExportSession *exportsession) {\n if (AVAssetExportSessionStatusFailed == exportsession.status) {\n NSLog(@\"faild:%@\", exportsession.error);\n } else if (AVAssetExportSessionStatusCompleted == exportsession.status) {\n NSLog(@\"Done\");\n }\n }];\n```\n\n\n# Trim Video\n\n- for example i have mp4 file(old.mp4) i want trim half of time:\n``` objective-c\nNSString *documentsDirectoryPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0];\nNSURL *filePath = [[NSURL fileURLWithPath:documentsDirectoryPath] URLByAppendingPathComponent:@\"old.mp4\"];\nAVURLAsset *asset = [AVURLAsset URLAssetWithURL:filePath options:nil];\n\n[BHVideoManager TrimVideoWithPath:filePath StartTime:kCMTimeZero EndTime:CMTimeMake(asset.duration.value/2, asset.duration.timescale) SaveFileToPath:[NSURL fileURLWithPath:documentsDirectoryPath] TitleFile:@\"test2\" CompletionHandler:^(AVAssetExportSession *exportsession) {\nif (AVAssetExportSessionStatusFailed == exportsession.status) {\nNSLog(@\"faild:%@\", exportsession.error);\n} else if (AVAssetExportSessionStatusCompleted == exportsession.status) {\nNSLog(@\"Done\");\n}\n}];\n```\n\n# Merge video with audio\n``` objective-c\nNSString *documentsDirectoryPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0];\nNSURL *VideofilePath = [[NSURL fileURLWithPath:documentsDirectoryPath] URLByAppendingPathComponent:@\"test2.mp4\"];\nNSURL *audioFilePath = [[NSURL fileURLWithPath:documentsDirectoryPath] URLByAppendingPathComponent:@\"test.m4a\"];\n\n[BHVideoManager MergeVideo:VideofilePath WithAudio:audioFilePath SaveFileToPath:[NSURL fileURLWithPath:documentsDirectoryPath] TitleFile:@\"VideoMerged\" CompletionHandler:^(AVAssetExportSession *exportsession) {\nif (AVAssetExportSessionStatusFailed == exportsession.status) {\nNSLog(@\"faild:%@\", exportsession.error);\n} else if (AVAssetExportSessionStatusCompleted == exportsession.status) {\nNSLog(@\"Done\");\n}\n}];\n```\n\n\n# Convert Video to audio\n\n- for example i have mp4 file(test2.mp4):\n``` objective-c\nNSString *documentsDirectoryPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0];\nNSURL *filePath = [[NSURL fileURLWithPath:documentsDirectoryPath] URLByAppendingPathComponent:@\"test2.mp4\"];\n\n[BHVideoManager ConvertVideoToAudioWithPath:filePath SaveFileToPath:[NSURL fileURLWithPath:documentsDirectoryPath] TitleFile:@\"VideoConverted\" CompletionHandler:^(AVAssetExportSession *exportsession) {\nif (AVAssetExportSessionStatusFailed == exportsession.status) {\nNSLog(@\"faild:%@\", exportsession.error);\n} else if (AVAssetExportSessionStatusCompleted == exportsession.status) {\nNSLog(@\"Done\");\n}\n}];\n```\n\n# Convert Audio to Video\n\n- for example i have m4a file(VideoConverted.m4a):\n``` objective-c\nNSString *documentsDirectoryPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, true)[0];\nNSURL *filePath = [[NSURL fileURLWithPath:documentsDirectoryPath] URLByAppendingPathComponent:@\"VideoConverted.m4a\"];\n\n[BHVideoManager ConvertAudioToVideoWithPath:filePath SaveFileToPath:[NSURL fileURLWithPath:documentsDirectoryPath] TitleFile:@\"AudioConverted\" CompletionHandler:^(AVAssetExportSession *exportsession) {\nif (AVAssetExportSessionStatusFailed == exportsession.status) {\nNSLog(@\"faild:%@\", exportsession.error);\n} else if (AVAssetExportSessionStatusCompleted == exportsession.status) {\nNSLog(@\"Done\");\n}\n}];\n```\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\n## Installation\n\nBHVideoManager is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'BHVideoManager'\n```\n\n## Author\n\nBandarHL, bandarhl\n\n## License\n\nBHVideoManager is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbandarhl%2Fbhvideomanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbandarhl%2Fbhvideomanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbandarhl%2Fbhvideomanager/lists"}