• Stars
    star
    211
  • Rank 186,867 (Top 4 %)
  • Language
    Kotlin
  • License
    MIT License
  • Created over 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

FFmpeg is a powerful multimedia framework which allows us to decode, encode, transcode, stream, filter and play most of the media content available now. With the help of these tools, you can develop and application that can manipulate any form of media to the desired output. Sky is not the limit when using FFmpeg. I prefer FFmpeg-all which is a Bible for FFmpeg but it is difficult to read if you do not know what you are looking for. To make it easy, I will summarise the basics of video manipulations using FFmpeg which, then you can use in your own applications or libraries that you are working on. I have developed a simple library that enables you to trim and crop a video, additionally you can compress any video and convert it into any format that you desire.

Simple Video Trimmerw

License

Video Editor
Video Editor

About Library

Simple video editor Library contains the following features (cropping/trimming/compressing) videos, using FFmpegKit Libary.

Implementation

[1] In your app module gradle file

dependencies {
 implementation 'com.github.mohamed0017:SimpleVideoEditor:<latest_version>'
}

[2] In your project level gradle file

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

[3] Use VideoTrimmer in your layout.xml

    <com.video.trimmer.view.VideoEditor
        android:id="@+id/videoTrimmer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/header"/>

[4] Implement OnVideoEditedListener on your Activity/ Fragment

class MainActivity : AppCompatActivity(), OnTrimVideoListener {
    ...
    override fun onTrimStarted(){
    }
    override fun getResult(uri: Uri){
    }
    override fun cancelAction(){
    }
    override fun onError(message: String){
    }
    override fun onProgress(percentage: Int){
    }
}

[5] Create instances and set default values for the VideoTrimmer in your Activity/ Fragment

videoTrimmer.setTextTimeSelectionTypeface(FontsHelper[this, FontsConstants.SEMI_BOLD])
                    .setOnTrimVideoListener(this)
                    .setOnVideoListener(this)
                    .setVideoURI(Uri.parse(path))
                    .setVideoInformationVisibility(true)
                    .setMaxDuration(10)
                    .setMinDuration(2)
                    .setVideoQuality(VideoQuality.Medium) // set video quality
                    .setDestinationPath(Environment.getExternalStorageDirectory().path + File.separator + Environment.DIRECTORY_MOVIES)

[8] Create instances and set default values for the VideoCropper in your Activity/ Fragment

 videoCropper.setVideoURI(Uri.parse(path))
                    .setOnCropVideoListener(this)
                    .setMinMaxRatios(0.3f, 3f)
                    .setDestinationPath(Environment.getExternalStorageDirectory().path + File.separator + Environment.DIRECTORY_MOVIES)

Voila! You have implemented an awesome Video Editor for your Android Project now!

Developed By

Add me to Linkedin

More Repositories

1

EventsCalendar

Events Calendar is a user-friendly library that helps you achieve a cool Calendar UI with events mapping. You can customise every pixel of the calendar as per your wish and still achieve in implementing all the functionalities of the native android calendar in addition with adding dots to the calendar which represents the presence of an event on the respective dates. It can be done easily, you are just a few steps away from implementing your own badass looking Calendar for your very own project!
Kotlin
231
star
2

GalleryPicker

Gallery Picker allows you to design a custom gallery for image/ video picker in your android projects.
Kotlin
128
star
3

dots

Dots indicator that shows the current position on a View Pager. It does all the work for you with a few customisations.
Kotlin
24
star
4

PieProgress

Pie Progress is a type of circular progress view similar to the one that you can find in iOS devices while updating applications. It's a simple to use library where the progress gets updated by passing values to a single method.
Kotlin
21
star
5

pulldownlayout

PullDownLayout is a small library that allows you to implement a view that can be dragged down your layout. PullDownLayout can also be used to implement Pull-To-Dismiss feature for your activities and fragments.
Kotlin
18
star
6

android-hilt-sample

Kotlin
4
star
7

StayUpdated

This repository is a project that helps testing a basic news headlines api.
Kotlin
1
star
8

GoWeather

Implementation of androidx LiveData, ViewModel and RxKotlin.
Kotlin
1
star
9

tizisdeepan

1
star
10

StateRelativeLayout

StateRelativeLayout helps you to manage between various UI states, for example, loading state, data state, error state, finish state.
Kotlin
1
star