Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques At my wit’s end….. Need info on using ffmpeg to convert mp3 and image to mp4

  • At my wit’s end….. Need info on using ffmpeg to convert mp3 and image to mp4

    Posted by James Robinson on October 5, 2019 at 1:16 am

    Hello all.
    I have combed the internet, tried everything suggested, and am in dire need of help.

    I am trying to add a jpg file to an mp3 and convert it to an mp4 to put on a DVD.

    I am using multiple files (both mp3 and jpg) in a directory, as follows:

    MP3 files: (48 kbps, 24000 Hz, Mono)
    nwt_60_1Pe_E_01.mp3
    nwt_60_1Pe_E_02.mp3
    nwt_60_1Pe_E_03.mp3
    etc, etc.

    JPG files from mp3 tag: (600×600, 600 dpi)
    nwt_60_1Pe_E_01.jpg
    nwt_60_1Pe_E_02.jpg
    nwt_60_1Pe_E_03.jpg
    etc., etc

    My goal is : (Video: 600×600, Data rate: 47 kbps, Total Bitrte: 157 kbps, FPS: 25; Audio 110 kbps, 24,000 Hz, Mono)
    nwt_60_1Pe_E_01.mp4
    nwt_60_1Pe_E_02.mp4
    nwt_60_1Pe_E_03.mp4
    etc, etc.

    I need the command line to count the total # of MP3’s and convert them automatically.

    Thank you all very much in advance for your help.

    James Robinson

    James Robinson replied 4 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Lou Logan

    October 9, 2019 at 6:49 pm

    ffmpeg can’t do this by itself. You need to use additional features present in your shell/command line.

    The answer depends on what you are using, but you didn’t mention your OS.

    For Linux or macOS you can use a Bash for loop:

    for f in *.jpg; do ffmpeg -framerate 25 -loop 1 -i "$f" -i "${f%.*}.mp3" -c:v libx264 -vf format=yuv420p -c:a aac -movflags +faststart -shortest "${f%.*}.mp4"; done

    If you’re on Windows refer to cmd, batch file, or PowerShell help resources regarding a “for loop” or whatever the Windows equivalent is.

  • James Robinson

    October 9, 2019 at 7:09 pm

    Lou,

    Thank you for your response. I am using Windows 7.

    I will give it my best shot, but may be back….

    Thank you again,

    James

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy