Reading binary data from commands stdout #4143
Unanswered
RudolfVonKrugstein
asked this question in
Questions & support
Replies: 1 comment
-
I can't say I've tried this myself, so I can't help much. You may have more luck asking the Erlang folks as they know more about Erlang APIs. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am trying to decode and load an mp3 as PCM Data (running on beam).
As I have not found any library for doing so, so I decided to use
ffmpeg
for that.What works is, converting the mp3 to PCM using ffmpeg (with erlangs
cmd
function) to a temporary file and loading hat file.But now I would like to avoid the temporary file, and directly read the the data from ffmpeg stdout (ffmpeg can output to stdout using "-" as filename).
But I am unable to read the binary data form ffmpeg stdout, because all ways of running system commands seem to not work in some way.
For example when running
cmd
the output is much shorted than expected.I guess that might be because of decoding to utf8, but I dont know.
Any Idea what a good way of doing this would be?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions