Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void method() throws InterruptedException, IOException {
- final Path videoIn = Paths.get("http://sdsdsdaadsa:9981/stream/channel/secrectkey");
- final Path encodingFile = Paths.get("/momomo/Generated/Tv/a.mp4");
- final Path errorFile = Paths.get("/momomo/Generated/Tv/a.error");
- Files.deleteIfExists(encodingFile);
- Files.deleteIfExists(errorFile);
- final ProcessBuilder pb
- = new ProcessBuilder("ffmpeg",
- "-i", videoIn.toString(),
- "-y",
- "-s", "360x480", // stripped the extraneous "-1"
- "-vcodec", "libx264",
- "/momomo/Generated/Tv/a.mp4"
- );
- // pb.redirectOutput(ProcessBuilder.Redirect.PIPE);
- pb.redirectError (errorFile.toFile());
- pb.redirectOutput (encodingFile.toFile());
- final Process p = pb.start();
- int code = p.waitFor();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement