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

Image overlay over video as watermark

Open prasan2421 opened this issue 1 year ago • 1 comments

Description Image overlay over a video is not working (iOS). Tried many solutions but i keep getting the same error. PNG compression doesn't seem to be present in build settings in xcode.

Expected behavior Watermark added on a video.

Current behavior Getting error: Encode failed with state COMPLETED and rc 1.undefined.

To Reproduce Steps to reproduce the behaviour:

const watermarkPath = '../assets/Images/watermark.png';

              const result = await FFmpegKit.execute(
                `-ss ${ startTime} -i ${videoPath} -t ${endTime} -i ${watermarkPath} -filter_complex "[0:v][1:v]overlay=W-w-10:H-h-10" -c:v copy -c:a copy -avoid_negative_ts make_zero ${savedVideoPath}`
              ).then(async session => {
                const state = FFmpegKitConfig.sessionStateToString(
                  await session.getState(),
                );
                const returnCode = await session.getReturnCode();
                const failStackTrace = await session.getFailStackTrace();
                const duration = await session.getDuration();
          
                if (ReturnCode.isSuccess(returnCode)) {
                  console.log(
                `Encode completed successfully in ${duration} milliseconds;`,
                  );
                } else if (ReturnCode.isCancel(returnCode)) {
                  console.log('Encode canceled');
                } else {
                  console.log(
                    `Encode failed with state ${state} and rc ${returnCode}.${
                      failStackTrace
                    }`,
                  );
                }

Screenshots If applicable, add screenshots to help explain your problem.

Logs Encode failed with state COMPLETED and rc 1.undefined

Environment

  • Platform: ReactNative
  • Architecture: arm-v7a, arm-v7a-neon, arm64-v8a, x86, x86_64, armv7, armv7s, arm64, arm64-mac-catalyst, arm64-simulator, arm64e, i386, x86-64, x86-64-mac-catalyst
  • Version: v5.1/v5.1.LTS
  • Source branch: main, development
  • Xcode version: 13.4.1
  • Cocoapods version: 1.10.3
  • Android Studio version: 4.0
  • Android NDK version: r25b
  • flutter doctor:
  • react-native info:

Other Add any other context about the problem here.

prasan2421 avatar Mar 16 '24 12:03 prasan2421

It is impossible to make a comment without seeing the console output. For that you must use session.getOutput().

Regarding PNG files in Xcode, we have tip #11 in Tips wiki.

tanersener avatar Apr 10 '24 19:04 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 Jun 11 '24 01:06 github-actions[bot]

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

github-actions[bot] avatar Jun 19 '24 01:06 github-actions[bot]