Giter VIP home page Giter VIP logo

ffmpeg-video-editor-android's Introduction

FFmpeg-Video-Editor

Cutting and compressing video,reversing video,extracting image frames from video,extracting audio from video,add Fade In Fade Out effect,create fast and slow motion video using ffmpeg

Below link contains tutorial on using ffmpeg to edit videos-

https://androidlearnersite.wordpress.com/2017/03/17/ffmpeg-video-editor/

This repository contains sample project for an extended app at below link-

https://apkfab.com/video-editor-using-ffmpeg/videoeditor.bhuvnesh.com.ffmpegvideoeditor

ffmpeg-video-editor-android's People

Contributors

bhuvnesh123 avatar desuto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffmpeg-video-editor-android's Issues

Video Cutting Procces

I have a 10 seconds video, I want to cut from second 5 to second 8, after cutting the video is saved from second 5 to second 10.. can you please take a look to this problem?

Not fastens the videos.

Not fastens the videos of 30sec or more then that. working only for below 30 sec's video. Please tell me what to do now.
Thanks & Regards.

How to merge two video?

Hello,

great library, video process is little slow. Can you please provide a command for merge two videos? I have two video in sdcard, backward and forward. i want to merge both videos and create a new video which will look like 1 video with backward and forward. And i can upload it on server.

Thanks!

Very slow performance

Hello,

I am using 1 second video for reversing video.. It takes around 3-4 minutes to process result video..
What i am trying to achive :

I have 1 second video, now i want to display video forward and backward continously.

Thanks!

very slow compression

The original command mentioned in the code was damn slow in each and every device. For example, in LG Nexus 5, for an input video of approx 50 MB and duration 2 min 30 sec. It took around 5 mins to compress it with resulting compressed video to be around 5 MB, and quality degradation.

Though, I tried changing the command in order to make it faster, and changed it to something like this -

String[] complexCommand = {"-i", yourRealPath, "-r", "20", "-vcodec", "mpeg4", "-preset", "ultrafast", "-c:a", "copy", "-me_method", "zero", "-tune", "fastdecode", "-tune", "zerolatency", "-strict", "-2", "-b:v", "1000k", "-pix_fmt", "yuv420p", filePath};

  • It made the same input video compression a lot faster in the LG Nexus 5, i.e, it took just 50 sec to compress it with resultant 20 MB video.

  • But, unluckily, when I tried the same in Samsung Galaxy Grand i9082, it was slow, and took around 5 mins in compression with the resultant video of 30 MB.

  • In Lava X1 Selfie (version 5.1),

It initially failed with this error -

ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (GCC)
  configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/sdcard0/Videos/Lat_test.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2012-12-25 16:56:08
  Duration: 00:02:22.08, start: 0.000000, bitrate: 3024 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 2829 kb/s, 25 fps, 25 tbr, 50 tbn, 50 tbc (default)
    Metadata:
      creation_time   : 1970-01-01 00:00:00
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      creation_time   : 2012-12-25 16:56:08
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
/storage/sdcard0/Movies/compress_video.mp4: No such file or directory

It was probably due to the reason that the code failed to create Movies directory.
So, afterwards, I tried hardcoding the output path, so this time it didn't fail but stuck with progressDialog with a message progress: handler_name : isoMedia File Produced by Google, 5-11-2011 for about infinite time.

My target is to minimize video compression time consumption, to be as low as possible, for around 50 MB video, 1 min time consumption is okay for me.

Please guide me the way to get rid of the slow video compression.

How to cut video between seconds?

For example :
startMs = 2.4
endMs = 5.4
I have tried this code:
String[] complexCommand = {"-i", yourRealPath, "-ss", "" + startMs, "-acodec", "copy", "-vcodec", "copy", "-t", "" + (endMs - startMs), dest.getAbsolutePath()};

But the cutting process happens with Full values (int values)... from "sec 2" to "sec 5"
Is there any way to cut video with "float values" ?
Thanks

Any idea how to do add Transition effect with Masking between 2 video

Any idea how to do add Transition effect between 2 video.

for example i have 2 video & 3 video is black-White with Transition effect. now i want to add 3 video between 2 video as white portion show 2 video & black portion show 1 video.

it is looks like animation.
if any idea how can we do that please suggest

Thank you in advance.

unable to share edited videos

Expected behavior

I expected that using the Share Video feature I will able to share edited files with some platforms.

Actual behavior

When I try to share my edited video through some apps. The apps are showing that "Couldn't Attach File".

How to reproduce

  • Open the app and tap on "Upload Video" button and select a video.
  • There are many features of this app, select one of them. Suppose you select "Cut Video".
  • Then the cutting process will start and after the end of the process, Video Preview page will arrive.
  • Then tap on "Share Video" button and select which platform you want to share your video and then notice the thing.
  • App version: 3.1
  • Operating system: Android 6.0.1
  • Device: Samsung Galaxy A5 (2016)

Recording Of The Bug

gif_image2.gif

New Logo/icon

Hi, I am a graphic designer, I want to help others in graphic design.

After I reviewed your project, your logo on this project unattractive and writing is not neat . Therefore I want to contribute to this project by creating a new logo / icon. what do you think?

Update New Code

can u upload your latest code ?Not update a latest code !Reply me back

Slideshow of PNG images cannot be played

Expected behavior

I should be able to create a slideshow with images in .PNG format.

Actual behavior

But the slideshow with .png format can not be played after trying to create one.

How to reproduce

  1. Install the app from playstore.
  2. Launch the app.
  3. Go to "Create Image Slideshow" from left sliding menu.
  4. Pick some .png format images from your device. ( The screenshots are saved in .png format)
  5. Now click on "Create Slideshow". Enter the duration between two images preview and continue. It will take some time and it will show " Can't play this video" at the end.
  • App Version: 3.1
  • Device: Samsung Galaxy J5
  • Operating System: Android 6.0.1

Recording Of The Bug

https://youtu.be/Noy2bRThqyw

How to add filters to the video with the preview functionality

Your content is quiet good but I'm looking for a way out of adding the filters to the video. Since you have mentioned that your project has the adding filter functionality but no demonstration on your project. Please tell me how to do that. I've used surface view to first apply the filter to the videos at runtime but do not know how to save the file (merge the surface with the videos). Please suggest me some way out to reach to my solution.

Not working in android 10

After changing to target sdk to 29, unable to cut video
I have shared video

WhatsApp.Video.2021-03-18.at.10.18.59.PM.mp4
WhatsApp.Video.2021-03-18.at.10.18.59.PM.mp4

F-Droid Version?

It would be great if a version of the app was posted on F-Droid, a version without any google dependency.

Select images and convert them to a video

I tried few commands to make a video with multiple images but no luck with those and in this project there is no option to make a video with images. Can someone guide me with this?

LoadffmpegBinary issue

after calling method "LoadffmpeBinary" my text layout of whole app got changed from center to left alignment,

Select images and Audio to convert into video

Hello @bhuvnesh123
I tried a few commands to make a video with a single image & audio but no luck with those commands. Can someone guide me with this?

And by using the command I am getting error -

I am using command -

String[] complexCommand = {"-y", "-loop","1","-framerate","1", "-i" ,yourRealImage ,"-i" ,yourRealAudio,"-c:v", "libx264","-preset","veryslow","-crf","0","-c:a","copy", "-shortest", filePath};

Started command : ffmpeg [Ljava.lang.String;@e596883
progress : x264 [error]: malloc of size 60450080 failed
Started command : ffmpeg [Ljava.lang.String;@e596883
progress : Video encoding failed

Can you help me with this?

APK Size

How can i reduce apk size?
Can u help me?

Loading video from sd card doesnt work

I noticed that loading video from the sd card doesnt work:

videoeditor.bhuvnesh.com.ffmpegvideoeditor D/BHUVNESH: startTrim: src: null

but in the version that you have submitted in the Google Play store it works. Can you please share the updated code? thanks

License

You do not mention a license for your code, either in a LICENSE file or in a comment block in the java source files. On your wordpress site you answer the question:

Can i use this in a commercial android app? Will there be any license issue?

with the following:

Yes,you can use it in a commercial app.Please go through this-
https://video.stackexchange.com/questions/14802/can-i-use-ffmpeg-in-a-commercial-product/14804#14804
and
https://github.com/WritingMinds/ffmpeg-android/blob/master/LICENSE.GPLv3

Is your code also under GPLv3 (which would be problematic for commercial uses), or is it public domain but you are warning that a dependency is GPLv3? Or, would you be interested in adopting a license which is permissive, such as MIT or Apache 2?

curve slow motion

i want to create curved motion video,for example, i want play video with Bessel,like "cuttime" app,so,what should i do,please help me,thx a lot.

How to improve reverse performance

Hi,

I am using your example application to reverse a video. The video has 9 seconds duration and its size is 14.3 MB but it takes about 15 minutes to process result video.

What should I do to improve the performance?
Thanks.

Merge Audio And Video.

Hi Bhuvnesh can you please guide how to merge audio and video. As I can see in your play store app has this functionality. Thanks for help.

Unable to build code

I downloaded the latest version of the code today. I cannot get it to compile. I get the following error message:
Gradle sync failed: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler

I'm using a mac with m1 chip., android studio bumblebee 2021.1.1 patch 2.

Does anybody else have the same problem?

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.