Convert videos to GIFs with reasonable colors
2 mins read

Convert videos to GIFs with reasonable colors

March 05, 2019 [bash, Programming, Tech]

Here’s a little script I wrote to avoid copy-pasting ffmpeg commands from superuser every time I need them.

It converts videos into GIF files by first calculating a good palette, then using that palette.

Use:

./to_gif input.mp4 output.gif

to_gif file (which should be executable):

#!/bin/bash

set -e
set -u

# Credit: 

INPUT="$1"
OUTPUT="$2"

PALETTE=$(mktemp --suffix=.png)

ffmpeg -y -i "${INPUT}" -vf palettegen "${PALETTE}"
ffmpeg -y -i "${INPUT}" -i "${PALETTE}" \
    -filter_complex "fps=15,paletteuse" "${OUTPUT}"

rm -f "${PALETTE}"

Note: You may want to change the number after fps= to adjust how fast the video plays.

Renew: changed to use mktemp instead of tempfile.

Renew: and here’s how I added it to the context menu in Caja:

Place the above file in $HOME/bin/to_gif.

Create a file ~/.config/caja/scripts/to_gif (don’t forget to make it executable):

#!/bin/bash

mate-terminal -x "${HOME}/bin/to_gif" "$1" "$1".gif

PakarPBN

A Private Blog Network (PBN) is a collection of websites that are controlled by a single individual or organization and used primarily to build backlinks to a “money site” in order to influence its ranking in search engines such as Google. The core idea behind a PBN is based on the importance of backlinks in Google’s ranking algorithm. Since Google views backlinks as signals of authority and trust, some website owners attempt to artificially create these signals through a controlled network of sites.

In a typical PBN setup, the owner acquires expired or aged domains that already have existing authority, backlinks, and history. These domains are rebuilt with new content and hosted separately, often using different IP addresses, hosting providers, themes, and ownership details to make them appear unrelated. Within the content published on these sites, links are strategically placed that point to the main website the owner wants to rank higher. By doing this, the owner attempts to pass link equity (also known as “link juice”) from the PBN sites to the target website.

The purpose of a PBN is to give the impression that the target website is naturally earning links from multiple independent sources. If done effectively, this can temporarily improve keyword rankings, increase organic visibility, and drive more traffic from search results.

Jasa Backlink

Download Anime Batch