Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image overlay over video as watermark #948

Open
prasan2421 opened this issue Mar 16, 2024 · 1 comment
Open

Image overlay over video as watermark #948

prasan2421 opened this issue Mar 16, 2024 · 1 comment
Labels
ios Affect iOS platform question Further information is requested react-native Affect react-native platform v5.1 Affects v5.1 release

Comments

@prasan2421
Copy link

prasan2421 commented Mar 16, 2024

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.

@tanersener
Copy link
Collaborator

tanersener commented Apr 10, 2024

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 tanersener added question Further information is requested react-native Affect react-native platform ios Affect iOS platform v5.1 Affects v5.1 release labels Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ios Affect iOS platform question Further information is requested react-native Affect react-native platform v5.1 Affects v5.1 release
Projects
None yet
Development

No branches or pull requests

2 participants