summaryrefslogtreecommitdiff
path: root/app/app.go
diff options
context:
space:
mode:
authorHeinrich 'Henrik' Langos <gumbo2000@noreply@mills.io>2023-02-12 11:20:18 +0100
committerHeinrich 'Henrik' Langos <gumbo2000@noreply@mills.io>2023-02-12 12:23:49 +0100
commitb15f62a49ebd371e2bbbbe46e12b7931d8e6bd8e (patch)
tree5f78584a37195cd51012ec2aedc66b84f95fecef /app/app.go
parentd2786bed20980b0dae1212006cfca52ec4a63bfb (diff)
chore: Reorder arguments to ffmpeg
Diffstat (limited to 'app/app.go')
-rw-r--r--app/app.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/app.go b/app/app.go
index 3028edf..f44375d 100644
--- a/app/app.go
+++ b/app/app.go
@@ -394,7 +394,6 @@ func createScaledVideo(videoFile string, scaledVideoFile string,
timeout,
"ffmpeg",
"-y",
- "-i", videoFile,
"-s", size,
"-c:v", "libx264",
"-c:a", "aac",
@@ -403,6 +402,7 @@ func createScaledVideo(videoFile string, scaledVideoFile string,
"-loglevel", "verbose",
"-metadata", fmt.Sprintf("title=%s", videoTitle),
"-metadata", fmt.Sprintf("comment=%s", videoDescription),
+ "-i", videoFile,
scaledVideoFile,
); err != nil {
err := fmt.Errorf("error transcoding video: %w", err)
@@ -420,13 +420,13 @@ func createVideo(videoFile string, transcodedVideoPath string,
timeout,
"ffmpeg",
"-y",
- "-i", videoFile,
"-vcodec", "h264",
"-acodec", "aac",
"-strict", "-2",
"-loglevel", "quiet",
"-metadata", fmt.Sprintf("title=%s", videoTitle),
"-metadata", fmt.Sprintf("comment=%s", videoDescription),
+ "-i", videoFile,
transcodedVideoPath,
); err != nil {
err := fmt.Errorf("error transcoding video: %w", err)
@@ -445,13 +445,13 @@ func createThumbnail(videoFile string, thumbnailPath string,
if err := utils.RunCmd(
timeout,
"ffmpeg",
- "-i", videoFile,
"-y",
"-vf", "thumbnail",
"-t", fmt.Sprint(secondsFromStart),
"-vframes", "1",
"-strict", "-2",
"-loglevel", "quiet",
+ "-i", videoFile,
thumbnailPath,
); err != nil {
err := fmt.Errorf("error generating thumbnail: %w", err)
@@ -906,7 +906,10 @@ func (a *App) videoHandler(w http.ResponseWriter, r *http.Request) {
if ok {
id = path.Join(prefix, id)
}
-
+ log.
+ WithField("Method", r.Method).
+ WithField("RequestURI", r.URL).
+ Debug(r)
log.Printf("/v/%s", id)
m, ok := a.Library.Videos[id]