2

I am trying to do an application in which I would like to give option to user to clip a video using double seekbar so that video can be cropped.

I had hassle importing FFmpeg into Eclipse. However, that pain is over, and I got two points of video and can instantiate FFmpeg's instant.

My focus is to know to know the method and procedure to crop a video.

I got the command of cutting it, that is,

ffmpeg -ss [start] -i in.mp4 -t [duration] -c:v copy -c:a copy out.mp4

However, how do I use this in code?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Saty
  • 2,563
  • 3
  • 37
  • 88
  • What exactly do you mean by… you don't know how to use this in code? Are you using a command-line binary of ffmpeg in Android? Or are you doing it with the NDK? Is this basically about "how do I run a command line in Java for Android"? Please clarify. – slhck Feb 07 '15 at 12:26
  • his question is "how do you use the libav* libraries to accomplish the same behavior in your own app" if I'm seeing correctly...anyway the answer is probably you do a seek, then do a conversion until the correct timeframe has elapsed...FWIW. – rogerdpack Feb 10 '15 at 17:50
  • this.commandComplex = new String[]{"ffmpeg", "-v", "quiet", "-y", "-i", inputFilePath, "-vcodec","copy", "-acodec" ,"copy", "-ss", "00:00:00", "-t", "00:00:30", "-sn", Environment.getExternalStorageDirectory()+"/Output/"+"test1.mp4", "-vcodec","copy" ,"-acodec", "copy", "-ss", "00:00:31", "-t", "00:00:59", "-sn", Environment.getExternalStorageDirectory()+"/Output/"+"test2.mp4" }; – shivani May 13 '16 at 10:32
  • @shivani yes, I have done this using this kind of comand – Saty May 13 '16 at 10:34
  • You can use precompiled libraries for integrating ffmpeg in android..Check out [this](https://androidlearnersite.wordpress.com/2017/03/17/ffmpeg-video-editor/) regarding how to integrate and use ffmpeg – Android Developer Apr 22 '17 at 13:12

0 Answers0