ffmpeg-cli-wrapper
ffmpeg-cli-wrapper copied to clipboard
stdin && stdout
Could you please tell me if your project support stdin and stdout to process image stream using ffmpeg ? My ffmpeg command is like this
ffmpeg -y -f image2pipe -vcodec mjpeg -r 24 -i - -vcodec mpeg1video -f mpegts -q:v 0 -
I viewed you code, but didn't find the way.
In terms of syntax: you can use addStdoutOutput() and addInput("-"). Your command would look like this:
new FFmpegBuilder()
.overrideOutputFiles(true)
.setFormat("image2pipe")
.addExtraArgs("-vcodec", "mpjeg")
.addExtraArgs("-r", "24")
.addInput("-")
.addStdoutOutput()
.setVideoCodec("mpeg1video")
.setFormat("mpegts")
.setVideoQuality(1)
.done()
.build();
I didn't set the -q:v arg (VideoQuality) to zero because you would get the following exception: java.lang.IllegalArgumentException: quality must be positive
Thanks for you answer! I've finished my work several weeks ago using a similar approach.