{"id":28559038,"url":"https://github.com/sdwebimage/sdwebimagevideocoder","last_synced_at":"2025-08-07T21:10:08.545Z","repository":{"id":54415441,"uuid":"222216455","full_name":"SDWebImage/SDWebImageVideoCoder","owner":"SDWebImage","description":"A toy (non-production) SDWebImage coder plugin to play Video Format like MP4 on Animated Image View","archived":false,"fork":false,"pushed_at":"2024-07-16T11:45:28.000Z","size":2452,"stargazers_count":12,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T02:43:46.630Z","etag":null,"topics":["ios","macos","mov","mp4","sdwebimage","tvos"],"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/SDWebImage.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-17T08:07:21.000Z","updated_at":"2023-10-12T10:59:39.000Z","dependencies_parsed_at":"2024-11-06T13:53:44.473Z","dependency_job_id":null,"html_url":"https://github.com/SDWebImage/SDWebImageVideoCoder","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"117eda8a4872c34dd136b5a673b39058d495a13d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageVideoCoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageVideoCoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageVideoCoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageVideoCoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SDWebImage","download_url":"https://codeload.github.com/SDWebImage/SDWebImageVideoCoder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SDWebImage%2FSDWebImageVideoCoder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259039545,"owners_count":22796853,"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":["ios","macos","mov","mp4","sdwebimage","tvos"],"created_at":"2025-06-10T08:35:57.570Z","updated_at":"2025-06-10T08:35:59.126Z","avatar_url":"https://github.com/SDWebImage.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SDWebImageVideoCoder\n\n[![CI Status](https://img.shields.io/travis/SDWebImage/SDWebImageVideoCoder.svg?style=flat)](https://travis-ci.org/SDWebImage/SDWebImageVideoCoder)\n[![Version](https://img.shields.io/cocoapods/v/SDWebImageVideoCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImageVideoCoder)\n[![License](https://img.shields.io/cocoapods/l/SDWebImageVideoCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImageVideoCoder)\n[![Platform](https://img.shields.io/cocoapods/p/SDWebImageVideoCoder.svg?style=flat)](https://cocoapods.org/pods/SDWebImageVideoCoder)\n\n## What's for\n\nThis is just a toy coder plugin for [SDWebImage](https://github.com/SDWebImage). Which aim to provide a demo usage that how SDWebImage combined the Animated Image View and Player and let it works for generic usage and customization.\n\n**Important**: This project is just a toy, which means, it does not provide any production ready features, and the performances is really slow.\n\nFor real world rendering for short video files (like [Imgur's GIFV format](https://help.imgur.com/hc/en-us/articles/208606616-What-is-GIFV-)). You should always prefers to use the video player and rendering components, like AVKit's [AVPlayerViewController](https://developer.apple.com/documentation/avkit/avplayerviewcontroller) .\n\nThis coder plugin, provide the animation loading support for video format, including:\n\n+ MP4 (MPEG/4)\n+ M4V (Apple iTunes Movie)\n+ MOV (QuickTime Movie)\n\n## Requirements\n\n+ iOS 9+\n+ macOS 10.11+\n+ tvOS 9+\n\n## Installation\n\n#### CocoaPods\n\nSDWebImageVideoCoder is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'SDWebImageVideoCoder'\n```\n\n#### Carthage\n\nSDWebImageVideoCoder is available through [Carthage](https://github.com/Carthage/Carthage).\n\n```\ngithub \"SDWebImage/SDWebImageVideoCoder\"\n```\n\n#### Swift Package Manager (Xcode 11+)\n\nSDWebImageVideoCoder is available through [Swift Package Manager](https://swift.org/package-manager).\n\n```swift\nlet package = Package(\n    dependencies: [\n        .package(url: \"https://github.com/SDWebImage/SDWebImageVideoCoder.git\", from: \"0.2.0\")\n    ]\n)\n```\n\n## Usage\n\n### Load Video URL\n\nFor coder plugin usage, see [Wiki - Coder Usage](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#coder-usage)\n\n+ Objective-C\n\n```objective-c\n// register coder\n[SDImageCodersManager.sharedCoder addCoder:SDImageVideoCoder.sharedCoder];\n// load URL\nSDAnimatedImageView *imageView;\nNSURL *videoURL = [NSURL URLWithString:@\"https://i.imgur.com/FY1AbSo.mp4\"]; \n[imageView sd_setImageWithURL:videoURL];\n```\n\n+ Swift\n\n```swift\n// register coder\nSDImageCodersManager.shared.addCoder(SDImageVideoCoder.shared)\n// load URL\nlet imageView: SDAnimatedImageView\nlet url = URL(string: \"https://i.imgur.com/FY1AbSo.mp4\")\nimageView.sd_setImage(url: url)\n```\n\n### AVAsset player usage\n\nFor player usage, see [Wiki - Animated Image Player](https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#animated-player-530)\n\n+ Objective-C\n\n```objective-c\n// AVAsset\nAVAsset *asset;\nAVAssetImageGenerator *generator = [AVAssetImageGenerator assetImageGeneratorWithAsset:asset];\ngenerator.appliesPreferredTrackTransform = YES;\ngenerator.requestedTimeToleranceBefore = kCMTimeZero;\ngenerator.requestedTimeToleranceAfter = kCMTimeZero;\n// player\nSDAnimatedImagePlayer *player = [SDAnimatedImagePlayer playerWithProvider:generator];\nplayer.animationFrameHandler = ^(NSUInteger index, UIImage * frame) {\n    // frames\n};\n[player seekToFrameAtIndex:5 loopCount:0];\n[player play];\n```\n\n+ Swift\n\n```swift\nlet asset: AVAsset\nlet generator = AVAssetImageGenerator(asset: asset)\ngenerator.appliesPreferredTrackTransform = true\ngenerator.requestedTimeToleranceBefore = .zero\ngenerator.requestedTimeToleranceAfter = .zero\n// Player\nlet player = SDAnimatedImagePlayer(provider: generator)\nplayer.animationFrameHandler = { (index, frame) in \n    // frames\n}\nplayer.seekToFrame(at: 5, loopCount: 0)\nplayer.play()\n```\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n\u003cimg src=\"https://raw.githubusercontent.com/SDWebImage/SDWebImageVideoCoder/master/Example/Screenshot/MP4Demo.png\" width=\"600\" /\u003e\n\nThis demo MP4 video is from [Imgur](https://imgur.com/). You can always try you short video files as well.\n\n## Author\n\nDreamPiggy, lizhuoli1126@126.com\n\n## License\n\nSDWebImageVideoCoder 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%2Fsdwebimage%2Fsdwebimagevideocoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsdwebimage%2Fsdwebimagevideocoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsdwebimage%2Fsdwebimagevideocoder/lists"}