titansgroup / k4l-video-trimmer

A library with UI and mechanisms to trim local videos on Android applications.
MIT License
784 stars 221 forks source link

Add watermark/sticker/text over video at specific time, location scale and rotation #27

Open pawaom opened 7 years ago

pawaom commented 7 years ago
Fixes issue #.

Can we add a feature for this project to be able to add watermark/ text on video between a specific time range, which can be rotated , scaled, and positioned according to user inputs,

This PR changes:

and the FFMpeg command would be this, String[] complexCommand2 = {"-y", "-i", videoFilePath, "-i", imagepath, "-filter_complex","[1:v] format=bgra, rotate=30*PI/180:c=none:ow=rotw(30*PI/180):oh=roth(30*PI/180) [rotate];[rotate]scale=50:50[scale];[0:v][scale] overlay=40:10","-codec:a","copy", outputFilePath};

however , my problem arises how to pass the user input data from android to the ffmpeg command , If this feature is added to this library it would make it better

pawaom commented 7 years ago

During further research I came accross these two articles

https://medium.com/uptech-team/how-to-create-snapchat-like-stickers-for-android-50512957c351

and

https://medium.com/uptech-team/how-to-create-beautiful-text-stickers-for-android-10eeea0cee09

these provide an explantion of the process to be followed and this also

https://github.com/helloJp/Sticker

this project helps create stickers on images, it creates a canvas of the whole image and stickers and then creates a new bitmap out of it

this gave me the idea to create a canvas of the stickers and overlay it on the video with the ffmpeg command, the problem is to get dimensions of the stickers from user inputs

Are any of you guys who have participated in this request working on any thing , please comment so that I can add further inputs,

EDIT

for positioning video this is helpful https://www.factorialcomplexity.com/blog/2016/12/11/adding-animated-overlays-to-videos-on-android.html

saikiran143 commented 4 years ago

I have a matrix, which contains width and height and x and y and scale and angle. but i am unable to overlay image on particular postion with x,y,scale,skew (Everything is their in matrix), i need to implement matrix of float 9 values of image on video..

ashish9718 commented 3 years ago

how to put image at a specific time in the video? command for android?