Make Effects in ffmpeg - ffmpeg

How to make a zoom-in effect using ffmpeg. I need to create a video with a single image with Zoom-in as effect using FFMPEG. The Zoom-in should be bit slow. I have searched in the document and could find a sample. Can I get a command line sample?

Related

Using FFMPEG to add pillar bars

I have transferred some film to video files from 16mm (native 4:3). The image looks great.
When I scanned them, I scanned to a native 16:9. As I overscanned them, I got the entire height of the frame, which is what I want. But it also got the soundtrack and perforation. But I want to go just to the frame line on the sides as well.
I can CROP the image down with FFMPEG to remove the information outside of the framing I want [-vf crop=1330:1080:00:00].
I know this will result in a non-standard aspect ratio.
This plays fine on a computer (vlc just adapts to the non-standard).
But for standardized delivery, I would love to keep the native 1920x1080 pixels, but just make everything outside of the centered 1330:1080 black.
Is there a way to specifically select where the pillar bars are?
I really want to re-encode the video as little as possible.
In that vein, does anyone have a better tool than -vf crop as well?
thank you very very much.
Use crop then pad:
ffmpeg -i input -vf "crop=1330:ih,pad=1920:ih:-1:-1" output

Upload a picture to generate a video with special effects

I am stucked by a video processing feature, Specifically, upload an image and then generate a video based on various video templates.
Here are the video templates:
http://video-static.biku8.com/data/video/template/3286012076458048/7437ab55-2e83-4a36-9046-5708fcddf4c1.mp4
http://video-static.biku8.com/data/video/template/3274256089907264/ae8fa3f7-6c9c-45ca-810f-48db92cc14cb.mp4
http://video-static.biku8.com/data/video/template/3213894231425088/bf107d439b9043a58c1ea0ba26f811db_template.mp4
...
As shown in the video templates above, I just need to upload a photo to generate a great video.
My question
What is the specific idea for implementing this video?
Which third-party libraries are needed? (ffmpeg, opencv)
PS: I am using dlib and opencv for face recognition. I can generate face image, but I don't know how to insert face image into the correct position of these template videos.
I would suggest you to follow the below 3 steps
Load the template video by opencv, you can access the video frame by frame
Modify each frame, one by one.
Save frame to video stream writer
Regarding step 2, actually, you must copy the uploaded image to the each frame by a mask (the pixel from source image would be copied to destination image if its coordinate on the mask is non-black). The mask could be defined by a list of points OR by an image. You should pre-define a mask for each frame in a file. Then load the mask for each frame and copy.
How to read video, save video OpenCV read-write Video
How to insert image to another image Copy non rectangular ROI
Generating videos like them are all not easy tasks. I recommend to use Adobe After Effects or other video creating software (with some scripts and actions) if you don't need to generate it by a single program or program language.
Then, I answer them below when you need to generate it by programatically.
For the first one, you should recognize faces and bones. So you should use OpenCV. ( I recommend to use tools like OpenFrameworks or TouchDesigner and so on. )
For the second one, I don't know what you exactly want, but if you want to recognize the position of the bottle dynamically, you have to use deep learning or other way to detect it. Then you may need TensorFlow or OpenCV. ( If you just want to merge layers, you can use ffmpeg etc. )
For the last one, you should split the video frame into the boxes, then you have to control. I think there are many ways to implement this. I may use OpenFrameworks, TouchDesigner, vvvv, or Processing.
I think using ffmpeg for them is not recommended. This tool is not the best for generating complicated video. But ffmpeg will do good, for example if you just merge two videos with alpha.

FFMPEG FishEye Equirectangular

I'm struggling with FFMPEGs Remap Filter. I have a security camera that streams a bunch of different options, but the default is this FishEye:
I see a TON of maps for Ricotah Theta's, but nothing that shows me how to generate those map files for a different layout, like the one I have. I've tried doing just 2 pano's, but the image gets stretched out so much when I stream to YouTube. Can someone point me in the right direction???
You posted a modified imaged (cropped and moved), so applying ffmpeg directly gives weird results, but with raw images, which probably look like this...
using this command...
ffmpeg -i input.png -vf v360=fisheye:e:ih_fov=180:iv_fov=180:pitch=-90 -y output.jpg
you would get this result:
You can then view it here: https://renderstuff.com/tools/360-panorama-web-viewer/
I was making this far too difficult. Just send youtube the fisheye using FFMPEG. You can tweak the size to prevent some of the distortion.
You need the v360 filter. Make sure you use the latest ffmpeg build; older versions don't include this filter.
I used these parameters for a security camera:
-vf v360=fisheye:equirect:ih_fov=180:iv_fov=180
Result:
You might want to crop the video (because of the black margins):
-vf crop=1500:1500:250:0,v360=fisheye:equirect:ih_fov=180:iv_fov=180,crop=1500:1500:750:0
Of course, adjust the crop filter parameters to your situation.

How to preserve transparency when using png to make video with ffmpeg

I have a series of png's that have an alpha channel as a background. Each file is named like file_name.0001.png and so on, in subsequent order. I'd like to join these png's into a video with ffmpeg and maintain the transparency.
I've tried a couple of things but I suspect I'm running into a codec issue. When I run ffmpeg, the video is created but the background is black.
If it makes a difference, I'm wanting to use the video in Microsoft Powerpoint. Thanks!
Edit
The suggested duplicate is very close to what I was looking for, thank you! The only reason it's not a complete solution is none of the options presented in the other thread work well with Microsoft Powerpoint. None of the codecs used in the suggested solution play well with Powerpoint. This is not the fault of ffmpeg, but of Powerpoint.
Though ffmpeg doesn't seem to be able to do what I need, I found that imagemagick did the trick. I was able to create a gif from the images and the alpha channel was preserved. I used the following:
convert -dispose 3 -coalesce images.*.png gif_file_name.gif
The -dispose 3 is critical as it tells imagemagick to clear the image prior to overlay, otherwise, you can see each image overlaid on each other (since they have the transparent background).
I couldn't get ffmpeg to create a video that preserved the alpha channel and was Powerpoint friendly (not the fault of ffmpeg). Though ffmpeg doesn't seem to be able to do what I need, I found that imagemagick did the trick. I was able to create a gif from the images and the alpha channel was preserved. I used the following:
convert -dispose 3 -coalesce images.*.png gif_file_name.gif
The -dispose 3 is critical as it tells imagemagick to clear the image prior to overlay, otherwise, you can see each image overlaid on each other (since they have the transparent background).

Add text to a video with effects using FFMPEG

I need to add text in between a video. I have seen drawtext and seems it wont give effects to the text to be displayed.
My intention is to show a text within a box with some background to that box which should fly from left to right in between a video at a particular time. Is it possible with FFMPEG? I have tried different options with drawtext and nothing seems to be working. Any ideas on how to make it?
or is it possible to achieve by combining imagemagick and FFMPEG command?

Resources