FFMPEG Add Audio to Video - Single and Multitrack

Поділитися
Вставка
  • Опубліковано 26 сер 2024
  • FFMPEG Add Audio to Video - Single and Multitrack
    How to add one or many audio tracks to a video using ffmpeg.
    In this video we go over how to add audio from an mp3 file source or from a video source and copy the audio over to a new video that doesn't have an audio track.
    We follow on by adding a second audio track to a video making it a dual audio track movie and changing the order of the audio tracks within the video.
    Finally we change which audio track is marked as default, this has the effect of being the audio track that video player chooses to play.
    Subscribe: www.youtube.co...
    Blog: www.linuxleech.com
    Twitter: / linuxleech
    Facebook: / linuxleech
    Google+: www.gplus.to/li...

КОМЕНТАРІ • 28

  • @Autm_wind
    @Autm_wind 7 місяців тому

    Thank you friend.
    I was really searching for a simple way to do it.

  • @daddy.69.
    @daddy.69. 3 роки тому +2

    That's the video i was searching... Great work👏👏

  • @ShrikantNimbalkarD
    @ShrikantNimbalkarD 3 роки тому +2

    Thanks, You taught a great tutorial for multitrack however I want to add multiple audios in single track one after another as my video is longer than audio so I have to combine more than 3 audios one after another to create a full 20 min video merged with audio. Your help is so much appreciated 👏👏 Thanks Again!

  • @vijayragavan606
    @vijayragavan606 4 роки тому +2

    Great video with proper explanation, hope you make more videos and good luck mate

  • @realjames4
    @realjames4 7 місяців тому

    Straight forward, tysm

  • @FPSdougan
    @FPSdougan 4 роки тому

    this solves a problem i had with ffmpeg - thanks

  • @NorbertdeRooy
    @NorbertdeRooy 9 місяців тому

    Not what I was looking for but helpful nonetheless.
    I was actually looking to add audio (comment to the same stream).
    So I already have audio inside a video, but I want to add my audio commentary on top of that (and as a bonus maybe set the volume of the audio commentary.

  • @amosnimos
    @amosnimos 2 роки тому

    nice very helpful tips

  • @mpsii
    @mpsii 5 років тому +1

    What do you do if you want bot audio tracks to play simultaneously. For example, using background music with audio commentary

    • @linuxleech
      @linuxleech  5 років тому +2

      You can get mpv to play two audio tracks simultaneously. like this:
      mpv --lavfi-complex='[aid1][aid2]amix[ao]' NameOfYourVideoFile.mp4
      If however your intention is to create a new video file with the audio mixed into a single track you could do this.
      ffmpeg -i two-tracks.mp4 -filter_complex '[0:1][0:2] amix=inputs=2:duration=longest[ao]' -c:v copy -map 0:0 -map "[ao]" audio-mixed.mp4

  • @rezaalimorady5010
    @rezaalimorady5010 3 роки тому

    please explain about chunks . how chunks will be handle?
    for example we have a video that contain a video and sound .
    we have an audio contain a sound .
    i found how merge them by this video. but don't know about how chunks will works.

  • @vishalupadhyay5651
    @vishalupadhyay5651 5 років тому +1

    Hello Sir, Nice video and nice explanation. You have solved my issue. But have another query like, i have 3 audio in video file and want to keep only 1 audio as default. i tried it but its automatically set default other 2 audio files.Please help me on this. Thank you

    • @linuxleech
      @linuxleech  5 років тому

      Assuming you want to set the second audio stream to default only.
      ffmpeg -i yourVideo.mp4 -c copy -map 0:0 -map 0:1 -map 0:2 -map 0:3 -disposition:a:0 comment -disposition:a:1 default -disposition:a:2 comment yourNewOutputFile.mp4
      If you try that and run ffprobe on the new file, you will have the second audio stream set to default and the first and third audio streams will have the default label removed.
      If you want the third audio track to be default just put comment for -disposition:a:1 and default for -disposition:a:2.

  • @rocking1star
    @rocking1star 4 роки тому

    hi, we are merging different video files in which some video files have no audio in between. and this creates an issue in final single clip as audio gets asynchronization.

  • @huongvu6714
    @huongvu6714 5 років тому

    nice video , hope you have more tutorial like that

  • @WeekdayJones
    @WeekdayJones 4 роки тому

    Brilliant thanks mate!

  • @usbps2id
    @usbps2id 3 роки тому

    thanks bro

  • @johnsamuel4539
    @johnsamuel4539 4 роки тому

    Do you have anything on audio? i mean to overlay one short audio on a long mp3 file

  • @amitanshugupta
    @amitanshugupta 3 роки тому

    If my audio file is of .aac formate then what will be the change in command. Anyone can help?

  • @robinreso6240
    @robinreso6240 4 роки тому

    hi, finally understanding some basics of ffmpeg..thx a lot.Do you know how to do a insert edit (b-roll) but do it without transcoding?
    avisynth maybe?offcourse with minimal as posible scriptingcoding?concatenate and trimming works great for super fast and simple editing,just wanted to throw some b-roll editing in de mix without transcoding.

  • @albaricleta
    @albaricleta 4 роки тому

    Thanks! c:

  • @Manuirurzun
    @Manuirurzun 4 роки тому

    Great video. Is it possible to do this in Python?

    • @InnerEagle
      @InnerEagle 3 роки тому

      If you import the ffmpeg module inside python you can play with it inside python, so yea

  • @victorr-name
    @victorr-name 3 роки тому

    Вместо -map 0:0 -map 0:1 -map 1:0 ... ets. - Nado 2 String.
    Step 1: Delete audio stream ( -an ) from video.mp4
    Step 2: Add new audio.

  • @ErnestoJrTV
    @ErnestoJrTV 4 роки тому

    How to add 3 or more audio on a video ?

    • @albaricleta
      @albaricleta 4 роки тому +3

      Is the same way. In -map the first number is the number of file an the second number is the stream of this file. So, '-map filenumber:streamnumber'. For four audios on a video, its like that:
      'ffmpeg -i video.mp4 -i audio1.mp3 -i audio2.mp3 -i audio3.mp3 -c copy -map 0:0 (file 0 file 1 is file 0, the first file of the input it's named file 0 ; stream 0, generally video stream, the first stream of a file is named stream 0) -map 0:1 (file 0, stream 1, this is the audio stream of the originally video) -map 1:0 (file 1, stream 0 of file 1, audio files generally has one stream, the stream 0) -map 2:0 (file 2, stream 0) -map 3:0 (file 3, stream 0) output.mkv'

  • @oumoumadbrahim1875
    @oumoumadbrahim1875 4 роки тому

    Add Audio to Video
    # ffmpeg -i video.mp4 -i audio.mp3 -c copy -shortest output.mp4

  • @simonbuysse8559
    @simonbuysse8559 3 роки тому

    Why give a wrong answer first, was really annoying