VideoHelp Forum
+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Lone soldier Cauptain's Avatar
    Join Date
    Jan 2006
    Location
    Brazil
    Search Comp PM
    Hi all,

    I'm having a hard time and would like the help of you guys.

    I have 200 png files and would like to convert each of them into 640x480, 30 second mp4 video.

    How to do in batch mode?



    Claudio
    Quote Quote  
  2. There are a million threads here on how to do that with ffmpeg in a batch file.
    Quote Quote  
  3. Lone soldier Cauptain's Avatar
    Join Date
    Jan 2006
    Location
    Brazil
    Search Comp PM
    I know this jagabo and I know how to do it.

    Code:
    ffmpeg -r 30 -loop 1 -i %d.png -c:v libx264 -t 30 -pix_fmt yuv420p out.mp4
    The problem is I dont know how to keep the png file name equal to mp4 on batch. Like "exodus.png = exodus.mp4"

    This is my doubt.



    Claudio
    Quote Quote  
  4. Use the CLI's FOR loop processing.

    Code:
    for %%a in ("*.png") do "g:\program files\ffmpeg\bin\ffmpeg.exe" -y -loop 1 -i "%%a" -vf scale=w=640:-2 -c:v libx264 -preset veryfast -tune stillimage -pix_fmt yuv420p -t 30.0 -r 30.0 "%%~na.mp4"
    That will give you 640xY where Y is the correct height (mod 2) to retain the aspect ratio.
    Last edited by jagabo; 21st Aug 2018 at 20:51.
    Quote Quote  
  5. Lone soldier Cauptain's Avatar
    Join Date
    Jan 2006
    Location
    Brazil
    Search Comp PM
    Originally Posted by jagabo View Post
    Use the CLI's FOR loop processing.

    Code:
    for %%a in ("*.png") do "g:\program files\ffmpeg\bin\ffmpeg.exe" -y -loop 1 -i "%%a" -vf scale=w=640:-2 -c:v libx264 -preset veryfast -tune stillimage -pix_fmt yuv420p -t 30.0 -r 30.0 "%%~na.mp4"
    That will give you 640xY where Y is the correct height (mod 2) to retain the aspect ratio.
    Thank u again Jagabo. Has made a convert.cmd and work like a charm.


    Claudio
    Quote Quote  
  6. If you want 640x480 regardless of the source image's aspect ratio:

    Code:
    for %%a in ("*.png") do "g:\program files\ffmpeg\bin\ffmpeg.exe" -y -loop 1 -i "%%a" -vf scale=640x480,setsar=1/1 -c:v libx264 -preset veryfast -tune stillimage -pix_fmt yuv420p -t 30.0 -r 30.0 "%%~na.mp4"
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!