ffmpeg-cli-wrapper
ffmpeg-cli-wrapper copied to clipboard
FFmpegBuilder save Output in memory or stream
trafficstars
I'm trying to encode a video into an audio, and get the output in memory rather tahn writing to a file.
FFmpegBuilder builder = new FFmpegBuilder()
.setInput("input.mp4") // Filename, or a FFmpegProbeResult
.overrideOutputFiles(true) // Override the output if it exists
.addOutput("output.wav") // Filename for the destination
.setFormat("wav") // Format is inferred from filename, or can be set
.setAudioSampleRate(16_000) // at 48KHz
.setAudioChannels(1) // Mono audio
.done();
This saves the result to output.wav, but instead of that I'd like to just keep the output of encoding in memory and do some other operations on that. Something that I'd like is getting the contents of the output (like byte[]). Is it possible without saving the output? This is important because writing temporary file is not an option for me. Thanks.
@anz000 you can use Jaffree. It supports piping to OutputStream (through TCP socket). Check PipeOutput.