VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Using this cmd line



    "e:\upscaled\ffmpeg.exe" -r 25 -i "E:\upscaled\pic%6d.png" -vcodec libx264 -crf 17 -pix_fmt yuv420p -acodec copy upscaled_video.mkv

    I can output an mkv file from individual png files using ffmpeg

    I cannot add audio however and have tried a combination of cmd lines to no avail (where on earth am I going wrong)?




    E:\upscaled\ffmpeg -r 25 -f image2 -s 2048x1152 -i "E:\upscaled\pic%6d.png -i audio.wav" -vcodec libx264 -crf 18 -pix_fmt yuv420p -acodec copy video.mkv
    E:\upscaled\ffmpeg -r 25 -f image2 -s 2048x1152 -i "E:\upscaled\pic%6d.png, audio.wav" -vcodec libx264 -crf 18 -pix_fmt yuv420p -acodec copy video.mkv
    E:\upscaled\ffmpeg -r 25 -f image2 -s 2048x1152 -i "E:\upscaled\pic%6d.png" -i audio.wav -vcodec libx264 -crf 18 -pix_fmt yuv420p -acodec copy video.mkv
    E:\upscaled\ffmpeg -r 25 -f image2 -s 2048x1152 -i "E:\upscaled\pic%6d.png -audio.wav" -vcodec libx264 -crf 18 -pix_fmt yuv420p -acodec copy video.mkv
    Quote Quote  
  2. Complete the videostream first and mux the audio later.
    Quote Quote  
  3. Use -map for each stream , -i for each input file

    numbering starts from zero. File input is in the order of the commandline
    0:0 means 1st input, 1st stream
    1:0 means 2nd input, 1st stream

    Code:
    "E:\upscaled\ffmpeg" -r 25 -f image2 -s 2048x1152 -i "E:\upscaled\pic%6d.png" -i "E:\upscaled\audio.wav" -map 0:0 -map 0:1 -vcodec libx264 -crf 18 -pix_fmt yuv420p -acodec copy video.mkv
    Quote Quote  
  4. @poisondeathray
    -map 0:0 -map 0:1
    I'm confused, shouldn't it be -map 0:0 -map 1:0 here, meaning, first stream of first input, first stream of second input ?
    And is it even necessary since both inputs have only one stream ?

    @Trekmeister
    Question marks in the command line should be placed at the beginning and at the end of a file's path (whether it's the executable or the input / output files), and are required if there's at least one space in the path or name (but they don't break anything if there's no space so it's not a bad habit to always use them, if anything it makes the command a bit clearer as a visible distinction between inputs / outputs and options / switches). They can not encompass several files. So in your test commands, #1, #2 and #4 are wrong for that reason alone.
    Then you typed « E:\upscaled\ffmpeg » but without the .exe extension. Either you type the full path, including the extension, or you can type the name of the executable alone, if and only if, 1) either the executable file in question is located in the same directory as the .bat file (if you're running the command from a .bat batch script), or it is located in the directory currently opened in the command prompt (if running the command from the command prompt, and reaching the intended directory with “CD” commands which stands for “change directory”) ; 2) or the executable file in question is in a directory included in Windows PATH. (See here for an extra trick using LinkShellExtension.)
    So, if I'm not mistaken, the “-map” part above is not required here (although it's good to learn how it works as it's required for more complex tasks), and it should work with this :
    Code:
    "E:\upscaled\ffmpeg.exe" -r 25 -f image2 -s 2048x1152 -i "E:\upscaled\pic%6d.png" -i "E:\path to audio\audio.wav" -vcodec libx264 -crf 18 -pix_fmt yuv420p -acodec copy "E:\intented path for output\video.mkv"
    or, if everything is in the same directory, it can be simplified as :
    Code:
    ffmpeg -r 25 -f image2 -s 2048x1152 -i "pic%6d.png" -i "audio.wav" -vcodec libx264 -crf 18 -pix_fmt yuv420p -acodec copy "video.mkv"
    Last edited by abolibibelot; 16th Dec 2020 at 17:34.
    Quote Quote  
  5. @ abolibibelot - Yes, thanks - the text description is correct, typo in the commandline

    It's not necessary if they are they only streams like this case. It's a good habit to get into when you use containers with multiple streams and orders
    Quote Quote  



Similar Threads

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