How to watermark all files in folder with ffmpeg? (Windows)












0















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.










share|improve this question



























    0















    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.










    share|improve this question

























      0












      0








      0








      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jul 9 '16 at 14:36









      JayJay

      13




      13






















          2 Answers
          2






          active

          oldest

          votes


















          0














          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






          share|improve this answer































            0














            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






            share|improve this answer























              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
              });


              }
              });














              draft saved

              draft discarded


















              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









              0














              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






              share|improve this answer




























                0














                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






                share|improve this answer


























                  0












                  0








                  0







                  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






                  share|improve this answer













                  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







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jul 30 '16 at 4:46









                  KalabaazKalabaaz

                  1




                  1

























                      0














                      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






                      share|improve this answer




























                        0














                        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






                        share|improve this answer


























                          0












                          0








                          0







                          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






                          share|improve this answer













                          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







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 28 '18 at 8:32









                          BrandonBrandon

                          1




                          1






























                              draft saved

                              draft discarded




















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              Paul Cézanne

                              UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

                              Angular material date-picker (MatDatepicker) auto completes the date on focus out