Skip to content

Commit

Permalink
feat: Rename commands
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanSkraba committed Dec 7, 2024
1 parent b4046d6 commit ff94047
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ case class Ffmpeg(
lazy val streamInfo: ujson.Obj = ujson
.read(
osProc(
Ffprobe,
FfprobeCmd,
Seq("-v", "quiet"),
Seq("-print_format", "json"),
Seq("-show_format", "-show_streams"),
Expand Down Expand Up @@ -110,7 +110,7 @@ case class Ffmpeg(
def frameChunkInfo(start: String, end: String, keyFramesOnly: Boolean = false): ujson.Arr = ujson
.read(
osProc(
Ffprobe,
FfprobeCmd,
Seq("-v", "quiet"),
if (keyFramesOnly) Seq("-skip_frame", "nokey") else Seq(),
Seq("-print_format", "json"),
Expand Down Expand Up @@ -489,12 +489,12 @@ object Ffmpeg {
val FfmpegCmd: String = "ffmpeg"

/** The command to call to run the Ffmpeg CLI. */
val Ffprobe: String = "ffprobe"
val FfprobeCmd: String = "ffprobe"

/** Determine if all of the commands have been installed. */
val enabled: Boolean = {
import scala.sys.process._
try { s"$FfmpegCmd -version".! == 0 && s"$Ffprobe -version".! == 0 && s"$InkscapeCmd --version".! == 0 }
try { s"$FfmpegCmd -version".! == 0 && s"$FfprobeCmd -version".! == 0 && s"$InkscapeCmd --version".! == 0 }
catch { case _: Exception => false }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ object CountdownTask {
val Description = "Generate a countdown timer from a template."

/** The command to run Inkscape on the CLI */
private val Inkscape: String = "inkscape"
private val InkscapeCmd: String = "inkscape"

/** The command to run Ffmeg on the CLI */
private val Ffmeg: String = "ffmeg"
private val FfmegCmd: String = "ffmeg"

/** Represents the countdown video.
*
Expand Down Expand Up @@ -111,7 +111,7 @@ object CountdownTask {
private lazy val execCache = collection.mutable.Map[String, File]()

private def execInkscape(f: Int, src: String, dst: String): Unit = {
Seq(Inkscape, "-w", dx.toString, "-h", dy.toString, src, "--export-filename", dst).!!
Seq(InkscapeCmd, "-w", dx.toString, "-h", dy.toString, src, "--export-filename", dst).!!
if ((f + 1) % frameRate == 0) {
if (f / frameRate % 10 == 0) print(f / frameRate)
else print("x")
Expand All @@ -121,7 +121,7 @@ object CountdownTask {
private def execFfmpeg(dst: File): Unit = {
println(".")
Seq(
Ffmeg,
FfmegCmd,
"-y",
"-framerate",
frameRate.toString,
Expand Down

0 comments on commit ff94047

Please sign in to comment.