video - What is wrong part in my Android code with ffmpeg? -
i want mixed video.(image + video) total duration of original video 180 sec. want put image front of video. so, made code in android studio. can not toast. wrong ? how check end of process?
... path = "libray folder"; ...
private class processvideo extends asynctask<void, integer, void> { @override protected void doinbackground(void... params) { process ffmpegprocess = null; try { // initialize command process video // library video process library. string[] command ={path,"-i", input, "-r", "1", "-q:v", "2", "-f", "image", input}; ffmpegprocess = new processbuilder(ffmpegcommand).redirecterrorstream(true).start(); outputstream ffmpegoutstream = ffmpegprocess.getoutputstream(); bufferedreader reader = new bufferedreader(new inputstreamreader(ffmpegprocess.getinputstream())); string line; log.v(thistag,"***starting ffmpeg***"); while ((line = reader.readline()) != null) { // in progress log.v(thistag,"***"+line+"***"); } // finish process log.v(thistag,"***ending ffmpeg***"); videoprocessfinishflag = true; } catch (ioexception e) { e.printstacktrace(); } if (ffmpegprocess != null) { ffmpegprocess.destroy(); } return null; } protected void onpostexecute(void... result) { // show result toast toast = toast.maketext(videoeditoractivity.this, "done processing video", toast.length_long); toast.show(); } }
you missed parameters. try : string[] command ={path,"-y","-i", input,"-strict","experimental", "-r", "1", "-q:v", "2", "-f", "image", input}; above command there 2 "input", different each other. first parameter : video path second parameter : image file path right? command take few long times process video, think. thank commitment.
Comments
Post a Comment