Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pipe FFMPEG to GNUPlot on Windows

280 views
Skip to first unread message

squareblu...@gmail.com

unread,
Feb 26, 2015, 4:44:04 PM2/26/15
to
I am trying to get the example given on the FFMPEG website (URL below) working on a Windows machine

https://trac.ffmpeg.org/wiki/Create%20a%20Waveform%20Image%20from%20an%20Audio%20Stream

The issue seems to come around the syntax for pipes on Windows. What research I have done shows that the more recent gnuplot builds support pipes - so my question is for the following Linux formatted command, what would be the correct Windows one...

ffmpeg -i in.wav -ac 1 -filter:a aresample=8000 -map 0:a -c:a pcm_s16le -f data - | \
gnuplot -p -e "plot '<cat' binary filetype=bin format='%int16' endian=little array=1:0 with lines;"

When I run this - I get...

/bin/sh: cat: command not found

Presumably because the '<cat' is not valid as the pipe source on Windows.

Any help hugely appreciated!

Ethan A Merritt

unread,
Feb 26, 2015, 7:15:09 PM2/26/15
to
Invocation of "cat" isn't needed under linux either.

I think in both cases you want

... | gnuplot -p -e "plot '-' ..."

However you may have trouble piping binary files to gnuplot for some
plotting modes, particulary matrix data. This is because gnuplot will
try to do lseek() within the file and that won't work for a pipe.

Ethan

James Gibson

unread,
Mar 7, 2015, 8:03:07 PM3/7/15
to
Ethan,

Many thanks - can confirm that works. Example command for others looking at getting this working on Windows...

C:\utils\ffmpeg -i C:\utils\B662C688-54C2-4314-A287-6206AE77DCE5.m4a -ac 1 -filter:a aresample=8000 -map 0:a -c:a pcm_s16le -f data - | gnuplot -p -e "set terminal png size 5000,500; set output 'waveform.png'; unset key; unset tics; unset border; set lmargin 0; set rmargin 0; set tmargin 0; set bmargin 0; plot '-' binary filetype=bin format='%int16' endian=little array=1:0 with lines;"
0 new messages