Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputStream instead of File #1

Open
AeonDave opened this issue Sep 10, 2021 · 3 comments
Open

InputStream instead of File #1

AeonDave opened this issue Sep 10, 2021 · 3 comments

Comments

@AeonDave
Copy link

Hello!
how can i use an InputStream as input in the "setInput" option?
like defined in the audiowaveform example:
$ ffmpeg -i test.mp4 -f wav - | audiowaveform --input-format wav --output-format dat -b 8 > test

thank you

@marc7806
Copy link
Owner

Hello @AeonDave ,
Currently only objects from type java.io.File can be passed as parameter for the "setInput" function. As a workaround you could write the inputstream into an temporary File object and pass this into the function...

@AeonDave
Copy link
Author

hello and Thank you!
it's a good workaround for the input, but how to use the output as string?
exactly as in the example above: "--output-format", if format is json, no file is created and there is only an array of numbers.
thank you for your work

@marc7806
Copy link
Owner

Hi @AeonDave,
you can define the output to be a json file via setOutput(new File("path/to/myJsonOutput.json")) function. You could then read the json output file with for example Jacksons ObjectMapper class to an string or java class.

Hope this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants