Skip to content

Commit

Permalink
Merge pull request #244 from sam80180/master
Browse files Browse the repository at this point in the history
fix: add 'quit encoding' method
  • Loading branch information
a-schild authored Nov 11, 2023
2 parents ec0ef8b + 60c1c1c commit 094ab34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions jave-core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bin/
9 changes: 9 additions & 0 deletions jave-core/src/main/java/ws/schild/jave/Encoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -667,4 +669,11 @@ public void abortEncoding() {
ffmpeg = null;
}
}

public void quitEncoding() throws IOException { // https://stackoverflow.com/a/21032143/12857692
final OutputStream ingreso = this.ffmpeg.getOutputStream();
final byte b[] = "q".getBytes(StandardCharsets.US_ASCII);
ingreso.write(b);
ingreso.flush();
}
}

0 comments on commit 094ab34

Please sign in to comment.