FFprobeKit command not showing the specific error when it fails to execute

Viewed 29

I'm getting the video duration of a video in react native by using FFMpegkit library and by running bellow code

const getVideoDuration = async (uri: string): Promise<void> => {
      try {
      await FFprobeKit.executeAsync(
        `-v error -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 ${uri}`,
      ).then(async information => {
        const failStackTrace = await information.getFailStackTrace();
        console.log(failStackTrace);
        await information.getOutput().then(output => {
          const value = parseFloat(output.toString());
          const time = value * 1000;
          setInputVideoDuration(time);
        });
      });
    } catch (error) {
      console.log(error);
    }
  };

The issue is that the the code isn't executing sometimes. And it's like sporadic. I want to trigger the exact error given when failing this code. The exact error is not given by the library logs but it produce other command executing logs. Is there any way to get the exact error or the exception?

Currently the error shows like this in the logs but it doesn't have any information. also failStackTrace isn't producing any logs either

 libswscale      6.  1.102 /  6.  1.102
 LOG    libswresample   4.  0.100 /  4.  0.100
 LOG  ReturnCode.ERROR
0 Answers
Related