Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
2a007df722 | |||
|
73b15ce781 | ||
3e50146f5e | |||
5d36c40508 | |||
12f81cb014 | |||
8c0c52c736 | |||
bd8e36d893 | |||
dacd86039d |
24
README.md
24
README.md
@ -2,6 +2,30 @@
|
|||||||
|
|
||||||
The Bit Goblin video transcoder.
|
The Bit Goblin video transcoder.
|
||||||
|
|
||||||
|
## Installing from RPM
|
||||||
|
|
||||||
|
Installing from the Bit Goblin repository is easy! Add the following repo file to `/etc/yum.repos.d/bitgoblin.repo`:
|
||||||
|
|
||||||
|
```
|
||||||
|
[bitgoblin]
|
||||||
|
name=Bit Goblin repository
|
||||||
|
baseurl=http://repo.metaunix.net/dnf
|
||||||
|
enabled=1
|
||||||
|
gpgcheck=0
|
||||||
|
```
|
||||||
|
|
||||||
|
Update your package sources just to make sure all was added properly:
|
||||||
|
|
||||||
|
```
|
||||||
|
dnf updateinfo
|
||||||
|
```
|
||||||
|
|
||||||
|
Then install dragoon! Use the command below if you DON'T want DNF to install a bunch of unnecessary stuff to meet OpenJDK's weak dependencies; otherwise a regular `dnf install dragoon` is fine:
|
||||||
|
|
||||||
|
```
|
||||||
|
dnf --setopt=install_weak_deps=False --best install dragoon
|
||||||
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
Currently this project is targeting Java 17 LTS and uses Maven to manage the software lifecycle. Thus, you must have a Java 17 JDK and Maven installed to build this project.
|
Currently this project is targeting Java 17 LTS and uses Maven to manage the software lifecycle. Thus, you must have a Java 17 JDK and Maven installed to build this project.
|
||||||
|
4
pom.xml
4
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>tech.bitgoblin</groupId>
|
<groupId>tech.bitgoblin</groupId>
|
||||||
<artifactId>dragoon</artifactId>
|
<artifactId>dragoon</artifactId>
|
||||||
<version>0.3.8</version>
|
<version>0.3.12</version>
|
||||||
|
|
||||||
<name>Dragoon</name>
|
<name>Dragoon</name>
|
||||||
<url>https://www.bitgoblin.tech</url>
|
<url>https://www.bitgoblin.tech</url>
|
||||||
@ -238,7 +238,7 @@
|
|||||||
</mappings>
|
</mappings>
|
||||||
<requires>
|
<requires>
|
||||||
<require>java-17-openjdk</require>
|
<require>java-17-openjdk</require>
|
||||||
<require>ffmpeg</require>
|
<require>ffmpeg-free</require>
|
||||||
</requires>
|
</requires>
|
||||||
<preinstallScriptlet>
|
<preinstallScriptlet>
|
||||||
<script>echo "installing ${project.name} now"</script>
|
<script>echo "installing ${project.name} now"</script>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Configuration status="info" name="Dragoon" packages="">
|
<Configuration status="info" name="Dragoon" packages="">
|
||||||
<Appenders>
|
<Appenders>
|
||||||
<File name="DragoonLog" fileName="logs/dragoon.log">
|
<File name="DragoonLog" fileName="/opt/dragoon/logs/dragoon.log">
|
||||||
<PatternLayout>
|
<PatternLayout>
|
||||||
<Pattern>%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n</Pattern>
|
<Pattern>%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n</Pattern>
|
||||||
</PatternLayout>
|
</PatternLayout>
|
||||||
|
@ -63,18 +63,28 @@ public class Transcoder {
|
|||||||
String filename = Paths.get(filePath).getFileName().toString();
|
String filename = Paths.get(filePath).getFileName().toString();
|
||||||
String outputPath = Paths.get(this.repo.getOutputPath(), String.format("%s.mov", filename)).toString();
|
String outputPath = Paths.get(this.repo.getOutputPath(), String.format("%s.mov", filename)).toString();
|
||||||
|
|
||||||
String cmd = String.format("%s -i %s -y -f %s -c:v %s -vf %s -profile:v %s -c:a %s %s",
|
// build the custom video parameters string
|
||||||
this.ffmpeg_path, // FFMPEG binary path
|
String videoParameters = String.format("scale=%s,fps=%s,format=%s",
|
||||||
sourceFile.toString(), // input file
|
this.config.getString("transcoder.video_resolution"), // video resolution
|
||||||
this.config.getString("transcoder.video_format"), // video container format
|
this.config.getString("transcoder.video_framerate"), // video frame rate
|
||||||
this.config.getString("transcoder.video_codec"), // video codec
|
this.config.getString("transcoder.video_color") // video color format
|
||||||
this.config.getString("transcoder.video_parameters"), // video format
|
|
||||||
this.config.getString("transcoder.video_profile"), // video profile
|
|
||||||
this.config.getString("transcoder.audio_codec"), // audio codec
|
|
||||||
outputPath // output file path
|
|
||||||
);
|
);
|
||||||
|
|
||||||
ProcessBuilder pb = new ProcessBuilder(cmd.split("\\s+"));
|
String cmd = String.format("%s -i INPUT_FILE -y -f %s -c:v %s -vf %s -profile:v %s -c:a %s OUTPUT_FILE",
|
||||||
|
this.ffmpeg_path, // FFMPEG binary path
|
||||||
|
this.config.getString("transcoder.video_format"), // video container format
|
||||||
|
this.config.getString("transcoder.video_codec"), // video codec
|
||||||
|
videoParameters, // custom video parameters
|
||||||
|
this.config.getString("transcoder.video_profile"), // video profile
|
||||||
|
this.config.getString("transcoder.audio_codec") // audio codec
|
||||||
|
);
|
||||||
|
|
||||||
|
String[] cmdArr = cmd.split("\\s+");
|
||||||
|
cmdArr[2] = sourceFile.toString();
|
||||||
|
cmdArr[cmdArr.length - 1] = outputPath;
|
||||||
|
System.out.println(String.join(" ", cmdArr));
|
||||||
|
|
||||||
|
ProcessBuilder pb = new ProcessBuilder(cmdArr);
|
||||||
pb.inheritIO(); // use the java processes' input and output streams
|
pb.inheritIO(); // use the java processes' input and output streams
|
||||||
try {
|
try {
|
||||||
Process process = pb.start();
|
Process process = pb.start();
|
||||||
|
Loading…
Reference in New Issue
Block a user