2

I am trying to encode batch mkv videos which will give a output with a watermark in it.

But when I add the -vf 840:480 or other resolution (like 720p or 1080p), it don't run but without -vf scale it works fine but I need to set resolution for the video.

Without -vf

for %%I in ("*.mkv") do ffmpeg.exe -i "%%I" -i a.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)'" -map 0 -vf scale=840:480 -codec:v libx264 -preset veryfast -crf 18 -codec:a copy "480\%%~nI.mkv"

With -vf

for %%I in ("*.mkv") do ffmpeg.exe -i "%%I" -i a.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)'" -map 0 -vf scale=840:480 -codec:v libx264 -preset veryfast -crf 18 -codec:a copy "480\%%~nI.mkv"

Please help me with how to run the command with -vf scale

1 Answer 1

0

Use

for %%I in ("*.mkv") do ffmpeg.exe -i "%%I" -i a.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)',scale=840:480[v]" -map [v] -map 0:a -codec:v libx264 -preset veryfast -crf 18 -codec:a copy "480\%%~nI.mkv"

All filters acting upon a stream should be within the same filtergraph.

3
  • for %%I in ("*.mkv") do ffmpeg.exe -i "%%I" -i a.png -filter_complex "[0:v][1:v] overlay=25:25:enable='between(t,0,20)',scale=840:480[v]" -map 0 -codec:v libx264 -preset veryfast -crf 18 "Temp480\%%~nI.mkv" I tried to change the code and tried to us this but id didn't worked Commented Jun 29, 2018 at 12:41
  • You need to add -map [v] and change -map 0 to -map 0:a
    – Gyan
    Commented Jun 29, 2018 at 12:48
  • thanks mana... can you also look into this one superuser.com/questions/1335196/… Commented Jun 29, 2018 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.