{"id":17987527,"url":"https://github.com/iammert/frames","last_synced_at":"2025-03-25T22:32:12.106Z","repository":{"id":94173161,"uuid":"201014384","full_name":"iammert/Frames","owner":"iammert","description":"Retrieves desired frames from video.","archived":false,"fork":false,"pushed_at":"2020-01-16T14:56:56.000Z","size":2265,"stargazers_count":56,"open_issues_count":2,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-03-03T00:33:52.037Z","etag":null,"topics":["android","customview","ffmpeg","frames","frameslayout","kotlin","mp4","video","video-frames","view"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iammert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-08-07T09:08:30.000Z","updated_at":"2023-10-18T16:53:44.000Z","dependencies_parsed_at":"2023-03-13T17:04:51.783Z","dependency_job_id":null,"html_url":"https://github.com/iammert/Frames","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FFrames","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FFrames/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FFrames/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iammert%2FFrames/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iammert","download_url":"https://codeload.github.com/iammert/Frames/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222099555,"owners_count":16931437,"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":["android","customview","ffmpeg","frames","frameslayout","kotlin","mp4","video","video-frames","view"],"created_at":"2024-10-29T19:09:02.260Z","updated_at":"2024-10-29T19:09:02.823Z","avatar_url":"https://github.com/iammert.png","language":"Kotlin","readme":"\u003cimg src=\"https://raw.githubusercontent.com/momento-lab/Frames/master/art/framescover.png\"/\u003e\n\n## What is Frames?\n\nFrames library retrieves frames from video. It loads frames lazily under the hood. You can customize your frame fetching request as you need.\n\n## What is FrameRequest?\n\nThere are 3 types of frame request.\n\n### SingleFrameRequest\nIf you want to fetch a specific frame at the specific duration.\n\n```kotlin\nval singleFrameRequest = FrameRetrieveRequest.SingleFrameRequest(\n    videoPath = \"/storage/emulated/0/Download/sample.mp4\",\n    frameWidth = 400,\n    frameHeight = 300,\n    durationInMillis = 5213\n)\n```\n\n### MultiFrameRequest\nIf you want to fetch all frames with given interval. For instance, If you have 40 seconds video and frame duration is 2 second, Frames library gives you 20 frames.\n\n```kotlin\nval multiFrameRequest = FrameRetrieveRequest.MultipleFrameRequest(\n    videoPath = \"/storage/emulated/0/Download/sample.mp4\",\n    frameWidth = 400,\n    frameHeight = 300,\n    durationPerFrame = 2000\n)\n```\n\n### RangeFrameRequest\nIf you want to fetch frames with specific range from video with given interval. For instance, you have 40 seconds video and you want to fetch frames between 5. and 15. seconds.\n\n```kotlin\nval rangeFrameRequest = FrameRetrieveRequest.RangeFrameRequest(\n    videoPath = \"/storage/emulated/0/Download/sample.mp4\",\n    frameWidth = 400,\n    frameHeight = 300,\n    durationPerFrame = 4000,\n    startDuration = 5000,\n    endDuration = 15000\n)\n```\n\n## How to load frames?\n\n### Add to XML\n```xml\n \u003ccom.momentolabs.frameslib.ui.view.VideoFramesLayout\n      android:id=\"@+id/layoutFramesLayout\"\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"/\u003e\n```\n\n### Load\n```kotlin\nFrames.load(frameRequest).into(layoutFramesLayout)\n```\n\n### Load frame bitmaps manually\n```kotlin\nFrames\n    .load(frameRetrieveRequest)\n    .into { framesResource -\u003e\n        when (framesResource.status) {\n            Status.EMPTY_FRAMES -\u003e // emit all empty frames initially. (you can draw your own custom view with this)\n            Status.LOADING -\u003e // Lazily emits frames while loading. This scope will be called serially until all frames loaded\n            Status.COMPLETED -\u003e // Called when all frames loaded.\n        }\n    }\n```\n\nYou can also change provider type.\n```kotlin\nFrames\n    .load(frameRetrieveRequest)\n    .setProviderType(ProviderType.FFMPEG or ProviderType.NATIVE_ANDROID)\n    .into{...}\n```\n\n## How does it work behind the scene?\n\n\u003cimg src=\"https://raw.githubusercontent.com/momento-lab/Frames/master/art/howitworks.png\"/\u003e\n\n## Notes\n- Before using Frames library, ask for the ```READ_EXTERNAL_STORAGE``` permission.\n\n## Setup\n\n```groovy\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n\ndependencies {\n    implementation 'com.github.iammert:Frames:0.3'\n}\n```\n\n\nLicense\n--------\n\n\n    Copyright 2019 Mert Şimşek\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiammert%2Fframes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiammert%2Fframes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiammert%2Fframes/lists"}