Skip to main content

media editing

Project description

media_editing

setup

pip install media_editing

Markdown_to_HTML.py

This script recursively converts Markdown files at a specified directory to HTML files, with options to include numbered sections, table of contents, CSS and to output commands only, not execute.

Example usage with CSS specified is as follows:

cd my_writing_files_in_Markdown

CSS="https://raw.githack.com/wdbm/style/master/SS/bluescale.css"
Markdown_to_HTML.py --CSS="${CSS}"

images_to_video.py

This script converts a list of image files to a video with the options of specifying the image extension, a soundtrack file, an output filename and a framerate.

text_to_QR_code.py

This script converts specified text to a QR code of specified scale and filepath and optionally displays the resulting QR code image using the default image viewer.

vidgif.py

This script converts a video to an animated GIF, with the option to output commands only, not execute.

OCR of region of display

sudo apt install imagemagick scrot tesseract-ocr
tmp="$(mktemp)"
scrot -s "${tmp}".png -q 100
mogrify -modulate 100,0 -resize 400% "${tmp}".png
tesseract "${tmp}".png "${tmp}" &> /dev/null
cat "${tmp}".txt

High Dynamic Resolution (HDR)

Luminance HDR

setup

sudo apt update
sudo apt install luminance-hdr

settings used to combine a darker and a lighter image 2019-02-24

  • tonemap

    • operator: Reinhard ’05

    • brightness: -10

    • chromatic adaptation: 0

    • light adaptation: 1

  • process

    • pre-gamma: 0.86


recording internal audio: audio-recorder

setup

sudo dpkg -i audio-recorder_1.7-5~xenial_amd64.deb

usage

audio-recorder
  • Under “Audio settings.”, select the source as something like “Clear Chat Comfort USB Headset (Audio output)”.

  • Select “Start recording”.

image0


FFmpeg

trim video using start and stop times without reencoding

Note the ordering of the command line arguments and options.

filepath_1="Star.Wars.1977.Despecialized.720p.x264.AC3.5.1.mkv"
filepath_2="out.mkv"
start="01:40:33"
stop="01:54:48"

time ffmpeg -y -i "${filepath_1}" -ss "${start}" -to "${stop}" -c copy "${filepath_2}"

remove audio from video

The -an flag is used.

ffmpeg -i in.mkv -c copy -an out.mkv

ImageMagick

change quality of directory of JPEG images

mogrify -quality 95 *.jpg

strip/remove an image of all profiles and comments using ImageMagick

convert -strip image_1.png image_2.png
mogrify -strip *.jpg

create an image of specified width, height and color using ImageMagick

Width is specified before height.

convert -size 100x100 xc:#000000 out.png
convert -size 100x100 xc:rgba\(255,0,0,0.4\) out.png
width_pixels="3495"
height_pixels="2160"
color="#eeeeee"
filepath="out.png"
convert -size "${width_pixels}"x"${height_pixels}" xc:"${color}" "${filepath}"
width_pixels="3107"
height_pixels="1920"
color="#eeeeee"
filepath="background.png"
convert -size "${width_pixels}"x"${height_pixels}" xc:"${color}" "${filepath}"

overlay one foreground image on the center of a background image using ImageMagick

convert background.png -coalesce -gravity center -draw 'image over 0,0,0,0 "foreground.png"' out.png
filepath_foreground="foreground.png"
filepath_background="background.png"
filepath_output="out.png"

# not working, under development:
# time convert "${filepath_background}" -coalesce -gravity center -draw 'image over 0,0,0,0 \"${filepath_foreground}\"' "${filepath_output}"

The option -layers flatten may be worth considering.

reduce quality of images at working directory in batch, making new images at new directory

mkdir new
mogrify -path new -quality 80 -format jpg *.jpg

Inkscape

set up palettes for Inkscape

/usr/share/inkscape/palettes

convert bitmap to vector using Inkscape


Calibre

setup 2019-01-24T0350Z

sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin

view ebook

ebook-viewer book.epub

convert EPUB to MOBI using ebook-convert

ebook-convert book.epub book.mobi

convert LaTeX to HTML to EPUB

mk4ht htlatex book.tex 'xhtml,charset=utf-8,pmathml'
ebook-convert book.html book.epub

convert Markdown to EPUB

ebook-convert book.md book.epub

music

some music software and tools


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

media_editing-2021.10.17.2018.tar.gz (457.1 kB view details)

Uploaded Source

File details

Details for the file media_editing-2021.10.17.2018.tar.gz.

File metadata

File hashes

Hashes for media_editing-2021.10.17.2018.tar.gz
Algorithm Hash digest
SHA256 3db6cf280c74e2b71bc8b6aab73f35dfeaca00bc72d08e60abaec3a57ea167ed
MD5 6d2edc040e6724848f44dafec540d611
BLAKE2b-256 bcb4dbe21a756b6729e29274ced9aebfe46cf88ab497813a1c703d3df6d17adc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page