How to take a random jpeg and random mp3 to create a video file in ffmpeg? The Next CEO of...

Received an invoice from my ex-employer billing me for training; how to handle?

WOW air has ceased operation, can I get my tickets refunded?

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

Is "for causing autism in X" grammatical?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

RegionPlot of annulus gives a mesh

Why do professional authors make "consistency" mistakes? And how to avoid them?

Can I run my washing machine drain line into a condensate pump so it drains better?

sp_blitzCache results Memory grants

How do scammers retract money, while you can’t?

What connection does MS Office have to Netscape Navigator?

Has this building technique been used in an official set?

How do I transpose the 1st and -1th levels of an arbitrarily nested array?

What can we do to stop prior company from asking us questions?

Why does standard notation not preserve intervals (visually)

Novel about a guy who is possessed by the divine essence and the world ends?

If the heap is initialized for security, then why is the stack uninitialized?

Should I tutor a student who I know has cheated on their homework?

Do I need to enable Dev Hub in my PROD Org?

Complex fractions

If a black hole is created from light, can this black hole then move at speed of light?

What is the result of assigning to std::vector<T>::begin()?

Multiple labels for a single equation

Return the Closest Prime Number



How to take a random jpeg and random mp3 to create a video file in ffmpeg?



The Next CEO of Stack OverflowCannot concatenate videos ffmpegHow to convert multiple mp3 files to mp4 with ffmpeg?How to add a png logo to mp4 video with ffmpeg which can be resize dynamically and cover the whole videoApplying multiple filters and inputs with FFmpegCreating a Batch file to add JPG to MP3 to create AVI for all the files in a folderffmpeg How to create a video from N images applying zoom efect to each imageSyncing two videos with different framerates using FFmpegHow to use ffmpeg to add multiple audio files to the video at a specific time?FFMPEG - How to fade with cycleHow to convert AVI movie to proper Apple itunes compatible movie?












0















I am working on a batch conversion process where I need to add a random picture (a .jpg) on a random .mp3 and make an .mp4 .



This is the code I am using in terminal Mac OS X putting all the .mp3 and the .jpg in the same folder:



for f in *.mp3; do /usr/local/Cellar/ffmpeg/4.1_1/bin/ffmpeg -r 1 -loop 1 -i abc5.jpg  -i "$f" -c:a copy -c:v libx264 -vf scale=1280:720 -shortest "${f%mp3}mp4"; done


It works great, but I don't know how to add another random feature for the .jpg files, so every time I have to put a different .jpg and change name (usually in the file not in the script). I also know this must be something with for ((..., but I don't know how to add it properly.










share|improve this question









New contributor




Francesco Milizia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I am working on a batch conversion process where I need to add a random picture (a .jpg) on a random .mp3 and make an .mp4 .



    This is the code I am using in terminal Mac OS X putting all the .mp3 and the .jpg in the same folder:



    for f in *.mp3; do /usr/local/Cellar/ffmpeg/4.1_1/bin/ffmpeg -r 1 -loop 1 -i abc5.jpg  -i "$f" -c:a copy -c:v libx264 -vf scale=1280:720 -shortest "${f%mp3}mp4"; done


    It works great, but I don't know how to add another random feature for the .jpg files, so every time I have to put a different .jpg and change name (usually in the file not in the script). I also know this must be something with for ((..., but I don't know how to add it properly.










    share|improve this question









    New contributor




    Francesco Milizia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I am working on a batch conversion process where I need to add a random picture (a .jpg) on a random .mp3 and make an .mp4 .



      This is the code I am using in terminal Mac OS X putting all the .mp3 and the .jpg in the same folder:



      for f in *.mp3; do /usr/local/Cellar/ffmpeg/4.1_1/bin/ffmpeg -r 1 -loop 1 -i abc5.jpg  -i "$f" -c:a copy -c:v libx264 -vf scale=1280:720 -shortest "${f%mp3}mp4"; done


      It works great, but I don't know how to add another random feature for the .jpg files, so every time I have to put a different .jpg and change name (usually in the file not in the script). I also know this must be something with for ((..., but I don't know how to add it properly.










      share|improve this question









      New contributor




      Francesco Milizia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I am working on a batch conversion process where I need to add a random picture (a .jpg) on a random .mp3 and make an .mp4 .



      This is the code I am using in terminal Mac OS X putting all the .mp3 and the .jpg in the same folder:



      for f in *.mp3; do /usr/local/Cellar/ffmpeg/4.1_1/bin/ffmpeg -r 1 -loop 1 -i abc5.jpg  -i "$f" -c:a copy -c:v libx264 -vf scale=1280:720 -shortest "${f%mp3}mp4"; done


      It works great, but I don't know how to add another random feature for the .jpg files, so every time I have to put a different .jpg and change name (usually in the file not in the script). I also know this must be something with for ((..., but I don't know how to add it properly.







      ffmpeg mp3 jpeg random






      share|improve this question









      New contributor




      Francesco Milizia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Francesco Milizia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 56 mins ago









      ZygD

      5092631




      5092631






      New contributor




      Francesco Milizia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      Francesco MiliziaFrancesco Milizia

      11




      11




      New contributor




      Francesco Milizia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Francesco Milizia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Francesco Milizia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












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


          }
          });






          Francesco Milizia is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1419236%2fhow-to-take-a-random-jpeg-and-random-mp3-to-create-a-video-file-in-ffmpeg%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Francesco Milizia is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Francesco Milizia is a new contributor. Be nice, and check out our Code of Conduct.













          Francesco Milizia is a new contributor. Be nice, and check out our Code of Conduct.












          Francesco Milizia is a new contributor. Be nice, and check out our Code of Conduct.
















          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%2f1419236%2fhow-to-take-a-random-jpeg-and-random-mp3-to-create-a-video-file-in-ffmpeg%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

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...