[FFmpeg-trac] #9759(undetermined:new): Output always goes to stderr even when there are no errors.
FFmpeg
trac at avcodec.org
Sun May 1 05:13:50 EEST 2022
#9759: Output always goes to stderr even when there are no errors.
-------------------------------------+-------------------------------------
Reporter: Randall | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: stderr, | Blocked By:
error output |
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
In my code (written in Rust) I'm running an ffmpeg command and checking if
stderr contains text. But when I run a command successfully text is
always output to stderr and nothing comes from stdout. Other command line
tools I've used behave normally with regards to stdout and stderr that my
code uses, so this appears to be a problem with ffmpeg rather than Rust.
How to reproduce:
I run this command to combine a video and audio file:
`ffmpeg -i 'bruh_video.mp4' -i 'bruh_audio.mp4' -c:v copy -c:a aac
'bruh.mp4'`
In Rust that code looks like
```
let output =
Command::new("sh") //(Command is std::process::Command)
.arg("-c")
.arg(&format!("ffmpeg -i '{}' -i '{}' -c:v copy -c:a aac
'{}'", video_filepath, audio_filepath, final_filepath))
.current_dir(&dl_folder)
.output()
.expect("failed to execute ffmpeg process");
let stdout = String::from_utf8(output.stdout).unwrap();
let stderr = String::from_utf8(output.stderr).unwrap();
```
The stdout will be empty but stderr will contain all the normal output
text.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9759>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list