Results 1 to 5 of 5

Thread: extracting, cleaning and re merging audio

  1. #1
    Join Date
    Apr 2005
    Beans
    104
    Distro
    Ubuntu 12.10 Quantal Quetzal

    extracting, cleaning and re merging audio

    I'm working on some videos with bad background noise. I'm using Openshot to edit the clips. I was hoping the audio track would be separate in the Openshot UI so I could extract it, clena it up in Audacity and then re-import.

    Are there any tools that allow this to be done simply? I love commandline until I'm talking video, sound, codecs and bitrates!

    thanks

  2. #2
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan Norwich
    Beans
    2,326
    Distro
    Lubuntu 22.04 Jammy Jellyfish

    Re: extracting, cleaning and re merging audio

    ok simple [he says]




    use ffmpeg to separate audio and video first check properties of videofile see if your audio is aac or mp3 and write in accordingly below


    ffmpeg -i audiovideo.mp4 -vn -acodec copy audio.mp3 && ffmpeg -i audiovideo.mp4 -an -vcodec copy videomute.mp4



    you now have both separated and the original still


    take audio mp3 to audacity and play around until happy save it as audio2.mp3







    reassemble with ffmpeg too [ thank you FakeOutdoorsman !]

    ffmpeg -i videomute.mp4 -i audio2.mp3 -c copy newvideowithnewsound.mkv



    ===================================



    or use mencoder here thus

    mencoder -ovc copy -audiofile audio2.mp3 -oac pcm videomute.mp4 -o newfinal.mp4
    but not as good as audio has to be hiked to pcm better ffmpeg here the whole way


    or reassemble in kdenlive [in synaptic]
    Last edited by shantiq; October 21st, 2012 at 08:11 PM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community ie 50 brains are better than one
    Playing with Slackware too now ...
    ShanArt

  3. #3
    Join Date
    Sep 2006
    Beans
    3,713

    Re: extracting, cleaning and re merging audio

    Quote Originally Posted by shantiq View Post
    probably can reassemble with ffmpeg too but not sure how so please add anyone if you do
    Assuming video.mp4 has no audio streams. Newer syntax:
    Code:
    ffmpeg -i video.mp4 -i audio.mp3 -c copy output.mkv
    Older syntax:
    Code:
    ffmpeg -i video.mp4 -i audio.mp3 -vcodec copy -acodec copy output.mkv
    You can output to almost any container that supports your video and audio formats. If video.mp4 has audio, and you only want the video from it while adding the audio from audio.mp3, then you will have to use the -map option. It is explained here: FFmpeg mux video and audio from another video.

  4. #4
    Join Date
    Jul 2009
    Location
    Hippiesoldierstan Norwich
    Beans
    2,326
    Distro
    Lubuntu 22.04 Jammy Jellyfish

    Re: extracting, cleaning and re merging audio

    excellent Fake thanx will edit previous post
    Last edited by shantiq; October 21st, 2012 at 07:56 PM.
    Linux is Latin for off-the-beaten-track
    what I like MOST about our Ubuntu ... The Community ie 50 brains are better than one
    Playing with Slackware too now ...
    ShanArt

  5. #5
    Join Date
    Apr 2005
    Beans
    104
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: extracting, cleaning and re merging audio

    Thanks guys, that seems pretty straight forward - once you are pointed the right way. I'll give it a shot this afternoon when back at the laptop.

Tags for this Thread

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
  •