1

On Ubuntu 20.04, Csound 6.13.0, ffmpeg 4.2.4 this plays fine:

git clone https://github.com/csound/csound
cd csound
git checkout 92409ecce053d707360a5794f5f4f6bf5ebf5d24
csound examples/xanadu.csd

and I can save to file with:

csound -o xanadu.wav xanadu.csd
ffplay xanadu.wav

or:

csound -W -o stdout xanadu.csd > xanadu-stdout.wav

and even convert from file:

ffmpeg -i xanadu-stdout.wav xanadu-stdout.ogg
ffplay xanadu-stdout.ogg

or:

cat xanadu-stdout.wav | ffmpeg -f wav -i - xanadu.ogg

or:

csound -W -o stdout xanadu.csd | cat > xanadu-cat.wav

So why does this fail from the direct pipe:

csound -W -o stdout xanadu.csd | ffmpeg -f wav -i - xanadu.ogg

or:

csound -W -o stdout xanadu.csd | cat > xanadu-cat.wav
ffmpeg -y -f wav -i xanadu-cat.wav xanadu.ogg

with:

[wav @ 0x56093284c6c0] invalid start code d[163][3][0] in RIFF header
xanadu-cat.wav: Invalid data found when processing input

So it seems that xanadu.wav and xanadu-cat.wav are different:

$ diff -u xanadu.wav xanadu-cat.wav
Binary files xanadu.wav and xanadu-cat.wav differ

and that makes the conversion fail.

I know about:

csound --ogg -o xanadu.ogg xanadu.csd

which does work, but I just want to pipe into ffmpeg for fun.

Also asked at: https://github.com/csound/csound/issues/1408

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
  • Not a ffmpeg problem AFAIK: `csound -W -o stdout xanadu.csd | cat > out.wav`. Note csound message in console: `Output file type changed to IRCAM for use in pipe`, so it is ignoring the `-W` for some reason. (Recommend you put all relevant info in the bug report itself instead of an additional link. As a former bug report viewer, I can tell you such reports require an extra step of work for the reader although it may not seem like it and it may cause your report to get forgotten. Bug fixers always have more bugs than time so make it concise and easy.) – llogan Nov 23 '20 at 19:23
  • ...so I would just show two commands in the bug report: `csound -W -o stdout xanadu.csd > xanadu-stdout.wav` and the one with `cat` along with the complete console output from each. – llogan Nov 23 '20 at 19:25
  • @llogan yes, my tests suggest it is just a csound issue, not ffmpeg. I mentioned that more clearly on the github issue now. – Ciro Santilli OurBigBook.com Nov 23 '20 at 20:15
  • Showing the complete console output from csound would be good. That will show all of the informative details. – llogan Nov 23 '20 at 20:39

0 Answers0