Image overlay over video as watermark
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.
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.
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.
This issue was closed because it has been stalled for 7 days with no activity.