Thanks to instruction on another thread, I learned how to encode a video file to a mkv file.
Meanwhile, I figured out how to encode the audio from a WAV file to a mka file.
But I don't see in the ffmpeg documentation how to specify two input files, do the desired encoding of both and write to a single mkv. Can someone point me in the right direction?
Thanks,
—John
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
-
use -i for multiple inputs, and use the -map option to specify what streams are desired, and -c:v , -c:a for video and audio codecs specifically (or "copy" for stream copy)
http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20use%20-map%20option
http://stackoverflow.com/questions/12938581/ffmpeg-mux-video-and-audio-from-another-vi...-mapping-issue
Note, ffmpeg has some bugs with raw avc input for mkv muxing (you should use mkvmerge) , but ffmpeg is fine for mp4 muxing -
So just use more than one -i option?
I already have -c:v libx264 in one command line and -acodec libvo_aacenc for the other. So if I have only one stream of each kind available (one in each -i file) then would I still need a complex 'map'?
(Earlier when I did the audio and video separately I did indeed use mkvmerge to put them together into the final output. That's the step I'm hoping to avoid) -
Yes, just use -i more than once for each input ; you don't need a map if the inputs only have 1 stream. map options are used when the inputs have multiple streams and you might select some from each . It's not a problem with uncompressed input (currently only an issue with rawavc input for mkv muxing)
e.g
Code:ffmpeg -r 24000/1001 -i video.avi -i audio.wav -c:v libx264 -crf 18 -c:a libvo_aacenc -b:a 128k output.mkv
-
Using the guidance from this thread, I'm happily using ffmpeg with Davinci Resolve and Audacity.
I had a funny problem though, on one instance. The audio ended up being 8 seconds longer than the video. I did the aac encoding and the avc encoding separately, and then used mkvmerge, and that was fine.
The previous message mentions a muxing issue with "rawavc input". But I was reading an uncompressed WAV file for the -i, and writing aac. Is this a known issue, or does this fall outside of the known issues?
—John
Similar Threads
-
Encode with FFMPEG with multiple input files...
By RogerTango in forum Video ConversionReplies: 3Last Post: 20th Jun 2011, 01:12 -
very basic question: can I burn a DVD from video_rm & video_ts files?
By glitterla in forum MacReplies: 3Last Post: 25th Feb 2010, 12:09 -
Basic FFMpeg Command question (m2t to mov)
By fitch.j in forum Video ConversionReplies: 10Last Post: 27th Nov 2009, 13:49 -
FFMPEG - Loop input video
By frifox in forum Video ConversionReplies: 2Last Post: 12th Nov 2009, 18:25 -
Very basic question...... how can I merge mpeg files and make a movie
By True Colors in forum Newbie / General discussionsReplies: 5Last Post: 30th Oct 2009, 16:45