media_editing
=============
setup
=====
.. code:: bash
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:
.. code:: bash
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
========================
.. code:: bash
sudo apt install imagemagick scrot tesseract-ocr
.. code:: bash
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-1:
setup
~~~~~
.. code:: bash
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-2:
setup
-----
.. code:: bash
sudo dpkg -i audio-recorder_1.7-5~xenial_amd64.deb
usage
-----
.. code:: bash
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.
.. code:: bash
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.
.. code:: bash
ffmpeg -i in.mkv -c copy -an out.mkv
--------------
ImageMagick
===========
change quality of directory of JPEG images
------------------------------------------
.. code:: bash
mogrify -quality 95 *.jpg
strip/remove an image of all profiles and comments using ImageMagick
--------------------------------------------------------------------
.. code:: bash
convert -strip image_1.png image_2.png
.. code:: bash
mogrify -strip *.jpg
create an image of specified width, height and color using ImageMagick
----------------------------------------------------------------------
Width is specified before height.
.. code:: bash
convert -size 100x100 xc:#000000 out.png
.. code:: bash
convert -size 100x100 xc:rgba\(255,0,0,0.4\) out.png
.. code:: bash
width_pixels="3495"
height_pixels="2160"
color="#eeeeee"
filepath="out.png"
convert -size "${width_pixels}"x"${height_pixels}" xc:"${color}" "${filepath}"
.. code:: bash
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
----------------------------------------------------------------------------------
.. code:: bash
convert background.png -coalesce -gravity center -draw 'image over 0,0,0,0 "foreground.png"' out.png
.. code:: bash
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
------------------------------------------------------------------------------------------
.. code:: bash
mkdir new
mogrify -path new -quality 80 -format jpg *.jpg
--------------
Inkscape
========
set up palettes for Inkscape
----------------------------
.. code:: bash
/usr/share/inkscape/palettes
convert bitmap to vector using Inkscape
---------------------------------------
- https://www.youtube.com/watch?v=SjCFRI3knhE
--------------
Calibre
=======
setup 2019-01-24T0350Z
----------------------
.. code:: bash
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
view ebook
==========
.. code:: bash
ebook-viewer book.epub
convert EPUB to MOBI using ebook-convert
========================================
.. code:: bash
ebook-convert book.epub book.mobi
convert LaTeX to HTML to EPUB
=============================
.. code:: bash
mk4ht htlatex book.tex 'xhtml,charset=utf-8,pmathml'
ebook-convert book.html book.epub
convert Markdown to EPUB
========================
.. code:: bash
ebook-convert book.md book.epub
--------------
music
=====
some music software and tools
-----------------------------
- Audacity
- Hydrogen
- `MidiEditor <https://github.com/markusschwenk/midieditor>`__
- `MusE <https://muse-sequencer.github.io>`__
- MuseScore
- `Online Sequencer <https://onlinesequencer.net>`__
--------------
.. |image0| image:: https://raw.githubusercontent.com/wdbm/media_editing/master/media/Audio_Recorder.png
=============
setup
=====
.. code:: bash
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:
.. code:: bash
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
========================
.. code:: bash
sudo apt install imagemagick scrot tesseract-ocr
.. code:: bash
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-1:
setup
~~~~~
.. code:: bash
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-2:
setup
-----
.. code:: bash
sudo dpkg -i audio-recorder_1.7-5~xenial_amd64.deb
usage
-----
.. code:: bash
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.
.. code:: bash
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.
.. code:: bash
ffmpeg -i in.mkv -c copy -an out.mkv
--------------
ImageMagick
===========
change quality of directory of JPEG images
------------------------------------------
.. code:: bash
mogrify -quality 95 *.jpg
strip/remove an image of all profiles and comments using ImageMagick
--------------------------------------------------------------------
.. code:: bash
convert -strip image_1.png image_2.png
.. code:: bash
mogrify -strip *.jpg
create an image of specified width, height and color using ImageMagick
----------------------------------------------------------------------
Width is specified before height.
.. code:: bash
convert -size 100x100 xc:#000000 out.png
.. code:: bash
convert -size 100x100 xc:rgba\(255,0,0,0.4\) out.png
.. code:: bash
width_pixels="3495"
height_pixels="2160"
color="#eeeeee"
filepath="out.png"
convert -size "${width_pixels}"x"${height_pixels}" xc:"${color}" "${filepath}"
.. code:: bash
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
----------------------------------------------------------------------------------
.. code:: bash
convert background.png -coalesce -gravity center -draw 'image over 0,0,0,0 "foreground.png"' out.png
.. code:: bash
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
------------------------------------------------------------------------------------------
.. code:: bash
mkdir new
mogrify -path new -quality 80 -format jpg *.jpg
--------------
Inkscape
========
set up palettes for Inkscape
----------------------------
.. code:: bash
/usr/share/inkscape/palettes
convert bitmap to vector using Inkscape
---------------------------------------
- https://www.youtube.com/watch?v=SjCFRI3knhE
--------------
Calibre
=======
setup 2019-01-24T0350Z
----------------------
.. code:: bash
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sudo sh /dev/stdin
view ebook
==========
.. code:: bash
ebook-viewer book.epub
convert EPUB to MOBI using ebook-convert
========================================
.. code:: bash
ebook-convert book.epub book.mobi
convert LaTeX to HTML to EPUB
=============================
.. code:: bash
mk4ht htlatex book.tex 'xhtml,charset=utf-8,pmathml'
ebook-convert book.html book.epub
convert Markdown to EPUB
========================
.. code:: bash
ebook-convert book.md book.epub
--------------
music
=====
some music software and tools
-----------------------------
- Audacity
- Hydrogen
- `MidiEditor <https://github.com/markusschwenk/midieditor>`__
- `MusE <https://muse-sequencer.github.io>`__
- MuseScore
- `Online Sequencer <https://onlinesequencer.net>`__
--------------
.. |image0| image:: https://raw.githubusercontent.com/wdbm/media_editing/master/media/Audio_Recorder.png
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)
File details
Details for the file media_editing-2021.10.17.2018.tar.gz.
File metadata
- Download URL: media_editing-2021.10.17.2018.tar.gz
- Upload date:
- Size: 457.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
Python-urllib/3.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3db6cf280c74e2b71bc8b6aab73f35dfeaca00bc72d08e60abaec3a57ea167ed
|
|
| MD5 |
6d2edc040e6724848f44dafec540d611
|
|
| BLAKE2b-256 |
bcb4dbe21a756b6729e29274ced9aebfe46cf88ab497813a1c703d3df6d17adc
|