Wipe image in and out with ffmpeg / imagemagick - animation

I'd like to create a wipe in/out from left to right effect with ffmpeg and/or ImageMagick that is common to most video editors. (e.g. Adobe Premiere, Final Cut Pro and even OpenShot) Some might call this a slide in/out transition effect.
I found that ffmpeg has a lot of filters (including fades), but none seem to be the correct choice for this.
There are also ImageMagick transitions that achieve a wipe in effect. Like in the following example (that is derived from here):
convert overlay.png -crop 10x1080 miff:- | convert - out.gif
But I found it hard to control the actual speed/duration of the transition. I'd like it to last only 2.5 seconds. But I can't make it that fast, because the -delay 1x30 option doesn't seem to let me decrease the delay that low. There is also a library with ImageMagick transitions here that unfortuantely isn't compatible with batch.
I suppose there is a solution for ffmpeg that I couldn't think of, yet. I'd really appreciate your advice!

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

FFmpeg Auto Level, Auto Color etc similar to YouTube's Auto-Fix

I used to use YouTube Auto-Fix which presumably auto fixed levels, color, contrast and added a bit of vibrance (it was almost always a bit high saturated which i kinda liked).
I am looking for an alternate in ffmpeg. I tried using -vf pp=al but it only lightens the video.
Any ideas?
P.S. I can do this in Premiere/After Effects but am looking for a ffmpeg solution.

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.

Glitchiness when I add transparency to a gif and convert it to webm

Starting off I have this gif from google images:
Then I convert the blue to transparency:
convert octopus.gif -transparent "#00AEFF" octopus-transparent.gif
Now I have this (note glitchiness has already started to appear)
Now for the grand finale, I convert it to webm:
convert octopus-transparent.gif tmp%03d.png
ffmpeg -framerate 25 -f image2 -i ./tmp%03d.png -c:v libvpx -pix_fmt yuva420p octopus.webm
See the following screenshot. It is still transparent, but the sizing is no longer steady, and frankly it's starting to look a little creepy:
I don't really know much about video codecs and I've just got this far with others' help. I'd appreciate advice as to how I can change these commands to avoid the glitches.
Your problem may be due to unequal sized frames from an optimization, so add -coalesce to your command, so that it is
convert octopus.gif -coalesce -fuzz 25% -transparent "#00AEEF" miff:- | convert -dispose background - octopus-transparent.gif
If you just want to save as gif again, you can add -layer optimize before saving. But if you want to output to webm, you may need to avoid the -layers optimize.
Also you do not have constant blue color, so you need -fuzz.
The pipe to convert allows one to set the dispose method. It won't work inline in the first convert, since it needs be be set right after reading the input and thus will pickup the blue background rather than the transparent.
What is your IM version? Perhaps you need an upgrade. I get this using IM 6.9.8.3 Q16:

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).

Resources