Results 1 to 4 of 4

Thread: MEncoder pipe into SoX

  1. #1
    Join Date
    Oct 2008
    Location
    Sweden
    Beans
    85
    Distro
    Ubuntu 13.04 Raring Ringtail

    MEncoder pipe into SoX

    I'm trying to pipe audio output from MEncoder into SoX to no avail.

    Code:
    mencoder -aid 1 input.avi -of rawaudio -oac mp3lame -ovc copy | \
    sox -t mp3 - output.mp3 gain -3
    The input is an avi file with 3 different audiotracks and I've only found mencoder able to extract specific tracks.
    I've been at this for hours, looking at documentation of both mencoder and sox, but can't determine where the problem lies.
    The mp3-format isn't a nessecity for me, any format (preferably lossless) with a succesful pipe will suffice.

    Any help would be much appreciated.
    Last edited by Valpskott; February 28th, 2014 at 11:52 PM. Reason: Further info

  2. #2
    Join Date
    Dec 2006
    Beans
    7,349

    Re: MEncoder pipe into SoX

    Quote Originally Posted by Valpskott View Post
    Any help would be much appreciated.
    Well, it has been a long time since I have used MEncoder (I suspect you would be better using FFmpeg) but you could always try:

    Code:
    mencoder  -really-quiet -aid 1 input.avi -of rawaudio -oac mp3lame -ovc copy -o - | \
    sox -t mp3 - output.mp3 gain -3
    I apologise for not testing this...
    You think that's air you're breathing now?

  3. #3
    Join Date
    Oct 2008
    Location
    Sweden
    Beans
    85
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: MEncoder pipe into SoX

    Ohh, so I had to put "-o -" in the mencoder command. I thought "-" was sox own syntax, but it seemed to work. Thank you very very much.
    On a side note, I usually use ffmpeg, but while writing the script I found someone saying ffmpeg only have support for one audio-stream and the avi files I create have 3 individual audio-streams (one stereo for game sounds/music, one mono for my voice, one mono for skype).

  4. #4
    Join Date
    Dec 2006
    Beans
    7,349

    Re: MEncoder pipe into SoX

    Good to hear that my lucky guess paid off . With FFmpeg you should be able to select whichever stream you want with the -map option, perhaps make another thread along this line and the Forum's FFmpeg experts might help out?
    You think that's air you're breathing now?

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
  •