Unable to watermark video in ownCloud

I have a following line of code which watermark the video successfully even in ownCloud.

shell_exec('ffmpeg -i /var/www/owncloud/apps/files/ajax/video.mpg -i /var/www/owncloud/apps/files/ajax/wm.png -filter_complex "overlay=10:10" /var/www/owncloud/apps/files/ajax/output.mp4');

I write above line of code in "upload.php" file. Then it watermarked video in manual way like:
1. It selects the watermark "wm.png" from ajax folder (thats fine)
2. It picked the video "video.mpg" from ajax folder
3. It saved watermarked video in ajax folder

Now What I want to achieve? I need some amendments in 2 & 3 point......
How to get video which we want to upload instead of picking video only from ajax folder?
How to save watermarked video in user database as it save in normal case?

Please give me a kind suggestion by making modification in above line of code.


So far so good. But after you change something directly in the file system you do need to run a file scan. Alternatively you can build an ownCloud app which does this operation ... then you can update the file cache from there ...

1 Like

Thanks for your quick and efficient response.

What is meant by file scan? How to perform a file scan?
Is there any example of building an ownCloud app?

How to rescan the file system via the occ tool is explained in [1]. Documentation on how to create an app is available in [2].

[1] https://doc.owncloud.org/server/latest/admin_manual/configuration_server/occ_command.html#file-operations-label

[2] https://doc.owncloud.org/server/latest/developer_manual/app/index.html

1 Like

I am still confused in creating application on ownCloud environment. Actually my question is related to PHP code. How can I fix the problem without building a separate app?

You need to somehow execute the occ files:scan command from within PHP (like you're doing with ffmpeg)