Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue in running the project #28

Open
pals-ric opened this issue Jul 6, 2018 · 5 comments
Open

issue in running the project #28

pals-ric opened this issue Jul 6, 2018 · 5 comments

Comments

@pals-ric
Copy link

pals-ric commented Jul 6, 2018

String filein = "input.mp4";
String img ="kapil.jpg";
String fileout = Environment.getExternalStorageDirectory().getAbsolutePath() +"/output.mp4";
Controller.getInstance().run(new String[]{ "-i", filein, "-i", img, "-filter_complex", "overlay=0:main_h-overlay_h", fileout
});

i am using this code to run my video with image over in main activity ...but output only blank activity is coming ...i am trying to run your project also same blank activity .... suggest something!!!

@dshigh
Copy link

dshigh commented Jul 6, 2018

check for output in your phone storage.

@pals-ric
Copy link
Author

pals-ric commented Jul 6, 2018

@dshigh file is not there in external storage and why app is stoping while running...

@dshigh
Copy link

dshigh commented Jul 6, 2018

Share your log.

@pals-ric
Copy link
Author

pals-ric commented Jul 6, 2018

if i tried to mute video with this command
Controller.getInstance().run(new String[]{
"-y",
"-i",
filein,
"-vcodec",
"copy",
"-an",
fileout
});

its working fine, but if i'm trying to add image in the video with this command,
Controller.getInstance().run(new String[]{ "-i", filein, "-i", image, "-filter_complex", "overlay=10:main_h-overlay_h-10", fileout
});

its not working, app is crashing.

@rishirane
Copy link

In case you are still wondering..
As you are trying to put image over video it needs to be re-encoded with libx264 codec profile.

new String[]{ "-y", "-i", videofileabsolutepath, "-i", imagefileabsolutepath,"-strict","experimental", "-filter_complex", "[0:v][1:v] overlay=10:main_h-overlay_h-10[vid]", "-c:v","libx264","-c:a","aac", "-map", "[vid]", "-map":''[0:a]" fileoutabsolutepath
}

You can use audio codec as copy if you dont want audio to be re-encoded. Also check your image height is not 10 otherwise it will be hidden.

Order of the command needs to be same. Hopefully this will work.

Now if app is still crashing then check log for some clue. May be videofile path or image path is not correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants