ffmpeg-kit icon indicating copy to clipboard operation
ffmpeg-kit copied to clipboard

ERROR TypeError: Cannot read properties of undefined (reading 'getLogLevel')

Open saurabhkanswal opened this issue 2 years ago • 5 comments

I am trying to compress video in react native. but i am getting an error: Screenshot 2022-04-28 at 12 58 27 PM

Code:

FFmpegKit.execute(`-i ${this.state.videoUri} -c:v mpeg4 resultmimage.\mp4`).then(
         async (session) => {
            const returnCode = await session.getReturnCode();
            if (ReturnCode.isSuccess(returnCode)) {
              console.log('FFMPEG SUCCESS');
              // SUCCESS
          
            } else if (ReturnCode.isCancel(returnCode)) {
              console.log('FFMPEG CANCEL');
              // CANCEL
          
            } else {
              console.log('FFMPEG ERROR');
              // ERROR
          
            }
          },
        ).catch((error)=> {
          console.log('ERROR', error)
        })
ffmpegKitPackage = "full-gpl-lts"
react native: "0.63.2"
android version: 10

saurabhkanswal avatar Apr 28 '22 07:04 saurabhkanswal

after retry/refreshing the app, it gives new error on running the above code: Screenshot 2022-04-28 at 1 07 44 PM

saurabhkanswal avatar Apr 28 '22 07:04 saurabhkanswal

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jun 28 '22 02:06 github-actions[bot]

@saurabhkanswal How did you solve this issue?

Liqiankun avatar Jul 03 '22 04:07 Liqiankun

@Liqiankun the issue didn't solved, I ended up using silli compressor for video compression in react native using native modules.

saurabhkanswal avatar Jul 03 '22 18:07 saurabhkanswal

@saurabhkanswal OK Thanks.

Liqiankun avatar Jul 03 '22 22:07 Liqiankun

@tanersener any idea, what's wrong here ?

saurabhkanswal avatar Aug 18 '22 06:08 saurabhkanswal

getLogLevel method is invoked internally when the first ffmpeg-kit API call is made by the application. If it fails, I suspect ffmpeg-kit is not installed properly. But hard to say why without reproducing the issue locally.

tanersener avatar Aug 18 '22 10:08 tanersener

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Oct 18 '22 03:10 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Oct 25 '22 04:10 github-actions[bot]