Skip to content

Instantly share code, notes, and snippets.

@AntumDeluge
AntumDeluge / image_to_video.md
Created Feb 11, 2021
FFmpeg Single Image to Video
View image_to_video.md

Convert image to video in FFmpeg

To convert a single image to video, use the -loop option to specify we are looping an image & the -t option to specify the duration of the resulting video:

-loop 1 -i <img_in> -t <duration>

To add empty audio, use the lavfi format with anullsrc input (change channel layout & sample rate as needed):

-f lavfi -i anullsrc=channel_layout=mono:sample_rate=44100
@AntumDeluge
AntumDeluge / semitrans_to_opaque.py
Last active Dec 23, 2020
GIMP plugin to convert semitransparent pixels to opaque
View semitrans_to_opaque.py
#!/usr/bin/env python
'''
Date: 2020-12-23
Description:
A simple GIMP plugin that duplicates & merges down the current
layer multiple times in order convert semitransparent pixels to
opaque without losing/changing color.
@AntumDeluge
AntumDeluge / CHANGES.txt
Created Sep 4, 2020
A simple Python script that will convert any 3 column by 4 row N/E/S/W sprite sheet image to S/W/E/N.
View CHANGES.txt
1.1
- Fix temp file creation error when not calling script from source file directory.
1.0
- Initial release.
@AntumDeluge
AntumDeluge / stendhalserver.ps1
Last active Apr 23, 2020
PowerShell script for launching Stendhal server
View stendhalserver.ps1
<#
Public Domain dedication:
The author hereby relinquishes all rights to this work & dedicates
it to the Public Domain via Creative Commons Zero (CC0). See:
https://creativecommons.org/licenses/publicdomain/
#>
@AntumDeluge
AntumDeluge / stendhalserver.sh
Last active Apr 23, 2020
Shell script for launching Stendhal server
View stendhalserver.sh
#!/usr/bin/env bash
# Public Domain dedication:
#
# The author hereby relinquishes all rights to this work & dedicates
# it to the Public Domain via Creative Commons Zero (CC0). See:
# https://creativecommons.org/licenses/publicdomain/
# change this path to root installation directory of Stendhal server
@AntumDeluge
AntumDeluge / cleanwhitespace.py
Created Jan 10, 2020
A simple script for cleaning up whitespace in text/source files.
View cleanwhitespace.py
#!/usr/bin/env python
# A simple script for cleaning up whitespace in text/source files.
#
# Licensing: CC0
# The author hereby relinqueshes any copyright claim to this script
# & dedicates it to the public domain.
#
# TODO:
# - add help & usage information
@AntumDeluge
AntumDeluge / getstendhaltestclient.py
Last active Jan 10, 2020
A script for retrieving the current Stendhal test client.
View getstendhaltestclient.py
#!/usr/bin/env python
# Script: getstendhaltestclient.py
# Version: 1.1
#
# This file is licensed under CC0.
#
# A script for retrieving the Stendhal test client.
#
# This script requires Python to be installed on your system.
@AntumDeluge
AntumDeluge / getchatlog.sh
Last active Nov 28, 2019
A simple shell script to download & convert Stendhal chat logs to plain text for a specified month.
View getchatlog.sh
#!/usr/bin/env bash
# Script to download & convert Stendhal chat logs (https://stendhalgame.org/chat/) to plain text for a specified month.
#
# License: CC0
script="$(basename $0)"
function usage {
echo -e "\nUsage:\n\t${script} <year>-<month>"
@AntumDeluge
AntumDeluge / placeholdimg.py
Last active Oct 26, 2019
A Python script for replacing the opaque pixels of an image with an "overlay"
View placeholdimg.py
#!/usr/bin/env python
# This script replaces pixel data of a source image with that of another image by
# tiling its data over the source image.
#
# Appreciation goes out to GeeMack & Fred Weinhaus (fmw42) for helping me with
# using the ImageMagick `convert` command:
# https://stackoverflow.com/a/49397413/4677917
# Licensing: Creative Commons Zero (CC0)
@AntumDeluge
AntumDeluge / recdesk-x11.sh
Last active Mar 1, 2019
Shell script for recording my desktop with FFmpeg (X11).
View recdesk-x11.sh
#!/bin/bash
# This script is specific to my local machine. Many of the options may need
# to be changed to work on different systems.
#
# Licensing: CC0
# check if necessary executables are available
FFMPEG=$(which ffmpeg)
XWIN=$(which xwininfo)