arthenica / ffmpeg-kit

FFmpeg Kit for applications. Supports Android, Flutter, iOS, Linux, macOS, React Native and tvOS. Supersedes MobileFFmpeg, flutter_ffmpeg and react-native-ffmpeg.
https://arthenica.github.io/ffmpeg-kit
GNU Lesser General Public License v3.0
4.52k stars 603 forks source link

Unexpected logging using FFprobeKit with 'ffmpeg-kit-react-native' #1040

Closed alecmanfre closed 1 week ago

alecmanfre commented 2 months ago

Description When running FFprobeKit, I am attempting to suppress any logging, however in my console the entire output gets logged out.

Expected behavior I would expect not to see anything in my console except for things I explicitly log out with console.log. I even am trying to suppress the log level by using "quiet" / -8.

To Reproduce Here is my command: const command = -loglevel -8 -print_format json -show_format -show_streams -select_streams v "${filePath}"; const session = await FFprobeKit.execute(command); const output = await session.getOutput();

Screenshots partial log.

image

Logs Post logs here or paste them to Ghostbin and insert the link here.

tanersener commented 1 week ago

The logs you’re seeing are printed to stderr by ffprobe, which is why they aren’t filtered in your command. We created a custom log level, AV_LOG_STDERR, to identify them. Check the documentation in these lines for more details.

If you don’t want to see these logs, here are two options:

FFmpegKitConfig.disableLogs()

or

FFmpegKitConfig.setLogRedirectionStrategy(LogRedirectionStrategy.NEVER_PRINT_LOGS);

alecmanfre commented 1 week ago

Thank you for the response! I tried both of these methods you suggested and here were the results for reference: FFmpegKitConfig.disableLogs() This method worked for me.

FFmpegKitConfig.setLogRedirectionStrategy(LogRedirectionStrategy.NEVER_PRINT_LOGS); This method did not work for me. I need to read the output from FFprobeKit in order to get meta data about a video like the frame rate. When I used this method it seemingly suppressed all outputs not just the ones going to stderr.

Thanks again.