{"id":13908593,"url":"https://github.com/Ahmedbadereldin/Video-Trimmer-Android","last_synced_at":"2025-07-18T07:31:55.227Z","repository":{"id":43455547,"uuid":"286190689","full_name":"Ahmedbadereldin/Video-Trimmer-Android","owner":"Ahmedbadereldin","description":"Trim the video by adjusting starting point and ending point in Android","archived":false,"fork":false,"pushed_at":"2022-12-13T06:49:30.000Z","size":20243,"stargazers_count":84,"open_issues_count":0,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-07T23:57:32.922Z","etag":null,"topics":["android","android-example","java-android","kotlin-android","video-cutter","video-trim","video-trimmer","video-trimming"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/Ahmedbadereldin.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}},"created_at":"2020-08-09T07:42:46.000Z","updated_at":"2024-06-12T13:32:10.000Z","dependencies_parsed_at":"2023-01-28T08:31:18.769Z","dependency_job_id":null,"html_url":"https://github.com/Ahmedbadereldin/Video-Trimmer-Android","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahmedbadereldin%2FVideo-Trimmer-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahmedbadereldin%2FVideo-Trimmer-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahmedbadereldin%2FVideo-Trimmer-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ahmedbadereldin%2FVideo-Trimmer-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ahmedbadereldin","download_url":"https://codeload.github.com/Ahmedbadereldin/Video-Trimmer-Android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226372246,"owners_count":17614653,"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","android-example","java-android","kotlin-android","video-cutter","video-trim","video-trimmer","video-trimming"],"created_at":"2024-08-06T23:02:51.101Z","updated_at":"2024-11-25T17:31:43.982Z","avatar_url":"https://github.com/Ahmedbadereldin.png","language":"Java","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# Video-Trimmer-Android #\nTrim the video by adjusting starting point and ending point in Android.\n\n\n\u003ca target=\"_blank\" href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/licence-MIT-brightgreen.svg\" alt=\"license : MIT\"\u003e\u003c/a\u003e\n\u003ca target=\"_blank\" href=\"https://www.cmarix.com/android-application-development-services.html\"\u003e\u003cimg src=\"https://img.shields.io/badge/platform-android-blue.svg\" alt=\"license : MIT\"\u003e\u003c/a\u003e\n[![](https://jitpack.io/v/Ahmedbadereldin/Video-Trimmer-Android.svg)](https://jitpack.io/#Ahmedbadereldin/Video-Trimmer-Android)\n\n## Screen Shots ##\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"screenshots/sample.gif\" width=\"270\" height=\"500\" /\u003e \u0026nbsp;\u0026nbsp;\n\u003c/p\u003e\n\n## Core Features ##\n\n - Video can be trimmed/shortened and played on the same screen\n - Video can be trimmed by selecting the starting point and ending point, and it will display the video size and video duration based on the selected position\n - Seekbar moves as per selected video for trimming\n - You can specify the length of the video before cut.\n\n## How it works ##\n\n - User can record video from camera or select video from gallery\n - Set the selected video in the trimming screen\n - Trim the video by dragging starting point and end point\n - View trimmed video on the trimming screen\n - Save video, it will show image from video in next screen.\n - You can use the video after that as you like, like upload to server.\n\n## Purpose of this code ##\n\n - Whenever it is required to crop thr video, this code can help you\n - Whenever you are having a limiation of video recording such as allow users to record video for 1 min, this code can help you\n\n## Gradle ##\n```\nallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\n\n```\ndependencies {\n    ...\n\timplementation 'com.github.Ahmedbadereldin:Video-Trimmer-Android:1.0.4'\n}\n```\n\n## Setup your code ##\n\n - In order to use the library without problems, add these codes.\n   \n * AndroidManifest.xml \n ```\n     \u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" /\u003e\n     \u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" /\u003e\n     \u003cuses-permission android:name=\"android.permission.CAMERA\" /\u003e\n \n     \u003capplication\n        ...\n         android:requestLegacyExternalStorage=\"true\"\n        ...\n     \u003e\n\n    ...\n\n    \u003cactivity\n            android:name=\".YourActivity\"\n            android:configChanges=\"orientation|screenSize\"\n            android:launchMode=\"singleTask\"\n            android:screenOrientation=\"portrait\"\n            android:windowSoftInputMode=\"adjustPan\"\u003e\n            \u003cintent-filter android:label=\"@string/app_name\"\u003e\n                \u003caction android:name=\"android.intent.action.SEND\" /\u003e\n                \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n                \u003c!-- \u003cdata android:mimeType=\"*/*\" /\u003e --\u003e\n                \u003cdata android:mimeType=\"video/*\" /\u003e\n                \u003cdata android:mimeType=\"image/*\" /\u003e\n                \u003cdata android:mimeType=\"text/*\" /\u003e\n            \u003c/intent-filter\u003e\n        \u003c/activity\u003e\n\n        \u003cactivity\n            android:name=\".VideoTrimmerActivity\"\n            android:configChanges=\"orientation|screenSize\"\n            android:launchMode=\"singleTask\"\n            android:screenOrientation=\"portrait\"\n            android:theme=\"@style/AppTheme.SlidrActivityTheme\"\n            android:windowSoftInputMode=\"adjustPan\" /\u003e\n    ...\n\n ```\n\n * In YourActivity\n  ```\n    protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n        super.onActivityResult(requestCode, resultCode, data);\n\n        //  Open VideoTrimmerActivity\n        if (requestCode == REQUEST_TAKE_GALLERY_VIDEO) { //recive \n            if (resultCode == RESULT_OK) {\n                Uri selectedImageUri = data.getData();\n                // MEDIA GALLERY\n                String path = getPath(selectedImageUri);\n                Uri uriFile = Uri.fromFile(new File(path));\n                String fileExtension = MimeTypeMap.getFileExtensionFromUrl(uriFile.toString());\n                Log.d(TAG, \"onActivityResult: \" + fileExtension);\n\n                if (fileExtension.equalsIgnoreCase(\"MP4\")) {\n                    File file = new File(path);\n                    if (file.exists()) {\n                        startActivityForResult(new Intent(YourActivity.this, VideoTrimmerActivity.class).putExtra(\"EXTRA_PATH\", path), VIDEO_TRIM);\n                        overridePendingTransition(0, 0);\n                    } else {\n                        Toast.makeText(NewPostActivity.this, \"Please select proper video\", Toast.LENGTH_LONG).show();\n                    }\n                } else {\n                    Toast.makeText(this, getString(R.string.file_format) + \" ,\" + fileExtension, Toast.LENGTH_SHORT).show();\n                }\n            }\n        }\n\n        //  ForResult from VideoTrimmerActivity\n        if (requestCode == VIDEO_TRIM) {\n            if (resultCode == RESULT_OK) {\n                if (data != null) {\n                    String videoPath = data.getExtras().getString(\"INTENT_VIDEO_FILE\");\n                    File file = new File(videoPath);\n                    Log.d(TAG, \"onActivityResult: \" + file.length());\n\n                    pathPostImg = videoPath;\n\n                    Glide.with(this)\n                            .load(pathPostImg)\n                            .into(postImg);\n                    postImgLY.setVisibility(View.VISIBLE);\n\n                }\n            }\n        }\n\n    }\n  ```\n   \n## Proguard ##\n \n  ```\n    ### RxJava, RxAndroid for media-picker-android library\n    -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {\n        long producerIndex;\n        long consumerIndex;\n    }\n    \n    ### mp4parser \n    -keep class * implements com.coremedia.iso.boxes.Box {* ; }\n    -dontwarn com.coremedia.iso.boxes.*\n    -dontwarn com.googlecode.mp4parser.authoring.tracks.mjpeg.**\n    -dontwarn com.googlecode.mp4parser.authoring.tracks.ttml.**\n  ```\n\n## Requirements ##\n\n - Android 4.1+\n  \n\n## Contact me via e-mail ##\nFor any inquiries or clarifications, you can contact me via e-mail. Just send an email to [ahmedmbadereldin@gmail.com](mailto:ahmedmbadereldin@gmail.com \"ahmedmbadereldin@gmail.com\").\n\n## Contact me via social media ##\n\n[Facebook](https://www.facebook.com/AhmedMBaderElDin) | [Twitter](https://twitter.com/AhmedBaderEDin) | [Linkedin](https://www.linkedin.com/in/ahmed-m-bader-el-din-0ba48bb5/)\n \n## Libraries ##\n\n - [SDP - a scalable size unit](https://github.com/intuit/sdp)\n - [SSP - a scalable size unit for texts](https://github.com/intuit/ssp)\n - [Android RunTime Permission](https://github.com/fccaikai/AndroidPermissionX)\n - [read, write and create MP4 files](https://github.com/sannies/mp4parser)\n - [Pick image or video](https://github.com/iamthevoid/media-picker-android)\n - [View images](https://github.com/bumptech/glide)\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAhmedbadereldin%2FVideo-Trimmer-Android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAhmedbadereldin%2FVideo-Trimmer-Android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAhmedbadereldin%2FVideo-Trimmer-Android/lists"}