natibekele / react-native-video-watermark

MIT License
2 stars 6 forks source link

Exception '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' was thrown while invoking convert on target VideoWatermark #2

Open LudinaReema opened 3 years ago

LudinaReema commented 3 years ago

react native version - 0.59

import VideoWatermark from 'react-native-video-watermarker';

VideoWatermark.convert(this.state.videoUri, this.state.photoUri, 'LEFT_TOP', destinationUri => { // use converted video here. console.log('destinationUri', destinationUri); });

When I tried to put watermark image on the video, getting this error.

Exception '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' was thrown while invoking convert on target VideoWatermark with params ( "/var/mobile/Containers/Data/Application/456CB730-B732-4FDB-AE45-51628A00189F/tmp/trim.C2527933-D2DE-49F5-A66B-FA0CECB03D2C.MOV", "/var/mobile/Containers/Data/Application/456CB730-B732-4FDB-AE45-51628A00189F/tmp/009A2450-7C84-4F41-81AD-F7A824884022.jpg", "LEFT_TOP", 21781 )

I wanted to download the http video into the device after the watermark is set on it. Is it possible to set the watermark on the http urls??

natibekele commented 3 years ago

I have only used this library to add watermarks to video that had URi locations on the physical device. I don't think it works with external https url's. My use case involved watermarking videos that were recorded by the devices camera.

LudinaReema commented 3 years ago

@natibekele Yes, got it. Thanks.

In my case, I tried downloading the video files from the storage bucket to the device in order to get the uri.