Python & MoviePy vector graphics test

Author’s blog post about using MoviePy to animate vector graphics here
MoviePy PyPi page here
Gizeh GitHub page here

Installation

..at PyPi page they state to install MoviePy simply by: pip install moviepy
..not that fast bro, MoviePy 1.0 runs only on python 3, so i had to use older version for my rusty old python 2.7.. sudo pip install moviepy==0.2.3.5
Successfully installed moviepy decorator imageio tqdm enum34 futures
Cleaning up...

well..that worked, but package itself uses lots of other packages to work..
..on Linux Mint 17.3 i went into dependency hell, have a good luck trying..

..to run examples i had to install gizeh..
sudo pip install gizeh

RuntimeError: cairocffi does not support Python 2.x anymore. Please use Python 3 or install an older version of cairocffi.

solved by using older version: sudo pip install cairocffi==0.9.0

trying to run examples from authors blog:
from moviepy.editor import *
File "/usr/local/lib/python2.7/dist-packages/moviepy/editor.py", line 26, in
imageio.plugins.ffmpeg.download()
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/ffmpeg.py", line 40, in download
"imageio.ffmpeg.download() has been deprecated. "
RuntimeError: imageio.ffmpeg.download() has been deprecated. Use 'pip install imageio-ffmpeg' instead.'

solution found here
sudo pip install imageio==2.4.1

problems with pillow setup:
had to manually install package „libjpeg-dev“ via sudo apt-get install libjpeg-dev or installation failed

another problem right on:
ImportError: Imageio Pillow requires Pillow, not PIL!

so i tried:
sudo pip install pillow
Requirement already satisfied (use --upgrade to upgrade): pillow in /usr/lib/python2.7/dist-packages
Cleaning up...

lol?

found issue: https://github.com/Zulko/moviepy/issues/748
being rather issue of imageio: https://github.com/imageio/imageio/issues/322

– yes, there is no pillow there 😀
oh really?

sudo pip install --target=/usr/local/lib/python2.7/dist-packages/ --upgrade pillow
...
--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version Pillow 6.0.0
platform linux2 2.7.6 (default, Nov 23 2017, 15:49:48)
[GCC 4.8.4]
--------------------------------------------------------------------
...
Successfully installed pillow
Cleaning up..
.

would the example from author’s blog post work after all this? of course NOT 😀

[MoviePy] Building file circle.gif with imageio
0%| | 0/31 [00:00
Traceback (most recent call last):
File "/home/k/Plocha/PYTHON/MOVIEPY_TESTS/moviepy_test_1.py", line 18, in
clip.write_gif("circle.gif",fps=15, opt="OptimizePlus", fuzz=10)
File "</usr/local/lib/python2.7/dist-packages/decorator.pyc:decorator-gen-56>", line 2, in write_gif
File "/usr/local/lib/python2.7/dist-packages/moviepy/decorators.py", line 54, in requires_duration
return f(clip, *a, **k)
File "</usr/local/lib/python2.7/dist-packages/decorator.pyc:decorator-gen-55>", line 2, in write_gif
File "/usr/local/lib/python2.7/dist-packages/moviepy/decorators.py", line 22, in convert_masks_to_RGB
return f(clip, *a, **k)
File "/usr/local/lib/python2.7/dist-packages/moviepy/video/VideoClip.py", line 456, in write_gif
progress_bar=progress_bar)
File "/usr/local/lib/python2.7/dist-packages/moviepy/video/io/gif_writers.py", line 293, in write_gif_with_image_io
writer.append_data(frame)
File "/usr/local/lib/python2.7/dist-packages/imageio/core/format.py", line 500, in append_data
return self._append_data(im, total_meta)
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/pillowmulti.py", line 113, in _append_data
self._writer.add_image(im, duration, dispose)
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/pillowmulti.py", line 165, in add_image
im_pil = self.converToPIL(im_rect, self.opt_quantizer, self.opt_palette_size)
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/pillowmulti.py", line 353, in converToPIL
im_pil = ndarray_to_pil(im, "gif")
File "/usr/local/lib/python2.7/dist-packages/imageio/plugins/pillow.py", line 645, in ndarray_to_pil
array_buffer = arr.tobytes()
AttributeError: 'numpy.ndarray' object has no attribute 'tobytes'

..being issue: https://github.com/Zulko/moviepy/issues/499
..so sudo pip install numpy --upgrade

Successfully installed numpy
Cleaning up...

YAY IT WOIRX NOW !!!

Neoficiální podpora přenosu dat do řídících systémů Sinumerik a Heidenhain pro Linux

Co je podporováno:

  • řídící systémy: Heidenhain, Sinumerik, případně další
  • operační systémy: Ubuntu, Linux Mint, Debian a další

Jak to funguje?

  • do systému se přidá MIME typ (není vyžadováno)
  • do prohlížeče souborů přidáme „akci“ (není vyžadováno)
  • pro odesílání dat slouží program napsaný v jazyce Python 2 s využitím QT4, nebo jeho variace integrovaná do prohlížeče souborů(Nemo), kdy lze odesílat dvěma kliky, nebo jednodušší varianta bez gui (bash skript), také vyžadující pouze pravý klik > odeslat , hotovo
  • pro příjem dat slouží dvouvláknový program napsaný v jazyce Python 2 s využitím QT4

Licence?

Kde to je?

  • zájemcům zašlu požadovanou variantu výměnou za pár fotek jejich stroje (nejlépe se souhlasem ke zveřejnění) a třeba krátkou historii mašiny, pokud je zajímavá, nebo nějaký ten servisní manuál, nebo nějaké poznámky k datovým přenosům 📸+📝 > 📧 = 💿

Proč to dělám?

  • proto
  • po republice je spousta strojů
  • počítače z 90’s dosluhují
  • potřeba nahradit (software pro) FreeDos a Win

TODO:  👨‍🔧

ESP8266 PacketMonitor mod to Adafruit library

https://github.com/KiLLAAA/PacketMonitor

Yay, another nice port to have..
Adafruit lib is better for number of reasons..at least for me 😁
– notes: check esp8266 i2c speed setting in your version of the Adafruit library

if there is no setting in your version, like in my old ones, insert these lines into Adafruit_SSD1306.cpp file, into the fuction which does display init ->
void Adafruit_SSD1306::display(void), pick some line above the „// I2C“ comment, or if u dont know..just leave it or google it..
#ifdef ESP8266 // set speed for ESP devices
Wire.setClock(400000L);
#endif