using ffmpeg command line with python's subprocess module

Chris Angelico rosuav at gmail.com
Mon Dec 2 16:25:01 EST 2013


On Tue, Dec 3, 2013 at 8:19 AM, Ben Finney <ben+python at benfinney.id.au> wrote:
> Chris Angelico <rosuav at gmail.com> writes:
>
>> On Mon, Dec 2, 2013 at 10:34 PM, iMath <redstone-cold at 163.com> wrote:
>> > ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c copy output.wav
>> > ffmpeg -f concat -i <(printf "file '%s'\n" ./*.wav) -c copy output.wav
>> > ffmpeg -f concat -i <(find . -name '*.wav' -printf "file '%p'\n") -c copy output.wav
>>
>> In bash, the <(...) notation is like piping: it executes the command
>> inside the parentheses and uses that as standard input to ffmpeg.
>
> Not standard input, no. What it does is create a temporary file to
> contain the result, and inserts that file name on the command line. This
> is good for programs that require an actual file, not standard input.

Ah, sorry, my bad - bit rusty on my arcane bashisms. In any case, the
general point of what I was saying is: Figure out what's happening,
and replicate that. In this case, that means creating a file, then,
rather than putting it on stdin - that's probably actually easier
anyway.

ChrisA



More information about the Python-list mailing list