Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void execProcess(String[] cmds) {
- ProcessBuilder pb = new ProcessBuilder(cmds);
- pb.redirectErrorStream(true);
- Process process = null;
- try {
- process = pb.start();
- BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
- String line;
- while ((line = reader.readLine()) != null)
- Log.i(TAG, line);
- } catch (IOException e) {
- Log.e(TAG, "execProcess()");
- } finally {
- if (process != null)
- process.destroy();
- }
- }
- /**
- * http://ffmpeg.org/trac/ffmpeg/wiki/Create%20a%20video%20slideshow%20from%20images
- */
- public void convertImages2Video() {
- String ffmpegBin = new File(fileBinDir, "ffmpeg").getAbsolutePath();
- final String videoFile = ImageUtils.getMirrorsDir().getAbsolutePath() + File.separator + "mVideoDir.mp4";
- String[] ffmpegCommand = { ffmpegBin, "-f", "image2", "-i", "img%03d.png", "-vcodec", "libx264", videoFile };
- // String[] ffmpegCommand = { ffmpegBin };
- execProcess(ffmpegCommand);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement