Compare commits

..

22 Commits

Author SHA1 Message Date
2a007df722 Version bump to v0.3.12
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2024-04-19 14:57:41 -04:00
Gregory Ballantine
73b15ce781 Separated the resolution, color, and frame rate options in the config file
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2024-04-19 14:53:59 -04:00
3e50146f5e Updatd README with RHEL installation instructions
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-03-24 12:45:00 -04:00
5d36c40508 Fixed RHEL ffmpeg requirement; version bump to v0.3.11
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline failed
2023-03-24 12:33:00 -04:00
12f81cb014 Version bump to v0.3.10
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-03-24 11:09:20 -04:00
8c0c52c736 Changed how the input and output files get added to the command array to better handle spaces in file names
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-02-18 22:49:18 -05:00
bd8e36d893 Version bump to v0.3.9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-01-25 14:04:03 -05:00
dacd86039d Fixed typo in dragoon log path for packages
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-01-25 14:03:47 -05:00
af41be829a Fixed error in log4j2.xml path
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-01-25 13:56:46 -05:00
1c08196104 Version bump to v0.3.8
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline failed
2023-01-25 13:53:48 -05:00
7b23fa248b Fixed path for log4j2.xml in packaging
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-01-25 13:53:26 -05:00
095e5c2a84 Fixed typo in path
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-01-25 13:48:35 -05:00
0c77a7ab04 Fixed CmdTest
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline failed
2023-01-25 13:45:02 -05:00
cfb1d09eb7 Version bump to v0.3.7
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/tag/woodpecker Pipeline failed
2023-01-25 13:42:52 -05:00
bd4117df38 Fixed a few housekeeping things to make the linux packages more plug-and-play
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2023-01-25 13:42:36 -05:00
0eaf18822b Version bump to v0.3.6
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-01-25 13:27:58 -05:00
7bdd4a5dfb Added log4j2.xml to linux packages to fix the deployment
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-01-25 13:27:16 -05:00
ea6e6c95e1 Updated woodpecker
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-01-25 11:54:31 -05:00
c7f9c4cf73 Fixed woodpecker config
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline failed
2023-01-25 11:38:48 -05:00
ce9efc463d Version bump to v0.3.5
Some checks failed
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline failed
2023-01-25 11:09:28 -05:00
879ff8f8f4 Updated woodpecker config to copy packages to the local repo
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2023-01-25 11:08:38 -05:00
f132861cbc Fixed log4j class not found error; Updated log4j version
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful
2023-01-25 10:14:50 -05:00
10 changed files with 131 additions and 19 deletions

View File

@ -31,3 +31,49 @@ pipeline:
- target/rpm/dragoon/RPMS/noarch/dragoon-*.rpm - target/rpm/dragoon/RPMS/noarch/dragoon-*.rpm
when: when:
event: tag event: tag
copy_deb_package:
image: appleboy/drone-scp
settings:
host: "repo.int.metaunix.net"
username:
from_secret: repo_admin
password:
from_secret: repo_password
port: 22
target: /srv/repo/apt/dragoon/
source: target/dragoon-*.deb
strip_components: 1
when:
event: tag
copy_rpm_package:
image: appleboy/drone-scp
settings:
host: "repo.int.metaunix.net"
username:
from_secret: repo_admin
password:
from_secret: repo_password
port: 22
target: /srv/repo/dnf/dragoon/
source: target/rpm/dragoon/RPMS/noarch/dragoon-*.rpm
strip_components: 5
when:
event: tag
update_repos:
image: appleboy/drone-ssh
settings:
host:
- repo.int.metaunix.net
username:
from_secret: repo_admin
password:
from_secret: repo_password
port: 22
command_timeout: 2m
script:
- sudo /home/xadmin/scripts/update_repo.sh
when:
event: tag

View File

@ -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.

19
pom.xml
View File

@ -6,7 +6,7 @@
<groupId>tech.bitgoblin</groupId> <groupId>tech.bitgoblin</groupId>
<artifactId>dragoon</artifactId> <artifactId>dragoon</artifactId>
<version>0.3.4</version> <version>0.3.12</version>
<name>Dragoon</name> <name>Dragoon</name>
<url>https://www.bitgoblin.tech</url> <url>https://www.bitgoblin.tech</url>
@ -55,12 +55,12 @@
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId> <artifactId>log4j-api</artifactId>
<version>2.17.2</version> <version>2.19.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.apache.logging.log4j</groupId> <groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId> <artifactId>log4j-core</artifactId>
<version>2.17.2</version> <version>2.19.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
@ -201,6 +201,17 @@
</source> </source>
</sources> </sources>
</mapping> </mapping>
<mapping>
<directory>/opt/dragoon/log4j2.xml</directory>
<filemode>755</filemode>
<username>dragoon</username>
<groupname>dragoon</groupname>
<sources>
<source>
<location>${basedir}/src/build/deb/opt/dragoon/log4j2.xml</location>
</source>
</sources>
</mapping>
<mapping> <mapping>
<directory>/etc/dragoon</directory> <directory>/etc/dragoon</directory>
<configuration>true</configuration> <configuration>true</configuration>
@ -227,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>

View File

@ -1,6 +1,7 @@
# This example transcodes footage to DNxHD 1080p60 for use in video editors like DaVinci Resolve. # This example transcodes footage to DNxHD 1080p60 for use in video editors like DaVinci Resolve.
[transcoder] [transcoder]
repo_path = '~/videos' # location of the videos to transcode repo_path = '~/videos' # location of the videos to transcode
interval = 30
video_format = 'mov' # video container format video_format = 'mov' # video container format
video_codec = 'dnxhd' # video codec to use video_codec = 'dnxhd' # video codec to use
video_parameters = 'scale=1920x1080,fps=60,format=yuv422p' # video extra format parameters flag - this will be broken later into separate attributes video_parameters = 'scale=1920x1080,fps=60,format=yuv422p' # video extra format parameters flag - this will be broken later into separate attributes

View File

@ -4,7 +4,7 @@ Description=Dragoon video transcoder service
[Service] [Service]
User=dragoon User=dragoon
Group=dragoon Group=dragoon
ExecStart=/usr/bin/java -jar '/opt/dragoon/dragoon.jar' ExecStart=/usr/bin/java -Dlog4j.configurationFile=/opt/dragoon/log4j2.xml -jar '/opt/dragoon/dragoon.jar' -c '/etc/dragoon/config.toml'
SuccessExitStatus=143 SuccessExitStatus=143
[Install] [Install]

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info" name="Dragoon" packages="">
<Appenders>
<File name="DragoonLog" fileName="/opt/dragoon/logs/dragoon.log">
<PatternLayout>
<Pattern>%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n</Pattern>
</PatternLayout>
</File>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout
pattern="%highlight{%d [%t] %-5level: %msg%n%throwable}" />
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="DragoonLog"/>
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@ -4,6 +4,6 @@ import org.apache.logging.log4j.LogManager;
public class Logger { public class Logger {
public static org.apache.logging.log4j.Logger logger = LogManager.getLogger(); public static org.apache.logging.log4j.Logger logger = LogManager.getRootLogger();
} }

View File

@ -4,7 +4,7 @@ import org.apache.commons.cli.*;
public class Cmd { public class Cmd {
private String configPath = "/etc/dragoon/config.toml"; private String configPath = "~/.config/dragoon.toml";
public Cmd(String[] args) throws ParseException { public Cmd(String[] args) throws ParseException {
Options options = new Options(); Options options = new Options();

View File

@ -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();

View File

@ -9,9 +9,9 @@ import org.apache.commons.cli.ParseException;
public class CmdTest { public class CmdTest {
@Test @Test
public void shouldDefaultToEtc() throws ParseException { public void shouldDefaultToHome() throws ParseException {
Cmd cmd = new Cmd(new String[]{}); Cmd cmd = new Cmd(new String[]{});
assertTrue(cmd.getConfigPath().equals("/etc/dragoon/config.toml")); assertTrue(cmd.getConfigPath().equals("~/.config/dragoon.toml"));
} }
} }