Seperate video and multitrack audio EASILY with FFMPEG | Guide

Поділитися
Вставка
  • Опубліковано 16 лип 2024
  • Want to import multitrack audio from a video into a project? Want an easier way of separating each track from the video? Well, you can save all separate tracks as separate files quickly using this simple script.
    I use it to remux MKV into MP4, with separate AAC audio files for each layer I'm importing into my Premiere Pro Project.
    Set up FFMPEG on Windows: • How To: Download+Insta...
    Command: ffmpeg -i "input.mp4" -map 0:v -c copy "output.mp4" -map 0:a:0 -c copy "output_0.aac"-map 0:a:1 -c copy "output_1.aac" -map 0:a:2 -c copy "output_2.aac"
    Download the batch file I show: tcno.co/TroubleChute/dl/?dl=A...
    Timestamps:
    0:00 - Explanation
    2:36 - Splitting video and audio tracks
    -----------------------------
    💸 Found this useful? Help me make more! Support me by becoming a member: / @troublechute
    -----------------------------
    💸 Direct donations via Ko-Fi: ko-fi.com/TCNOco
    💬 Discuss video & Suggest (Discord): s.tcno.co/Discord
    👉 Game guides & Simple tips: / troublechutebasics
    🌐 Website: tcno.co
    📧 Need voice overs done? Business query? Contact my business email: TroubleChute (at) tcno.co
    Everything in this video is my personal opinion and experience, and should not be considered professional advice. Always do your own research and make sure what you're doing is safe.

КОМЕНТАРІ • 71

  • @mantra4ia
    @mantra4ia 3 роки тому +8

    This is one of the most helpful videos to me as an ffmpeg beginner. Thank you for making it "human readable."

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

    I finally got this figured out. Thanks for all of the tutorial videos and thank you to the people in the comments who helped me out as well.

  • @QuiniansBudgetCrafts
    @QuiniansBudgetCrafts 3 роки тому +5

    got it sorted! Thank you! Anyone confused as to what's not working right you need to rename the output unless you have a h\temp. I did not so I made it a c:\converson folder

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

      I'm very new to this stuff could you explain what you mean by rename the output?

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

      @@doozie1064 when you edit the text of the auto convert file (right click and edit it should open with note pad) there will be a line that says
      set outname=h:\temp
      Which is his output folder. You'll want to change it to
      set outname=c:\whatever folder you're using
      May not be c: either, depends on the drive you're using as well.. just whatever the file path that AutoConvert file is in

    • @theironnautilus7228
      @theironnautilus7228 2 роки тому +2

      @@QuiniansBudgetCrafts THANK YOU SO MUCH!

  • @theimpendingdoom
    @theimpendingdoom 2 роки тому +1

    Thank you so much. This lesson is an essential step in audio editing.

  • @xDJxGNOMx
    @xDJxGNOMx 2 роки тому +1

    Thanks it worked. All i found online before was overcomplicated gibberish. This is straight to the point.

  • @TdotBB
    @TdotBB 4 роки тому +1

    Super super helpful video! Thank you sir

  • @VaultKid
    @VaultKid 4 роки тому +1

    Thank you dude! You are a legend!

  • @DarkPIugin
    @DarkPIugin 3 роки тому +1

    Works perfectly. Thanks a lot! :)

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

    Fantastic. Thank you so much

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

    Thank you so much!

  • @PeterDB90
    @PeterDB90 3 роки тому +12

    I'm coming as someone who knows nothing about FFMPEG and is hearing about it for the first time, and since it's not an interface that you can use intuitively, I really wish you could at least mention a link or video where we can learn what FFMPEG is and how to use it in order to understand what you did there.

    • @PeterDB90
      @PeterDB90 3 роки тому +7

      Found it! Leaving comment to help out others who are clueless like me and cannot follow smart people like this TroubleChute guy without context :P
      In this video's description, he posted a link to a video where he describes how to set up and use FFMPEG. Click on that video and watch it. I've already had FFMPEG installed for animations in Krita, but did not know beyond that what the program did, so I needed to find out how to USE it, and he explains it in that video I mentioned.
      Basically, in the folder where you have the files that you want to convert, use the template he gave (text in description) and input your own file names, then copy and paste that into the path of your open file explorer window (in other words, the "address bar" if you will) and press enter, and confirm that you want to run the command.
      Apparently (either thanks to FFMPEG or thanks to default windows settings), the address bar/path in the file explorer's window acts like a command prompt into which you can type in commands (which is how you use FFMPEG), so that is why this works.
      For those more savvy than me, help me out and correct me if I got anything wrong.
      Thanks for the video though! Despite having to look up the basics of FFMPEG, this thing is still a lifesaver when it comes to multitrack audio in a video file. I have like 5 different video editors and none of them natively recognize multiple audio tracks in a video file. Thank you for this video!

    • @PeterDB90
      @PeterDB90 3 роки тому +3

      One more thing, if this helps anyone:
      I record using Streamlabs, and I record on 3 audio channels. The first channel combines voice and desktop audio, the second channel is only desktop audio, and the third channel is only voice audio. The reason I do that is so that I have 1 channel that combines all audio (and this needs to be the main channel) so that if I do not need to separate voice and other audio, I can simply move forward with the file I already have since most video editors will at the very least recognize the first/main audio channel (usually "0") without a problem. Also because for streaming you can only choose to stream 1 audio track, so having one that's combined will alleviate that issue. If you want to work on the other audio channels, then simply extract ONLY the 2nd and 3rd audio channels. It takes a while to extract depending on file size, and video only makes things slower, so if you can help it, do NOT extract video and simply extract the audio that your video editor can't see, then add that audio separately. More efficient to use original video (which will have video and audio 1) and only extract audio 2 and audio 3, giving you access in total to video, audio 1, audio 2, and audio 3.

    • @doozie1064
      @doozie1064 3 роки тому +3

      @@PeterDB90 Hello! I'm very late to the party but I was wondering what you meant by imputing your own file names? As in for output orrrrr what? I'm honestly very confused and I keep getting a "no such file or directory" prompt when I try and run the command

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

      @@doozie1064
      My apologies - I see how it could be confusing - what I meant was look in the video description - you’ll see he gave you an example of the text to use under “Command:” - you need to copy that text and paste it in your file explorer’s address, but obviously you don’t want to leave it with file names such as “input.mp4”, you need to change those file names to match your own, so if you have a file called my_video.mp4, you need to change “input.mp4” to my_video.mp4 (no quotes). Do the same thing for output files but keep in mind that output files will be created, so you can name them whatever you want, just make sure the extension (portion after the dot) remains the same. So “output.aac” could be something like my_video_audio_1.aac
      Also make sure you don’t put quotes around the file names like he has

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

      @@PeterDB90 okay I'll definitely have to give this a go tomorrow but thank you!

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

    Thhank's Homie you're a G!

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

    You are a hero

  • @ChristianVegaSimpson
    @ChristianVegaSimpson 3 роки тому +1

    Thanks for all your help with ffmpeg. I was wondering if there was a way to convert a 5.1 audio track into 6 mono streams using ffmpeg? I want Adobe Premiere to read it as one audio file with 6 mono streams in it versus one 5.1 audio track.

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

    Thank you, Sir

  • @JaswiL-_51
    @JaswiL-_51 Рік тому

    THANK YOU

  • @lulifz
    @lulifz Рік тому

    TY nice video!

  • @Pattyinthewoods
    @Pattyinthewoods 4 роки тому +1

    Hey, love the video,however it doesent work for me. Could i have some assistance ? Really trying to get this going but it just wont budge.

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

    It worked with my most recent video, but now all of a sudden, the discord audio is less than half of what was recorded, and, I think this is a kdenlive issue but idk where else to go, when I rewind the video in the preview, the audio doesn't go back with the video.

  • @juliusthedemonater
    @juliusthedemonater 9 місяців тому +1

    If you want each of the sets of files to be put into their own folder, the below will do this for you, with edits to the file destinations
    @echo off & setlocal enabledelayedexpansion
    for %%v in ("*.mp4") do (
    set FileName=%%v
    set name=!FileName:~0,-4!
    mkdir E:\"TEST OUTPUT"\"!name!"
    set outname=E:\TEST OUTPUT\!name!\!name!
    echo Remuxing: !name! to !outname!
    ffmpeg -i "!FileName!" -map 0:v -c copy "!outname!.mp4" -map 0:a:0 -c copy "!outname!_0.aac" -map 0:a:1 -c copy "!outname!_1.aac"
    )
    pause

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

    Please help me, I installed the ffmpeg program with your latest tutorial and all that works. I installed your batch file from your website but now I am stuck. I click open/run and it just says press any key to continue and then closes... nothing happens. What am I missing?

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

      Nvm sorted it! YOU ARE THE BEST!

    • @AlphaKHILADI
      @AlphaKHILADI 2 роки тому +2

      @@StuGaming Please Tell Me How

  • @LMac519
    @LMac519 4 місяці тому +1

    I'm getting an error saying ffmpeg is not a thing. How to fix?

  • @EnrickHendric
    @EnrickHendric 9 місяців тому +1

    im getting a error which says file doesnt exiat why is that happening?

  • @sarabertoni5331
    @sarabertoni5331 Рік тому

    Hello! I'm having a big problem... When I try to convert a .mkv file to .mp4 the audio track glitches and everything I get is white noise. This happens either if I keep the video and the audio tracks stitched together and if I split them. This are the code strings that I use:
    ffmpeg -i filename.mkv -b:a 320k filename.mp4
    ffmpeg -i filename.mkv -map 0:v -c copy filename.mp4 -map 0:a:2 -b:a 320k -c copy filename_2.wav

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

    hello, excellent video.
    I would like you to give me a little help.
    I have a .mvk file that has multiple languages, I am converting it to hls but when I play the m3u8 the video comes out without audio. Can you tell me the appropriate layer to be able to transcode a video in .mkv to hls and that I can select the different audio tracks
    Thank you

  • @IslandboyPlayz
    @IslandboyPlayz 3 роки тому +1

    4:18 It keeps saying no files or dictionary when I copy the command I the cmd

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

    i am doing it as you showed ( i also downloaded the ffmpeg with the new methos and it is working) and when i open the files it says that i cant play them because they are destroyed or the type is not supported and they have 0 byte
    what can i do
    and the cmd says this
    Stream map '0:a:2' matches no streams.
    To ignore this, add a trailing '?' to the map.
    NEVERMIND I DIT IT
    I PUTTED AN ? TO THAT

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

    how do you make the audio files become mp3 instead of aac

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

    I copied the command from the video description and got an error "Unable to find a suitable output format for 'output_0.aac-map'". Turns out that there is a space missing between "output_0.aac" and the next -map command

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

      know its way late but youre a lifesaver dude

  • @Alanah-t3p
    @Alanah-t3p 2 роки тому +2

    Don't know the first thing about any of this stuff but I'm trying to learn.
    I'm getting an error for "no such file or directory" for the MP4 output copy of my mkv. What's going on here?
    That error means that file doesn't exist right? But it's supposed to create it lol, that's why it doesn't exist... Idk what's going on. Please help

    • @Madvisionn
      @Madvisionn Рік тому

      me too ughh

    • @CecularQueendom
      @CecularQueendom Рік тому

      @@Madvisionn @Alex-ep9yx did you two change the file location from "H:\Temp"?

    • @Don2Real
      @Don2Real 8 місяців тому

      @@CecularQueendom hey i see your replying to comments and was wondering if you could help me? see i seen your comment about the "instead oh H:\Temp use the file that u want location name and then !
      ame something but i have a problem when i open up auto converter it just says "click to continue..." and when i do it just automatically closes the auto converter

  • @RaiderMasterGames
    @RaiderMasterGames 2 місяці тому

    I am having an issue with cmd saying No such file or directory even though the file does exist and I am using the cmd prompt directly from the folder the file is in. Please help!

  • @slimeinabox
    @slimeinabox 2 місяці тому

    I got the .bat, only changed the names and deleted the third audio output as i only use two tracks.
    the video im testing with is 7:54 long.
    the outputs are:
    mp4: 7:54
    0.aac: 1:29:45
    1.aac: 11:05
    when I try to put them into OpenShot 1.aac gets reduced too 4:54.
    If anyone could explain whats going on I'd greatly appriciate that.

  • @Anriandor
    @Anriandor 4 роки тому +5

    Can you help me solve this problem. I tried it and it worked once but that's it:
    ffmpeg -i "filename.avi" -map 0:v -c copy "output.mp4" -map 0:v:1 -c copy "output_1.mp4" -map 0:a:0 -c copy "outputa_0.aac"
    It's supposed to output 2 videos and 1 audio. For some reason, it outputs 0 KB files which are obviously empty...

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

      See if there is any errors (red text) in the cmd window. I had put the outputs all the way to number 6 and it started an error with number 5 so I deleted the 5 and 6 output commands and it worked

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

      @@Okom1 Wow it actually did what it was supposed to. Crazy how the solution was that simple, after all! Cheers :)

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

    I'm confused Where does the line of code go?? What Program??

  • @jadenn7334
    @jadenn7334 2 роки тому +1

    Everytime i try running the file all it tells me in the cmd is "No such file or directory" i have the output set up correctly so i dont think its that. Im just kind of stumpped as ive never done this shit before
    Edit: I have tried damn near everything to get this to work. Ive tried changing the file names themselves, Ive tried deleting the quotes and then adding them back and over and over its nothing but "No such file or directory" i give up at this point

    • @ConfusedDisc
      @ConfusedDisc 2 роки тому +1

      you need to change h:\temp with your desired folder.

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

    how to get that code file to exist?

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

    I tried editing the top line of your batch file to target m4v files instead of mkv but got a weird command line error in ffmpeg :/ "H:\Temp\2020-12-19 15-29-02-1.mp4: No such file or directory" though the batch autoconvert is sitting in the same folder as my target video file.

    • @domc246
      @domc246 3 роки тому +1

      I'm assuming you sorted it since then but for anyone else, you need to replace that line with the folder you put it in.

    • @Trelanganack
      @Trelanganack Рік тому +1

      @@domc246 what do you mean? please elaborate

    • @CecularQueendom
      @CecularQueendom Рік тому +1

      @@Trelanganack When you first open AutoConvert --> there should be a part where it says "set outname=H:\Temp\!name!"
      The "H:\Temp" part is the file destination that TroubleChute is using
      You change that part to whatever file destination YOU want by deleting the "H:\Temp," then going to the exact folder you want your remuxed file to go into and clicking on and copying whatever is in the file location bar and pasting that where "H:\Temp" was.
      EX. I changed it from "set outname=H:\Temp\!name!" to "set outname=C:\Users\Celes\Downloads\2023 Content\OBS\REMUX-er\!name!"
      Hope this helps :)

  • @abimael1839
    @abimael1839 3 роки тому +1

    Can we seperate it into else format such as wav, or mp3? If can, how? I try rewrite the aac with wav in the command, but the file cannot be opened at all

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

      I have a similar query. I'm currently working around this by changing replacing ' for %%v in ("*.mkv")' to 'for %%v in ("*.aac")', extracting to a seperate folder, and adding mp3 to the end of outlook. Also changing the command line to: ffmpeg -i "!FileName!" -c:a libmp3lame -ac 2 -b:a 190k "!outname!.mp3"
      Looks like this:
      @echo off & setlocal enabledelayedexpansion
      for %%v in ("*.aac") do (
      set FileName=%%v
      set name=!FileName!
      set outname=C:\Users\Cracklemere\Videos\OBS Footage\Extracted\MP3s\!name!
      echo Remuxing: !name! to !outname!
      ffmpeg -i "!FileName!" -c:a libmp3lame -ac 2 -b:a 190k "!outname!.mp3"
      )
      pause

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

      @@Cracklemere wow thanks a lot, I'm gonna try it too then

  • @wisetone
    @wisetone 3 місяці тому

    Where to find your audio file names let's say forexample a blu-ray disney movie where I got nordic audio tracks too? I don't understand where you got the audio names from? and where do I see it in my mkv file. (Using MakeMKV btw)

    • @wisetone
      @wisetone 3 місяці тому

      Tried this ffmpeg -i c:/users/olive/Videos/AnyStream/S01E02.mp4 -c:v libx265 -pix_fmt yuv420p10le -c:a aac -b:v 2080k -b:a 224k -x265-params profile=main10 outputFile2.mp4 -map 0:a:0 -c copy "swedish.aac" -map 0:a:1 -c copy "danish.aac" -map 0:a:2 -c copy "norwegian.aac" -map 0:a:3 -c copy "english.aac" -map 0:a:4 -c copy "finnish.aac"

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

    I'm getting issues with mine. I take either my mvk or mp4 and do the command in the description. When I remove everything but the video part, it works fine, but including any of the audio part returns this error:
    Invalid audio stream. Exactly one MP3 audio stream is required. Could not write header for output file #1 (incorrect codec parameters ?): Invalid argument Error initializing output stream 1:0 --

    • @WaterTheBoy
      @WaterTheBoy 2 роки тому +1

      Alright, so I fixed that by making the command say m4a instead of aac or mp3. Not sure why that works. The thing is now that it only sees one track. I want to get the desktop sound and my sound, but it keeps both and says other tracks don't exist.

  • @xzchong1429
    @xzchong1429 Рік тому

    for me its hard to work

  • @ProvingUser
    @ProvingUser Рік тому

    This isn't working for me :[

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

    You should probably put it on github. It is going to be so much better

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

    [NULL @ 0000028e89e8da40] Unable to find a suitable output format for 'F:\Video\SplitAudio\SplitAudio_0.aac-map'
    F:\Video\SplitAudio\SplitAudio_0.aac-map: Invalid argument

    • @CecularQueendom
      @CecularQueendom Рік тому

      I know it's been two years and you probz figured it out or don't care anymore, but the space was missing between that whole file path and "-map"
      It should be: F:\Video\SplitAudio\SplitAudio_0.aac [SPACE] -map

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

    Good God, I can hear your tongue moving. 😂 relax with this compression, man.

  • @flipiiz
    @flipiiz 6 місяців тому

    This worked on my old computer but on my new computer it no longer works. This is what it says after everytime i run the script:
    Stream map '0:a:1' matches no streams.
    To ignore this, add a trailing '?' to the map.
    Failed to set value '0:a:1' for option 'map': Invalid argument
    Error parsing options for output file C:\Users\wyatt\Videos\Converted\abc_firefox.aac.
    Error opening output files: Invalid argument
    and this is my code:
    @echo off & setlocal enabledelayedexpansion
    for %%v in ("*.mkv") do (
    set FileName=%%v
    set name=!FileName:~0,-4!
    set outname=C:\Users\wyatt\Videos\Converted\!name!
    echo Remuxing: !name! to !outname!
    ffmpeg -i "!FileName!" -map 0:v -c copy "!outname!.mp4" -map 0:a:0 -c copy "!outname!_discord.aac" -map 0:a:1 -c copy "!outname!_firefox.aac" -map 0:a:2 -c copy "!outname!_mic.aac" -map 0:a:3 -c copy "!outname!_roblox.aac"
    )
    pause
    So... is there a fix? Thanks if anyone replies!