Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Linux Workflow: Audio Clips from Video

  1. #1

    Linux Workflow: Audio Clips from Video

    Windows sucks and Ocenaudio is a bloated pile of spyware, but...

    On my old windows box, pulling soundclips from a video was straightforward if overly demanding of system resources:

    1) Open video with Ocenaudio and it would automatically parse as a waveform

    2) Make my trim

    3) Listen a couple times to be sure there were no speaker pops or other issues

    4) Export as .mp3 or whatever

    5) Carry on with life

    Ocenaudio did take too long to boot, constantly nagged me to update, and undoubtedly glowed in the dark but it worked efficiently enough.

    On my Linux box, I have not found an equivalent. Ocenaudio is available but misses the spirit of lightweight programs, particularly when part of the operating system selection was to reduce system resource demands while working. It is also completely broken with my current distribution set-up as it is.

    ffmpeg is a straighforward and lightweight terminal program to convert video to audio but I'd have to type full file pathways with extensions then separately edit the audio to get my clip. Complete pain. Using VLC to extract the audio would utilize a graphical interface but is a cludgy menu sytems and the resultant audio is sometimes garbage. Firing up a full digital audio workstation would be overkill and many don't play nicely with video files.

    I'm about to read a bit regarding Snd and SNDBITE to see if either can open a video file for direct audio clipping.

    Any of you have better suggestions? Keeping in mind that I am in the desert with Artix because systemD and its developer should be pitched into the nearest volcano. I am also married to freeware, preferably open source and properly audited, but that's admittedly asking a lot.

  2. #2
    Tactical Nobody Guerrero's Avatar
    Join Date
    Jun 2017
    Location
    Milwaukee
    Couldn't you use VLC?
    "The victor is not victorious if the vanquished does not consider himself so."
    ― Ennius

  3. #3
    I could but it's inconsistent to the point it often mangles the audio. It's how I'm currently limping along but a more streamlined and reliable process would burn much less of my day.

    Edit: For context, I'm usually sifting through 10+ hours of assorted source audio per week that needs varying levels of clipping for half a dozen archival and production projects.

  4. #4
    Re: typing the path and extension most terminals in ubunbu-based distros let you drag and drop a file from into a terminal window and it will paste the fully qualified pathname in single quotes.

    So if you have ffmpeg installed you could do something like this:

    Code:
    #!/bin/bash
    
    ffmpeg -i "$1" -vn -acodec copy out.$2
    ffmpeg -i out.$2 -ss $3 -to $4 -c copy final.$2
    name it "trim.sh", chmod +x it, then in a terminal type

    Code:
    ./trim.sh 'NO TYPING JUST DRAG AND DROPPED FILE.avi' mp3 20 40
    and the above script will spit out a 20 second long mp3 file with audio cut starting at time 00:00:20 to 00:00:40

    Just type "./trim.sh" then drag and drop your video file in the terminal, then type what you want the output format to be (e.g. mp3) and type the starting and ending time (in seconds)

    If you always want mp3 and don't want to change output audio formats (e.g. aac/m4a/etc) you can get rid of one script argument and you'll only need to type out the start and end time. I tested it with an old avi file of looney tunes and it worked as expected.

  5. #5
    Quote Originally Posted by jh9 View Post
    ...drag and drop a file from into a terminal window and it will paste the fully qualified pathname in single quotes.

    So if you have ffmpeg installed...
    Drag and drop worked and I'm amazed I hadn't thought of it, before:

    Name:  tenor.gif
Views: 213
Size:  48.6 KB

  6. #6
    Site Supporter EricM's Avatar
    Join Date
    Jan 2012
    Location
    Midwest
    Audacity uses ffmpeg to import audio from video files, not exactly a lightweight solution but would give you everything in one place if it works on your system.

  7. #7
    Audio from video's is something that is on my learn list. A few years back when I had more time to learn, I was trying to learn about using Wget for this.

  8. #8
    Quote Originally Posted by EricM View Post
    Audacity uses ffmpeg to import audio from video files, not exactly a lightweight solution...
    I've used Audacity in various settings since its release* but the boot time, interface, menu system, metadata form, and conversion time are just too inefficient for this use.

    Tweak the suggested script to work on my computer (tried it as-writ and coded, will need to actually look at it a bit later), use that to get my rough cuts, and trim/level them in Audacity or something lighter seems the way to go, right now.


    * And now need to find an alternative as the 3-series release officially becomes corporate spyware. I have the latest 2-series release saved away and will limp forward with it until it becomes unworkable on a computer. Might see if Reaper will work with my duct tape and bubblegum Artrix install.

  9. #9
    I've still yet to tweak the script posted above or find a more reasonable simple DAW so crude trimming and conversion with ffmpeg before hitting a heavier audio workstation like Audacity/Ardour/Reaper has been the interim solution.

    Quote Originally Posted by beenalongtime View Post
    Audio from video's is something that is on my learn list. A few years back when I had more time to learn, I was trying to learn about using Wget for this.
    ffmpeg has been very good to me with various video formats but I've only converted to MP3, so far. Example of MP4 to MP3:

    ffmpeg -i *filename*.mp4 -vn *filename*.mp3
    "-vn" helps it run quickly as it disregards the video file rather than the alternative where it processes both then deletes the video.

  10. #10
    kdenlive is another that can do it with a gui

User Tag List

Posting Permissions

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