Try to convert both streams to gbrp color format, like: ffmpeg -i video.MOV -i imager.png -filter_complex "[0:v]format=gbrp[f0],[1:v]format=gbrp[f1],[f0][f1]blend=all_mode=addition" addition.MOV Then the modes work as expected.
@aforum44593 жыл бұрын
thankyou very much :) yep it worked
@Astroni8003 жыл бұрын
@@aforum4459 Well, I've been looking for it for a few days, it's about time it finally worked
@SreenikethanI2 жыл бұрын
Hello, I tried something similar i.e. converting to rgb24 and then applying the blend filter, and it had worked for me too. Do you have any idea why is this the case? And why the original (here, yuv pixel format) doesn't suffice?
Hello! I'd like to know why the *difference* filter at 1:30 creates a green tint to the output? I'm trying to experiment removing a static background from a video. Let's take the video's first frame as the reference static background, (and assume that the camera was being held still). When I just tried to blend=all_mode=difference alone without any format conversion, I ended up getting a green tint too, like you have shown at 1:30. Now, I tried this sequence of filters: 1) Convert input to rgb24, and *split* into two outputs [a] and [b] 2) Get *first frame* from [a] and store it as [first] 3) *blend* [b] and [first] with difference filter, then convert to *format=rgb24*, then again convert to *format=yuv420p* (yes, in that order, and yes rgb24 is done *again* even though it was done in step 1) 4) Save result as mp4 file This results in that green tint *NOT* appearing anymore! Do you have any idea why this fixes the issue? Is there a more proper way to achieve this rather than converting between pixel formats a buncha times? If possible you may try this yourself by recording a video with your camera held in a stationary position (in a tripod, for example) or with your laptop webcam, and run the command for the above sequence of filters: ffmpeg -i in.mp4 -filter_complex "[0:v]format=rgb24,split=2[a][b]; [a]trim=start_frame=0:end_frame=1[first]; [b][first]blend=all_mode=difference, format=rgb24, format=yuv420p[vf]" -map "[vf]" -y out.mp4 -hide_banner Please let me know your results! Thanks a lot!
@SreenikethanI2 жыл бұрын
Oh well, I just saw your second video at kzbin.info/www/bejne/aHS3aJtvnpd4p80 😃
@aforum44592 жыл бұрын
Hi thanks for your message. I tried the command but I think my camera may have been moving so I didn't have a static background so it didn't work, I will try it again when I have a better video to try it on. This is something I've also been interested in. There is also this person that I found, hope this is helpful, www.arj.no/2020/02/21/image-masks/
@SreenikethanI2 жыл бұрын
@@aforum4459 thanks for the reply and the article link! the article seems to be pretty much what i was trying to do :D
@SreenikethanI2 жыл бұрын
I'm yet to be experienced with ImageMagick so I'll read some articles on it
@aforum44592 жыл бұрын
@@SreenikethanI glad I could help. :)
@aforum44593 жыл бұрын
I've made a github file with this and the newblend video code in one file. github.com/afrum/my_ffmpeg/blob/main/Blend