Skip to content

Commit

Permalink
Allow previews on video with no audio
Browse files Browse the repository at this point in the history
  • Loading branch information
KillerX committed Dec 1, 2023
1 parent 44cff68 commit 114c75e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion services/transcode/preview.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,17 @@ func Preview(input PreviewInput, progressCallback ffmpeg.ProgressCallback) (*Pre
"+level",
"-y",
}
if hasVideo {

if hasVideo && !hasAudio {
params = []string{
"-i", input.FilePath,
"-ss", "0.0",
"-i", previewWatermarkPath,
"-filter_complex", "sws_flags=bicubic;[0:v]split=1[VIDEO-main-.mp4];[VIDEO-main-.mp4]scale=-2:540,null[temp];[temp][1:v]overlay=0:0:eof_action=repeat[VIDEO-.mp4]",
"-map", "[VIDEO-.mp4]",
"-c:v", encoder,
}
} else if hasVideo {
params = []string{
"-ac", "2",
"-ss", "0.0",
Expand Down

0 comments on commit 114c75e

Please sign in to comment.