I have a mp4 file, where the video is having the background color as a solid color like white/green/blue. with that background, a video is recorded. I want to change the background color. Please let me know how to change the color programatically using Android.
Asked
Active
Viewed 426 times
-3
-
1This question doesn't make sense AT ALL. You say you are capturing a video with a background color? Can you tell me how is that even possible. Then you say you want to change the background programmatically using Android? Android is not program language, so changing a background using Android itself is impossible. – HB. Oct 23 '17 at 15:11
-
I understand what you are trying to say, but asking a question like this is to broad, I'm voting to close it. – HB. Oct 23 '17 at 15:11
-
H.Brooks, sorry for my poor english. I mean to say, that I am recording a video of a person by keeping the background color as white/blue/green. You can assume the person is standing infront of the white board or any wall whose color i want to change later. Is it possible? I am saying using Android doesn't mean only android will do that job. There are other libraries like ffmpeg or some similar kind, which I should be able to take help. If anyone who have come across such requirement, any solution will be helpful – user3652122 Oct 24 '17 at 09:56
1 Answers
0
You can do this using ImageMagick and FFMPEG.
First you will have to get all the frames from the video using FFMPEG
using something like:
ffmpeg -i "inputFile.mp4" "frames/out-%03d
Then using ImageMagic
you can flatten each against the color you want like:
mogrify -background green -flatten visualization/*.png
Then you will have to use FFMPEG
again to create a video/.mp4
file again using something like:
ffmpeg -framerate 1 -pattern_type glob -i '*.jpg' \
-c:v libx264 -r 30 -pix_fmt yuv420p out.mp4
Disclaimer:
This is just a guideline to get you started and to give you a idea of how you can achieve what it is you asked for. More research should be done as this is a simple question to answer.
Here are some links that I found helpful:

HB.
- 4,116
- 4
- 29
- 53