![]() Note this command actually contains two commands that you can run separately: If you look closely again, you can see the crosshatch is gone! ![]() Here’s how we do that in one command:įfmpeg -i my-video.mp4 -vf palettegen palette.png & ffmpeg -i my-video.mp4 -i palette.png -filter_complex “paletteuse=dither=none” my-gif.gif To remove it, ffmpeg has these really neat features called palettegen and paletteuse, which allow you to create a color palette of 256 pixels from your video, define a dithering algorithm, and use it when creating your GIF. The reason why the crosshatch exists is something called dither:ĭither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images.įor our case, all we need to understand is that ffmpeg uses dithering algorithms to avoid visual errors and make the media we create more predictable. To remove this, you need to do some fancy manipulation. The problem is, if you turn up the brightness on your display and look closely at the GIF below, there’s a visible crosshatch pattern overlay that wasn’t in the original video: This is how to create a GIF with zero manipulation. Keep in mind this post covers less than 0.1% of what ffmpeg can do - it’s an incredible library that most of us will never fully appreciate. I avoid creating a script with variables and instead prefer to keep it as copy and paste-able as possible. ![]() There are dozens of articles around the web on how to do this, but I wanted to note the command I use here for my own quick reference. ![]() It’s a command-line tool you can use to do all sorts of things, but what I most often end up doing is converting a screen recording to a GIF. If you’re a human that doesn’t want to download a whole new application just to do a bit of video manipulation or make a GIF, stop what you’re doing and check out ffmpeg. Removing crosshatch when creating a GIF in ffmpeg Removing crosshatch when creating a GIF in ffmpeg ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |