Results 1 to 6 of 6

Thread: Piping and redirection of stdout

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

    Piping and redirection of stdout

    I'm piping ffmpeg into sox, which works great. But I want to also redirection stdout to /dev/null.

    Code:
    ffmpeg -i input.mp3 -f mp3 - | sox -t mp3 - output.mp3 &>/dev/null
    The command above still outputs text from ffmpeg.

    While the command below tells me that ffmpeg has failed to pipe the mp3 file to sox.
    Code:
    ffmpeg -i input.mp3 &>/dev/null - | sox -t mp3 - output.mp3

  2. #2
    Join Date
    Nov 2013
    Beans
    Hidden!

    Re: Piping and redirection of stdout

    Hello
    You can try something like :

    ffmpeg -i input.mp3 >/dev/null 2>&1 - | sox -t mp3 - output.mp3

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

    Re: Piping and redirection of stdout

    Quote Originally Posted by jeanjd63 View Post
    Hello
    You can try something like :

    ffmpeg -i input.mp3 >/dev/null 2>&1 - | sox -t mp3 - output.mp3
    Thanks for the suggestion, didn't work and here is the output.

    Code:
    ffmpeg -i input.mp3 >/dev/null 2>&1 - | sox -t mp3 - output.mp3
    sox FAIL formats: can't open input  `-':
    Adding back the "-f mp3" (that you left out) made no difference.

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

    Re: Piping and redirection of stdout

    Hurray, I tried only the 2>&1 thingie and it worked.

    like this:
    <code>ffmpeg -i input.mp3 -f mp3 2>&1 - | sox -t mp3 - output.mp3</code>

  5. #5
    Join Date
    Nov 2013
    Beans
    Hidden!

    Re: Piping and redirection of stdout

    You can try :
    ffmpeg -i input.mp3 -f mp3 - 2>/dev/null | sox -t mp3 - output.mp3

  6. #6
    Join Date
    Dec 2006
    Beans
    7,287

    Re: Piping and redirection of stdout

    I am a little curious as to what you are accomplishing with this? It looks like you are piping andmp3 file into sox and outputting an mp3 file
    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
  •