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
+ Reply to Thread
Results 1 to 5 of 5
-
-
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
-
@poisondeathray
-map 0:0 -map 0:1
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"
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.
-
@ 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
Similar Threads
-
Can I force ffmpeg to transcode 59.94 frames to display at 25 frames per se
By oduodui in forum EditingReplies: 4Last Post: 28th Apr 2018, 09:24 -
Need help with encdoing (ripping frames and then re-combine them)
By zanzar in forum Newbie / General discussionsReplies: 26Last Post: 3rd Feb 2018, 17:35 -
[SOLVED] [ffmpeg] How to combine multiple items in -vf ?
By yetanotherlogin in forum EditingReplies: 10Last Post: 26th Aug 2017, 12:12 -
Simple software powered by FFmpeg to combine audio and video track
By adelta in forum Video ConversionReplies: 3Last Post: 24th Jun 2017, 11:23 -
how to combine encrypted ts files using ffmpeg(hls protocol)
By asdasdqqq in forum Video Streaming DownloadingReplies: 9Last Post: 29th Aug 2016, 06:12