FFmpeg: Image scrolling, with green background? - ffmpeg

Good morning, I hope you are well.
Please, I need help with the following...
I'm moving an image vertically, and I see that the background of the video is green.
How can I change this background color?
Example code:
ffmpeg -loop 1 -t 24 -i "image.jpg" -filter_complex "nullsrc=size=640x360[background];[background][0:v]overlay=shortest=1:y='min(0,-(t)*26)'" -qscale 1 -y out.mpg
Video Result: https://youtu.be/98rKLVO56wA
I hope I can help,
Thank you very much,
Greetings,
Hugo

Use
ffmpeg -loop 1 -t 24 -i "image.jpg" -filter_complex "color=000000:s=640x360[bg];[bg][0]overlay=shortest=1:y='min(0,-(t)*26)'" -qscale 1 -y out.mpg
The color filter takes RGB values as hex RRGGBB

Related

Overlay text in a background image not getting correct output

When overlaying a text or image(test.jpg) to a background image(bg.png),output video background color is getting darker.
here input image has an alpha value .
ffmpeg -loop 1 -i bg.png -i test.jpg -y -filter_complex "[0:v][1:v] overlay=25:25,-pix_fmt yuv420p" -shortest -t 10 tesy.mp4
Output excepted : https://i.stack.imgur.com/e5C3x.png
Output I got is
https://i.stack.imgur.com/reujS.png
If you see background color has huge differnce in the output I got
Below is the background image(bg.png) to which i am overlaying some image(test.jpg)
Use this image and overlay a test image, and let me know the difference in background color .
Add the premultiply filter for these particular PNG files:
ffmpeg -y -loop 1 -i bg.png -i test.jpg -filter_complex "[0]premultiply=inplace=1[bg];[bg][1:v]overlay=25:25:format=auto,format=yuv420p" -t 10 output.mp4
Or create the PNG with no alpha.
Or use the color filter to make the background:
ffmpeg -y -f lavfi -i color=c=purple:s=1280x720 -i test.jpg -filter_complex "[0][1]overlay=25:25:format=auto,format=yuv420p" -t 10 output.mp4

ffmpeg transparent waveform and solid background

Im trying to create waveform image with transparent wave and solid background color. Im find the similar topic here:
FFMPEG waveform transparent, background solid color
but the answer not working for me :(
Maybe do you know why this code suspend the program in console command.
ffmpeg -i input.mp3 -filter_complex \ "[0:a]aformat=channel_layouts=mono,compand=gain=-6, \
showwavespic=s=600x120:colors=white,negate[a]; \
color=red:600x120[c]; \
[c][a]alphamerge" -vframes 1 output.png
OK, so finally i do it in 3 steps
first generate black waveform on color solid background:
ffmpeg -y -i test.mp3 -f lavfi -i color=s=600x240:c=red -filter_complex "[0:a]showwavespic=s=600x240:colors=#000000[fg];[1:v][fg]overlay=format=rgb" -frames:v 1 output.png
We can use other background color(in hex) like c:0xC7C7C7
and next cute black wafevorm
ffmpeg -y -i output.png -vf colorkey=0x000000:0.6:0.2 Finished.png
and delete temp file
rm output.png
Thanks guys for help.

ffmpeg image scrolling with background image

I have code
ffmpeg -loop 1 -t 24 -i "image.jpg" -filter_complex "color=000000:s=640x360[bg];[bg][0]overlay=shortest=1:y='min(0,-(t)*26)'" -qscale 1 -y out.mpg
How to change this code so that instead of a black base color there was a background in the form of an image?
I will be grateful for the help!
Add another image input and use it as the background in the overlay:
ffmpeg -y -i background.jpg -loop 1 -t 24 -i "image.jpg" -filter_complex "[0][1]overlay=y='min(0,-(t)*26)'" -qscale 1 out.mpg

How to add 'drawtext' to overlay in ffmpeg?

The command is ffmpeg -loop 1 -t 5 -i "demo_1.jpg" -filter_complex "nullsrc=size=640x360[background];[background][0:v]overlay=shortest=1:x='min(-(t)*20,0)'" -qscale 1 -y out.mp4
I am animating the image from right to left. In the above command, I need to add text, How to integrate the drawtext feature of ffmpeg to that.
The video animation is https://youtu.be/teXUiPKX83o.
Need to add text to that video.
Use
ffmpeg -loop 1 -t 5 -i "demo_1.jpg" -filter_complex
"nullsrc=size=640x360[background];
[background][0:v]overlay=shortest=1:x='min(-(t)*20,0)',
drawtext=fontfile='/path/to/font':fontsize=30:fontcolor=yellow:x=50:y=50:text='Text'"
-qscale 1 -y out.mp4
See drawtext docs for more info.

FFMPEG scale down image

This is for you FFMPEG gurus!
I have video that I take a screenshot image of. This works fine:
ffmpeg -i sourceMovie.mp4 -ss 0 -vframes 1 destImage.jpg
But I was hoping to also scale down the image to 150 px wide, in one fell swoop. Apparently, I should add
scale=150:-1
But where and how do I insert that in the command?
I have tried everything; nothing works ...
scale is a VideoFilter, so you use "-vf":
ffmpeg -i sourceMovie.mp4 -ss 0 -vframes 1 -vf "scale=150:-1" destImage.jpg

Resources