How to watermark all files in folder with ffmpeg? (Windows)
I'm using the following command to resize and watermark videos: ffmpeg -i "input video.mp4" -s 640x480 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "output video.mp4"
With this command I have to add each video line by line. How can I simply do the same thing to all videos in a directory, and specify an output folder? I'm using Windows.
windows video ffmpeg
add a comment |
I'm using the following command to resize and watermark videos: ffmpeg -i "input video.mp4" -s 640x480 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "output video.mp4"
With this command I have to add each video line by line. How can I simply do the same thing to all videos in a directory, and specify an output folder? I'm using Windows.
windows video ffmpeg
add a comment |
I'm using the following command to resize and watermark videos: ffmpeg -i "input video.mp4" -s 640x480 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "output video.mp4"
With this command I have to add each video line by line. How can I simply do the same thing to all videos in a directory, and specify an output folder? I'm using Windows.
windows video ffmpeg
I'm using the following command to resize and watermark videos: ffmpeg -i "input video.mp4" -s 640x480 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "output video.mp4"
With this command I have to add each video line by line. How can I simply do the same thing to all videos in a directory, and specify an output folder? I'm using Windows.
windows video ffmpeg
windows video ffmpeg
asked Jul 9 '16 at 14:36
JayJay
13
13
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You're looking for a batch shell script. For windows you can use:
for %%a in ("C:pathtodirectory*.mp4") do ffmpeg -i "%%a" -s 640x480 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "C:pathtooutput_directory%%~na.mp4"
pause
Just paste the above in your terminal after updating your paths to files, of course.
Good Luck
add a comment |
Finally got this working after monkeying around with this for a few tries.
This is what I came up with that works great..
1) I put the following files/folders INSIDE the same folder with ALL of the videos I want to be watermarked.
a) ffmpeg
b) an empty output folder named "newfiles"
c) the intended watermark image named "watermark-image.png"
d) the batch file named "watermark.bat"
2) Place the following code into the bat file:
for %%a in ("*.mp4") do ffmpeg -i "%%a" -i watermark-image.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -codec:a copy "newfiles%%~na.mp4" pause
3) Works perfectly! This script will do your entire folder of videos at once.
Thanks to the contributors before me that I pieced this together from.
PS:
i. I sized my watermark png to the exact dimensions of my video for simple perfect
logo placement.
ii. Operating System: Windows 10
Kindly, Brandon
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1098840%2fhow-to-watermark-all-files-in-folder-with-ffmpeg-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You're looking for a batch shell script. For windows you can use:
for %%a in ("C:pathtodirectory*.mp4") do ffmpeg -i "%%a" -s 640x480 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "C:pathtooutput_directory%%~na.mp4"
pause
Just paste the above in your terminal after updating your paths to files, of course.
Good Luck
add a comment |
You're looking for a batch shell script. For windows you can use:
for %%a in ("C:pathtodirectory*.mp4") do ffmpeg -i "%%a" -s 640x480 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "C:pathtooutput_directory%%~na.mp4"
pause
Just paste the above in your terminal after updating your paths to files, of course.
Good Luck
add a comment |
You're looking for a batch shell script. For windows you can use:
for %%a in ("C:pathtodirectory*.mp4") do ffmpeg -i "%%a" -s 640x480 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "C:pathtooutput_directory%%~na.mp4"
pause
Just paste the above in your terminal after updating your paths to files, of course.
Good Luck
You're looking for a batch shell script. For windows you can use:
for %%a in ("C:pathtodirectory*.mp4") do ffmpeg -i "%%a" -s 640x480 -vf "movie=watermark.png [watermark]; [in][watermark] overlay=main_w-overlay_w-10:main_h-overlay_h-10 [out]" "C:pathtooutput_directory%%~na.mp4"
pause
Just paste the above in your terminal after updating your paths to files, of course.
Good Luck
answered Jul 30 '16 at 4:46
KalabaazKalabaaz
1
1
add a comment |
add a comment |
Finally got this working after monkeying around with this for a few tries.
This is what I came up with that works great..
1) I put the following files/folders INSIDE the same folder with ALL of the videos I want to be watermarked.
a) ffmpeg
b) an empty output folder named "newfiles"
c) the intended watermark image named "watermark-image.png"
d) the batch file named "watermark.bat"
2) Place the following code into the bat file:
for %%a in ("*.mp4") do ffmpeg -i "%%a" -i watermark-image.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -codec:a copy "newfiles%%~na.mp4" pause
3) Works perfectly! This script will do your entire folder of videos at once.
Thanks to the contributors before me that I pieced this together from.
PS:
i. I sized my watermark png to the exact dimensions of my video for simple perfect
logo placement.
ii. Operating System: Windows 10
Kindly, Brandon
add a comment |
Finally got this working after monkeying around with this for a few tries.
This is what I came up with that works great..
1) I put the following files/folders INSIDE the same folder with ALL of the videos I want to be watermarked.
a) ffmpeg
b) an empty output folder named "newfiles"
c) the intended watermark image named "watermark-image.png"
d) the batch file named "watermark.bat"
2) Place the following code into the bat file:
for %%a in ("*.mp4") do ffmpeg -i "%%a" -i watermark-image.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -codec:a copy "newfiles%%~na.mp4" pause
3) Works perfectly! This script will do your entire folder of videos at once.
Thanks to the contributors before me that I pieced this together from.
PS:
i. I sized my watermark png to the exact dimensions of my video for simple perfect
logo placement.
ii. Operating System: Windows 10
Kindly, Brandon
add a comment |
Finally got this working after monkeying around with this for a few tries.
This is what I came up with that works great..
1) I put the following files/folders INSIDE the same folder with ALL of the videos I want to be watermarked.
a) ffmpeg
b) an empty output folder named "newfiles"
c) the intended watermark image named "watermark-image.png"
d) the batch file named "watermark.bat"
2) Place the following code into the bat file:
for %%a in ("*.mp4") do ffmpeg -i "%%a" -i watermark-image.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -codec:a copy "newfiles%%~na.mp4" pause
3) Works perfectly! This script will do your entire folder of videos at once.
Thanks to the contributors before me that I pieced this together from.
PS:
i. I sized my watermark png to the exact dimensions of my video for simple perfect
logo placement.
ii. Operating System: Windows 10
Kindly, Brandon
Finally got this working after monkeying around with this for a few tries.
This is what I came up with that works great..
1) I put the following files/folders INSIDE the same folder with ALL of the videos I want to be watermarked.
a) ffmpeg
b) an empty output folder named "newfiles"
c) the intended watermark image named "watermark-image.png"
d) the batch file named "watermark.bat"
2) Place the following code into the bat file:
for %%a in ("*.mp4") do ffmpeg -i "%%a" -i watermark-image.png -filter_complex "overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -codec:a copy "newfiles%%~na.mp4" pause
3) Works perfectly! This script will do your entire folder of videos at once.
Thanks to the contributors before me that I pieced this together from.
PS:
i. I sized my watermark png to the exact dimensions of my video for simple perfect
logo placement.
ii. Operating System: Windows 10
Kindly, Brandon
answered Dec 28 '18 at 8:32
BrandonBrandon
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1098840%2fhow-to-watermark-all-files-in-folder-with-ffmpeg-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown