bun
bun copied to clipboard
piping stdout to stdin doesn't work
const adb = Bun.spawn(
[
"adb",
"exec-out",
"screenrecord",
"--time-limit=5",
"--output-format=h264",
"-",
],
{
onExit({ exitCode }) {
console.log("adb exited with code", exitCode);
},
}
);
const ffmpeg = Bun.spawn(
["ffmpeg", "-i", "-", "-c:v", "copy", "-f", "mp4", "video.mp4"],
{
stdin: adb.stdout,
onExit({ exitCode }) {
console.log("ffmpeg exited with code", exitCode);
},
}
);
const ffmpeg = Bun.spawn(
^
TypeError: Unsupported ReadableStream type
code: "ERR_INVALID_ARG_TYPE"
Originally reported on Discord: piping stdout to stdin doesn't work
this is a crash in debug. i'm going to add a better error in a pr but:
I've run into this one, too: TODOError: Re-enable ReadableStream support in spawn stdin.