Somewhat related to this question: Convert audio files to mp3 using ffmpeg
I want to execute a command in one line using piping in BASH.
What I am trying to do is this:
echo "Hello" | somecommand | ffmpeg -i _____ -f mp2 output.mp3
Where the _____
is the output of somecommand
. Is there any way to achieve this?
Try using xargs
echo "Hello" | somecommand | xargs ffmpeg -f mp2 output.mp3 -i
or
echo "Hello" | somecommand | xargs -i ffmpeg -i {} -f mp2 output.mp3
You can use command substitution here in the middle argument:
ffmpeg -i "$(echo 'Hello' | somecommand)" -f mp2 output.mp3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With