-2

I am trying to develop an app which the user chooses a video and displays it , and several operations can be performed, the first one is to trim the video Where you can choose a starting point and an ending point, and the output is a video between them how can I trim the video I feel completely lost in this question

Markus Kauppinen
  • 3,025
  • 4
  • 20
  • 30

1 Answers1

0

Try this git link to trim video in android studio

Video Trimmer

Follow these steps

implement gradle

implementation 'life.knowledge4:k4l-video-trimmer:1.0'

Add View in layout

<life.knowledge4.videotrimmer.K4LVideoTrimmer
android:id="@+id/timeLine"
android:layout_height="match_parent"
android:layout_width="match_parent" />

Set the K4LVideoTrimmer selected video Uri.

K4LVideoTrimmer videoTrimmer = ((K4LVideoTrimmer) findViewById(R.id.timeLine));
if (videoTrimmer != null) {
    videoTrimmer.setVideoURI(Uri.parse(path));
}

Implements OnTrimVideoListener methods

   @Override
public void getResult(final Uri uri) {
    // handle K4LVideoTrimmer result.
}

@Override
public void cancelAction() {
    // handle K4LVideoTrimmer cancel action
}
Android Geek
  • 8,956
  • 2
  • 21
  • 35