Closed 0x7FFFFFFFFFFFFFFF closed 3 years ago
Seems like the same issue as this one: https://stackoverflow.com/questions/34611742/how-do-i-read-the-output-of-a-child-process-without-blocking-in-rust. If the final output is larger than default kernel pipe size, it will block.
Thanks for the link. I've read it but still now sure how to handle the issue. Do you have any suggestions?
Btw, I just tried the stdlib Command and it completes without any issue. I use the following command.
let output = Command::new(r##"ffmpeg"##)
.arg(r##"-i"##)
.arg(r##"input.mp4"##)
.arg(r##"-i"##)
.arg(r##"a2.png"##)
.arg(r##"-ss"##)
.arg(r##"00:00:00"##)
.arg(r##"-to"##)
.arg(r##"00:01:00"##)
.arg(r##"-y"##)
.arg(r##"-filter_complex"##)
.arg(r##"overlay=x=263:y=752"##)
.arg(r##"-c:a"##)
.arg(r##"copy"##)
.arg(r##"-max_muxing_queue_size"##)
.arg(r##"9999"##)
.arg(r##"-nostdin"##)
.arg(r##"testtttt.mp4"##)
.output()?;
Since cmd_lib is a wrapper around stdlib Command
, it is possible there is something wrong with cmd_lib's logic?
Yes, the fix should be in cmd_lib. After adding logging support, the generated code will a little different than your above code. I just made some changes, you can check if it fixes your problem. thanks.
Yes, the fix should be in cmd_lib. After adding logging support, the generated code will a little different than your above code. I just made some changes, you can check if it fixes your problem. thanks.
Thanks, it works now. Sorry for the late response. I can't find the issues tab the other day.
I have a ffmpeg command to process a video file.
ffmpeg -i 4.mp4 -i a2.png -ss 00:00:00 -to 00:01:00 -y -filter_complex "overlay=x=263:y=752" -c:a copy -max_muxing_queue_size 9999 -nostdin testtttt.mp4
It runs very well when being executed in a terminal. But when I run it with
cmd_lib::spawn_with_output
, it never ends and the program just stuck there. This is my program.Is there something I'm doing wrong? Thanks.