Results 1 to 3 of 3

Thread: How to exacting audio from video files

  1. #1
    Join Date
    Aug 2012
    Beans
    1

    How to exacting audio from video files

    I have a bunch of video files from which I want to extract their audio tracks. I could do it by using ffmpeg and converting them all to ogg files for example:
    Code:
    ffmpeg -i video -vn audio.ogg
    But is there a way to extract the audio without having to re-encode it again.

  2. #2
    Join Date
    Oct 2010
    Location
    London
    Beans
    481
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: How to exacting audio from video files

    Yes, just use -acodec copy

    ffmpeg -i input.mp4 -acodec copy -vn output.m4a

    Of course, depending on what the audio stream is, you will need to use different file extensions. If the audio is AAC (most MP4 and FLV files use AAC), then m4a will be perfectly fine. Obviously, if the audio track is an MP3, just use the mp3 extension. If in doubt, you can use .mka, which should allow any kind of audio stream.

    You can find out what the audio stream is by looking at the properties in nautilus file manager (under the audio/video tab) or by reading the output of

    ffmpeg -i input.mp4

  3. #3
    Join Date
    Aug 2012
    Beans
    104

    Re: How to exacting audio from video files

    As evilsoup has suggested you need to identify the audio codec first before extracting the audio stream. When you use a bare commandline as you have demonstrated you run the risk of exposing your audio stream to the sometimes unsympathetic FFmpeg defaults. Meaning your audio stream may be inappropriately lowered in quality.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •