Coder Social home page Coder Social logo

dalalsunil1986 / videoeditor-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tizisdeepan/videoeditor

0.0 1.0 0.0 7.25 MB

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.

License: MIT License

Kotlin 100.00%

videoeditor-1's Introduction

Video Trimmer

License

Video Trimmer Video Cropper
Video Trimmer Video Cropper

About Library

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.

Implementation

[1] In your app module gradle file

dependencies {
    implementation 'com.github.tizisdeepan:videoeditor:<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.VideoTrimmer
        android:id="@+id/videoTrimmer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/header"/>

[4] Use VideoCropper in your layout.xml

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

[5] Implement OnTrimVideoListener on your Activity/ Fragment

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

[6] Implement OnCropVideoListener on your Activity/ Fragment

class MainActivity : AppCompatActivity(), OnTrimVideoListener {
    ...
    override fun onCropStarted(){
    }
    override fun getResult(uri: Uri){
    }
    override fun cancelAction(){
    }
    override fun onError(message: String){
    }
    override fun onProgress(progress: Float){
    }
}

[7] 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)
                    .setDestinationPath(Environment.getExternalStorageDirectory().toString() + File.separator + "temp" + File.separator + "Videos" + File.separator)

[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().toString() + File.separator + "temp" + File.separator + "Videos" + File.separator)

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

Developed By

Follow me on Twitter Add me to Linkedin

videoeditor-1's People

Contributors

tizisdeepan avatar deepan5901 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.