Closed fabyeah closed 3 years ago
You can use information.getAllProperties() to get all information
@tkduong98 thanks a lot, that works! The example in the README should probably be updated.
The problem with lots of unwanted automatic console output, whenever I run FFprobe, remains. Any way to turn that off?
Tried RNFFmpegConfig.setLogLevel(LogLevel.AV_LOG_QUIET);
but doesn't help.
I'm seeing same issue as OP. Result is always empty, getAllProperties
is always empty, lots of information in the log though.
@aaronkaz try this for example:
RNFFprobe.getMediaInformation('<file path or uri>').then(information => {
alert('Duration: ' + information.getAllProperties().format.duration);
});
I go to react-native-ffmpeg folder in node module and turn it off
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi everyone! @aaronkaz @fabyeah @tkduong98 I've managed to silent the logs (only tested on Android for now) by providing a log callback to the config:
import { RNFFmpeg, RNFFmpegConfig, RNFFprobe } from 'react-native-ffmpeg';
const myFunction = async () => {
RNFFmpegConfig.enableLogCallback(() => undefined);
const information = await RNFFprobe.getMediaInformation(`${RNFS.CachesDirectoryPath}/video.mp4`);
console.log(information. getAllProperties());
}
Let me know if it helps in your case! 😉
@avencat works like a charm 👌
This problem only occurs on android btw, no additional output on ios.
Running
RNFFprobe.getMediaInformation
logs a ton of stuff to console, but the passed back result object is empty:Result: {}
. I was expecting nothing to be automatically logged to console (is there an option to turn this off?) and the result object be populated with media info.This is my code (taken from the README):
This is the console output: