use ffmpeg to create Zoom virtual background video - ffmpeg

Using ffmpeg, I created a video from a list of PNG images to use as a Zoom virtual background. However, when I try to upload it to Zoom, it says "Unsupported format. Please upload a different file." Here is the command that I used:
ffmpeg -framerate 1 -i img%04d.png output.mp4
I get the same error if I try to output a .mov file. Am I missing some option in the ffmpeg command?

PNGs store pixel color data as RGB values. Videos store color data as YUV. However, when converting an RGB input, ffmpeg chooses a YUV format which is incompatible with most players (it does this to preserve full signal fidelity). The user has to set a compatible pixel format with a reduced chroma resolution. Also, framerate 1 isn't compatible by some players, so duplicate frames to increase output framerate.
ffmpeg -framerate 1 -i img%04d.png -r 5 -pix_fmt yuv420p output.mp4

Related

Colors not accurate in ffmpeg video

I am creating a video with ffmpeg by stringing together a bunch of PNG files. The resulting video has horizontal lines running across it and the colors are not accurate. Here's the command I used:
ffmpeg -framerate 1 -i img%04d.png -pix_fmt yuv420p timer.mp4
I am attaching an example of one of the input PNG files and a frame from the video. Can anyone tell what's wrong?
input file
video frame

FFMPEG DNxHR with Alpha to Webm

I'm trying to convert a video file exported from Blackmagic Fusion as DNxHR with Alpha checked to WebM or PNG. FFMPEG seems to ignore the alpha and the background is black. Is there something I need to do? This is what I'm currently using:
ffmpeg -ss 0.5 -i DNxHR444A.mov -vframes 1 test.png
or
ffmpeg -i DNxHR444A.mov -c:v libvpx-vp9 -crf 30 -b:v 0 test.webm
I can upload my test video if that helps. But it's quite large.
FFmpeg's DNXHD/R decoder does not support alpha. Either use another codec on export, or export alpha separately (it will be a grayscale picture). With the 2nd method, ffmpeg can combine the main image and the alpha for onward processing.

ffmpeg: Combine a audio (.wav) and video in (.rgb) format

I want to synchronously play audio (.wav) file and video which is provided to me in rgb format.
The rgb file contains all the rgb images in the video frames. How can I combine rgb file and audio using ffmeg to get output video which can be played on vlc player?
Input 1 : audio.wav
Input 2 : allimages.rgb
Output : A video file which can be played in vlc player.
I was looking at ffmpeg documentation but couldn't find anything for rgb input. It would be great help if you can provide the ffmpeg command for doing above.
Thanks
The closest I got with this is using below command, but I see Green and Pink colors in my video after I play it. I think I am missing something in the ffmpeg command. Can anyone tell me what is wrong in above command and help to improve video quality and remove green and pink colors?
ffmpeg -s 480x270 -r 15 -pix_fmt gbrp -i /Users/sandeep/Downloads/Videos/input.rgb -c:v libx264 -y output.mp4

How to specify size of output image in ffmpeg command?

I'm extracting frame images from an MP4 video using ffmpeg in terminal.
I used the command:
ffmpeg -i Video.MP4 Pictures%d.bmp
Problem is that the extracted images have a size of 4.5-5MB! I want smaller images, say around 1-2 MB. How do I limit the size of output images?
The file size is a function of your video resolution and of the output format you choose.
For example:
width x height x 3 bytes ( RGB24)
You have different ways to reduce the output file size.
Change the format for example YUV 4:2:0 with -pix_fmt yuv420 and I think the smaller format you can choose is gray or yuv400 but check with the following command showing the ffmpeg supported pixel format
‘ffmpeg -pix_fmts
the BMP format should handle that (generate a 8bpp image) but confirm with the file size that you get a factor 3!
Change the output resolution (HD to SD or CIF) with -s <Width>x<Height>, e.g.:
ffmpeg -i Video.MP4 -s 192x168 Pictures%d.bmp
or with the -vf option:
ffmpeg -I Video.MP4 -vf scale=192:168 Pictures%d.bmp
there is one more option you have to reduce filesize of the output pictures : Use another picture format like *.jpg.
ffmpeg -i input.flv -ss 00:00:14.435 -f image2 -vframes 1 out.jpg
(Source : http://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video)
Have a nice day ;)

Convert FLV video with alpha channel to PNGs with transparency

I have some FLV videos with alpha channels, and I want to convert each of them to PNG images using ffmpeg but keep the transparency.
So far, I've tried this:
ffmpeg -i input.flv -an -y %d.png
But this outputs the PNG files with black background.
Is there any way to do this?
Alternate acceptable solution: If I can output the images and give the alpha channel a certain color of my choice. I can then remove it later via imagemagick and convert that color to transparency.
I know its quite late for an answer but I was searching for a similar solution and found this : ffmpeg -i video.flv -r 25 -vcodec png -pix_fmt rgb32 %d.png

Resources