VideoHelp Forum




+ Reply to Thread
Results 1 to 24 of 24
  1. Is there is some program or command line for ffmpeg\mencoder that can do just this.
    Choose a file and extract the audio to the same format as the original without encoding.

    There are many program that can do that but they are all with big gui windows and tons of settings\features that you must set before doing something that simple.

    I mainly extract audio from flv and mp4
    Quote Quote  
  2. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    Have you tried Pazera Free Audio Extractor ?
    Quote Quote  
  3. Yes(before)but that yet another gui with tons of features and things that you must set.
    I already have programs that have many features and can extract audio

    Format Factory
    XMedia Recode
    VideoToVideo
    AviDemux
    VirtualDub

    but I wanted something small and fast that extract the audio and that's all(no extra settings requires every time you want to extract something that have different audio format)
    Quote Quote  
  4. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    I haven't seen any very basic gui. But just try ffmpeg then:

    Code:
    ffmpeg -i video.avi -vn -acodec copy audio.mp3
    -vn = no video.
    -acodec copy = copy audio stream.
    Quote Quote  
  5. Yes but that way it will save the file with mp3 extension even if the extension is aac for example.
    I don't really need a gui(I can create it myself)if I can use something with command lines.
    Quote Quote  
  6. I'm a MEGA Super Moderator Baldrick's Avatar
    Join Date
    Aug 2000
    Location
    Sweden
    Search Comp PM
    You must identify the audio codec first. With for example ffmpeg -i video.mp4 and then create the ffmpeg extraction.

    I don't know any command line that extracts all streams automatically to correct container.
    Quote Quote  
  7. Guess I have to run ffmpeg twice then.
    1.Run ffmpeg with -i command line and output the console to text file
    2.Scan that file and get the audio format(output it to variable)
    3.Run ffmpeg again but this time with
    ffmpeg -i video.avi -vn -acodec copy audio."the variable"

    I can do all that with AutoHotkey for example

    And btw,is there is a way to hide the console when I run ffplay?
    Quote Quote  
  8. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    I have created a beta program that may work. It basically calls MediaInfo, reads the codecs and then uses FFMpeg to COPY to the AAC, AC3, etc. formats. I can post a link if you wish to try. It has other bells and whistles and

    is mainly for fixing many FLV file problems but it should extract okay, audio and/or video. I haven't tested it with all the codec formats but it can be easily fixed if one is missing.

    Click image for larger version

Name:	ScreenHunter_22 Aug. 29 08.32.jpg
Views:	520
Size:	85.6 KB
ID:	19803

    Click image for larger version

Name:	ScreenHunter_22 Aug. 29 08.41.jpg
Views:	457
Size:	94.7 KB
ID:	19804
    Click image for larger version

Name:	ScreenHunter_22 Aug. 29 08.42.jpg
Views:	280
Size:	36.9 KB
ID:	19805
    Quote Quote  
  9. Member ozok's Avatar
    Join Date
    Oct 2011
    Location
    Turkey
    Search Comp PM
    You can use TAudioConverter. Just select "Extract Audio" as method. If you have more than one audio stream in an audio, you must select the one you wanted extracted.
    Quote Quote  
  10. Member
    Join Date
    Mar 2011
    Location
    Nova Scotia, Canada
    Search Comp PM
    I've extracted aac from flv's a number of times using ffmpeg or avconv, but not on this machine I'm using now so the docs I used aren't at hand. But it isn't hard.

    Just google ffmpeg extract aac or something thereabouts, which is what I did. It took less time than waiting for a response on a forum.
    Quote Quote  
  11. I used to extract ac3 from dvd rip as under:
    $enim$> mplayer dvd.vob -aid 128 -dumpaudio -dumpfile audio.ac3
    you can try this with different videos, just change audio file extension in accordance with media info.
    Let's say tube.mp4 video
    Try...
    mplayer tube.mp4 -aid xxx -dumpaudio -dumpfile audio.m4a (xxx in accordance with mediainfo.)
    Last edited by enim; 29th Aug 2013 at 11:58.
    Quote Quote  
  12. Extracting is easy,but setting the correct extension requires running one extra step(either run ffmpeg one more time or use some external program)
    It would be nice if there was a program that can extract the audio in one go but.
    I already made the gui with AutoHotkey and I can extract the audio and save it with the correct extension
    Quote Quote  
  13. Member ozok's Avatar
    Join Date
    Oct 2011
    Location
    Turkey
    Search Comp PM
    Did you even try TAudioConverter!?
    Quote Quote  
  14. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Taudioconvert and mine, are at least 2 that extract in one shot. Did you just wish to write it with autohotkey to begin with? I don't understand why yiou
    Asked for suggestions if you don't try them?
    Quote Quote  
  15. ozok - sorry but how exactly this is any different than using one of the programs I mentioned or with ffmpeg.
    The program is using tons of extra encoders\decoders,have fancy looking gui that takes time to load and have a lot of features which I actually didn't ask for and it's more than 70mb.
    Sorry but don't you think that a little too much if you just want to extract audio from video

    Get the file audio channel extension=>dump the audio to a file with that extension...that's all

    You could say that this is all I needed
    ffmpeg -i video.avi
    ffmpeg -i video.avi -vn -acodec copy audio.mp3
    I have ffmpeg on 3 places on my pc

    Also for some strange reason,when I use Add=>File it doesn't show any of the flv\mp4 files I have(no matter what I choose from File of Types)but if I use,File=>Add Folder then all of the files are added

    Even going to "C:\WINDOWS\Media" don't show anything on any File of Types modes
    I'm on Windows XP x86 and used the portable version of the program.

    And also my MediaInfo and right click=>Info says the channel is AAC but it's saved as m4a

    Budman1 - I had to use google to find your site(your didn't post a link)and when I enter the site the first time,I didn't saw anything for download.
    The next time I tried,I actually used the horizontal scroll bar and then I saw the links(for some reason the site is really wide and you can't tell that there is anything for download until you use the horizontal scrollbar...usually you have to scroll down to see if there is something for download and you can't see it at first glance)

    Ok now I'm in the site and I see the links but on both links I get.
    We could not retrieve this file because the link is invalid.
    So in the end,there is no way for me to test your suggestion

    Here is the AutoHotkey code that does exactly what I asked for
    Code:
    DetectHiddenWindows,on
    #NoTrayIcon
    ffmpeg = %A_Desktop%\bin\ffmpeg.exe
    stdoutFile = %A_Temp%\ffmpeg\stdout.txt
    stderrFile = %A_Temp%\ffmpeg\stderr.txt
    Gui,+AlwaysOnTop +ToolWindow
    Gui,Add,Text,Center w80 h15,
    Gui,Show,Center w160 h40,Extract Audio
    Return
    
    GuiClose:
    ExitApp
    
    GuiDropFiles:
    Loop,Parse,A_GuiEvent,`n
    {
    SplitPath,A_LoopField,,Dir,,Name
    GuiControl,,Static1,% Name
    Run,%ComSpec% /k ""%ffmpeg%" "-i" "%A_LoopField%" 1>"%stdoutFile%" 2>"%stderrFile%" ",,Hide
    Process,Wait,ffmpeg.exe,2
    Process,WaitClose,ffmpeg.exe,5
    WinClose,AHK_class ConsoleWindowClass
    ReloadF:
    FileRead, stderr, % stderrFile
    If stderr =
    {
    If Error = 3
    {
    Error = 0
    Continue
    }
    Sleep,1000
    Error += 1
    GoTo,ReloadF
    }
    Loop,Parse,stderr,`n
    {
    If A_LoopField contains Audio:
    {
    StringGetPos,Pos,A_LoopField,`,
    Ext := SubStr(A_LoopField, PoS - 2, 3)
    Break
    }
    }
    If Ext =
    Continue
    Path = %dir%\%Name%.%Ext%
    GuiControl,,Static1,%Name%`nExtracting
    RunWait,%ffmpeg% -i "%A_LoopField%" -vn -acodec copy "%Path%",,Hide
    Process,WaitClose,ffmpeg.exe,2
    FileDelete,%A_Temp%\ffmpeg\*
    GuiControl,,Static1,Done
    Sleep,1000
    GuiControl,,Static1,
    }
    Return
    Quote Quote  
  16. Member ozok's Avatar
    Join Date
    Oct 2011
    Location
    Turkey
    Search Comp PM
    It is not different than using ffmpeg, it uses ffmpeg anyways. Baldrick suggested what you'll get closest to what you ask and you still say it is too complicated. You make it sound as if it is the most complicated task in the world. Just googling it reveals countless options to you but seem to have a different agenda.

    You sound of the guys who say "There isn't single one software that does what I asked. Oh wait I've already written it!". If you want to promote your software or code, do it directly, don't throw dirt on other software. You don't want skin, disable it. It's too slow to start!? What are you using a calculator of some kind? It's just a GUI, it doesn't do much to take this much time.

    You can use winff if it's not too slow or complicated for you.
    Quote Quote  
  17. Originally Posted by ozok View Post
    Baldrick suggested what you'll get closest to what you ask and you still say it is too complicated.
    Umm,where did I said that,I was just wondering if there was a way to do that in a single step not two...like a command line that first get the info and then use it to extract the audio and use the correct extension.

    And since there is no such command line,I endup using ffmpeg twice...your program is probably doing the same thing too(first get the info using something and the next task would extract the audio...exactly the same thing as my script but without the slow loading gui and extra hdd space).

    Originally Posted by ozok View Post
    If you want to promote your software or code, do it directly, don't throw dirt on other software.
    I could hardly call my script a software...and I'm just saying how X software work here.
    I wanted something simple that does what I asked for and if I needed something with tons of other extras...I already have such software

    Originally Posted by ozok View Post
    You don't want skin, disable it.
    When I do that it start a little faster but while starting some things on the screen are flashing real bad until the gui appear.

    Originally Posted by ozok View Post
    It's too slow to start!? What are you using a calculator of some kind?
    P4 2.8Ghz 6600GT and 1GB ram.
    It takes 7 seconds to load when nothing else it's running.
    When adding files to the gui,every single file is scanned which takes time when you are adding a lot of files
    Quote Quote  
  18. I thought you might be able to brute force it by testing the errorlevel when ffmpeg exits:

    Code:
    :TRYMP3
    "ffmpeg" -i %1 -vn -acodec copy %1.mp3
    IF ERRORLEVEL 1 GOTO TRYAC3
    GOTO END
    
    :TRYAC3
    del %1.mp3
    "ffmpeg" -i %1 -vn -acodec copy %1.ac3
    IF ERRORLEVEL 1 GOTO TRYAAC
    GOTO END
    
    :TRYAAC
    del %1.AC3
    "ffmpeg" -i %1 -vn -acodec copy %1.aac
    IF ERRORLEVEL 1 GOTO TRYWAV
    GOTO END
    
    :TRYWAV
    del %1.aac
    "ffmpeg" -i %1 -vn -acodec copy %1.wav
    IF ERRORLEVEL 1 GOTO GIVEUP
    GOTO END
    
    :GIVEUP
    del %1.wav
    
    :END
    But it turns out that the AAC muxer will mux AC3, and the AC3 muxer will mux AAC, but neither result will play, even after changing the extension.
    Quote Quote  
  19. Member ozok's Avatar
    Join Date
    Oct 2011
    Location
    Turkey
    Search Comp PM
    Yes(before)but that yet another gui with tons of features and things that you must set.
    I already have programs that have many features and can extract audio
    Umm,where did I said that,I was just wondering if there was a way to do that in a single step not two...
    What is step two? Clicking a button? What settings you must set to get TAC To get audio extracted from video without encoding? I think what you don't understand is that when I said extracting, I meant just extracting audio without encoding. I believe this is what others here also meant. Otherwise, you are just dragging your foot.

    I could hardly call my script a software...
    I called "your software or code" not "your software". I don't care what you do, as long as you don't make it sound as though result of hours of developers hard work is crap that can't even do the simplest of task, which you exaggerate.

    When adding files to the gui,every single file is scanned which takes time when you are adding a lot of files
    It is done to determine many things, including what you ask; to get codec of audio to be able to extract it later.

    Also, FYI no extra hdd space is used by TAC while extracting since it is done on the fly.
    Quote Quote  
  20. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    Vsub,
    First , let me say, I think it's phenomenal that you wrote that program that does exactly what you want and in as short a time as you did. I know I am not that good. The only reason I suggested my program is that it does not install, only unzips and to remove extra stuff like FFMpeg, Splash screen, Extra features, etc, takes about 10 minutes and I could even put a Folder link if you wished to YOUR FFmpeg. It is simply a GUI front end for whatever needs running and it is all behind the scenes. You never see the Command window, only the results in the Console window of the program.

    I thought, no install, everything in one place, customizable as how you want, each button one function was what you were asking for and loads in seconds was a great fit for what you asked for.

    As far as finding it on my site... I put in my last post:

    I can post a link if you wish to try.
    because it isn't ON MY Site until I post the one you want. I do appreciate the information that one of the links is dead and I will definitely check that out. Thank You.

    All in all, it is irrelevant since you did such a good job creating what you need and I'm sure it is a better fit since my program is for what I needed to fix downloaded videos and not exactly what you needed.

    Thanks again for the help about my Web Site and I'll make sure it is fixed!
    Budman1
    Quote Quote  
  21. Originally Posted by Budman1 View Post
    ...to fix downloaded videos...
    I actually wanted to check that program to see how it works(what commands is sending)and for what are those FLV Check\Fix buttons.

    I usually "download" videos by coping them from the cache by using VideoCacheView and since that program always saves the files with flv extension(even if it's not flv),I was wondering if that button has something to do with it.

    I also made a script that check the video file to see what is the actual extension and rename it if it's wrong.

    What exactly do you mean by "fix downloaded videos"
    Quote Quote  
  22. Member Budman1's Avatar
    Join Date
    Jul 2012
    Location
    NORTHWEST ILLINOIS, USA
    Search Comp PM
    VSUB, No problem. What the fix program does is either remove Meta Data including the timing which is normally messed up on FLV videos that do not play, seek, replay, stop, etc. or it replaces the Meta Data. It uses Yamdi to remove and FFmpeg to copy and replace the correct data. The check button Runs FLVMeta which the author has just updated with a better checking procedure than Adobes FLVCheck.

    All of these are CLI programs, even MediaInfo that it uses to list the Media Info or get the information for extracting (ffmpeg) or renaming with the information such as "video_avc_aac_1280x640_ whatever is checked.flv". So basically it uses and includes:
    FFMpeg, MediaInfoCLI, FLVMeta, Yamdi, and runs them with invisible Command screen and outputs the data to the console Window.

    Since it is a GUI front end, it is easily modified to run more or less CLIs. I find that a great many FLV's (some people like) downloaded from places like YouTube, have many things wrong that cause play, convert, copy errors. Usually most just need the metadata removed or replaced except for the rare one that needs edited with a hex editor. I just download, check, remove/replace Meta, play with Media Player(Built in) or from your favorite player(button for that too), and rename for the MediaInfo data for easy reference, all from one place.

    It was originally an FLV fixer and is mainly for those but Since it uses FFMpeg, the extract(copy) works on most common video formats by running Media Info and checking the codec and copying the separate files to audio and video and giving it the video name of "Video_VO.FLV(MP4, AVI, etc)" and "Audio_AO.aac(ac3, MP3, etc.) To that end, ALL the files are copied with NEW(Replace Meta) or YAM(Removed Meta) added so the originals are never touched.

    There was also a request to be able to set the Created, Modified, Accessed dates the same as the Original so I added the Checkboxes for those. I also am adding a feature that plays the video with the Frame number and time in milliseconds to make my editing easier.
    Click image for larger version

Name:	ScreenHunter_22 Aug. 30 21.51.jpg
Views:	585
Size:	57.7 KB
ID:	19836

    Finally the link has been corrected on my site to https://files.secureserver.net/0shnbBAMoffC1h but I realize after explaining, it is probably a bit much for what you originally requested and the extraction is currently being tested and alterations made so codecs like AC-3/Mpeg Layer 3 correctly label the audio as AC3/MP3 so they will play with most players. It's a work in progress but it keeps me out of trouble... LOL.

    Thanks
    Budman1
    Quote Quote  
  23. Ok thanks,I'll see if I can use it for something(maybe it will give me some ideas what else I can do the the autohotkey script or change the way he work).
    I've encounter flv files with those kind of problems before so if I encounter them again,I'll check the program
    Quote Quote  
  24. Mostly, if a file isn't MKV and it's a type MKVMergeGUI will open (ie flv and MP4), I use MKVMergeGUI to remux it as an MKV, then I extract the audio from the MKV with MKVCleaver.

    If there's an audio delay relative to the video, MKVCleaver doesn't tell you, so if you need to account for any possible audio delay, you'd need to check the MKV with MediaInfo manually.
    Quote Quote  



Similar Threads

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