VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. 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
    Quote Quote  
  2. 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
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    use -i for multiple inputs,
    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'?

    Note, ffmpeg has some bugs with raw avc input for mkv muxing (you should use mkvmerge) , but ffmpeg is fine for mp4 muxing
    I'm inputting an uncompressed file for turning into avc, so that's not a problem right?
    (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)
    Quote Quote  
  4. 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
    Quote Quote  
  5. 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
    Quote Quote  



Similar Threads

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