Linux/Python : Merge d’un GPX et d’une video

Etape 1 : Installation : https://pypi.org/project/gopro-overlay/

$ python3 -m venv venv
$ venv/bin/pip install gopro-overlay
$ mkdir ~/.gopro-graphics/
$ cat ~/.gopro-graphics/ffmpeg-profiles.json
{
  "overlay": {
    "input": [],
    "output": ["-vcodec", "png"]
  }
}

Etape 2 : Premier test et premier drame

$ venv/bin/gopro-dashboard.py --use-gpx-only --gpx Nextcloud/Pipe/Video/BoucleResideo.gpx 1920x1080 Nextcloud/Pipe/Video/BoucleResideo.mov 
Starting gopro-dashboard version 0.100.0
ffmpeg version is 4.4.2-0ubuntu0.22.04.1
Using Python version 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0]
Traceback (most recent call last):
  File "/home/arias/venv/bin/gopro-dashboard.py", line 107, in 
    font = load_font(args.font)
  File "/home/arias/venv/lib/python3.10/site-packages/gopro_overlay/font.py", line 5, in load_font
    return ImageFont.truetype(font=font, size=size)
  File "/home/arias/venv/lib/python3.10/site-packages/PIL/ImageFont.py", line 1008, in truetype
    return freetype(font)
  File "/home/arias/venv/lib/python3.10/site-packages/PIL/ImageFont.py", line 1005, in freetype
    return FreeTypeFont(font, size, index, encoding, layout_engine)
  File "/home/arias/venv/lib/python3.10/site-packages/PIL/ImageFont.py", line 255, in __init__
    self.font = core.getfont(
OSError: cannot open resource

Etape 2b : Avec copie de la « font »

$ venv/bin/gopro-dashboard.py --use-gpx-only --gpx Nextcloud/Pipe/Video/BoucleResideo.gpx --overlay-size 1920x1080 Nextcloud/Pipe/Video/BoucleResideo.mov --font Nextcloud/Pipe/Video/Roboto-Medium.ttf 
Starting gopro-dashboard version 0.100.0
ffmpeg version is 4.4.2-0ubuntu0.22.04.1
Using Python version 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0]
GPX/FIT file:     2023-07-05T17:51:34+00:00 -> 2023-07-05T18:02:30+00:00
Timer(loading timeseries - Called: 1, Total: 2.99467, Avg: 2.99467, Rate: 0.33)
Generating overlay at Dimension(x=1920, y=1080)
Timeseries has 6561 data points
Processing....
Timer(processing - Called: 1, Total: 4.25000, Avg: 4.25000, Rate: 0.24)
FFMPEG Output is in /tmp/tmpkga_2k5h
Timelapse Factor = 1.000
Layout -> Include component 'date_and_time' = True
Layout -> Include component 'gps_info' = True
Layout -> Include component 'gps-lock' = True
Layout -> Include component 'big_mph' = True
Layout -> Include component 'gradient_chart' = True
Layout -> Include component 'gradient' = True
Layout -> Include component 'altitude' = True
Layout -> Include component 'temperature' = True
Layout -> Include component 'cadence' = True
Layout -> Include component 'heartbeat' = True
Layout -> Include component 'moving_map' = True
Layout -> Include component 'journey_map' = True
Executing 'ffmpeg -hide_banner -y -hide_banner -loglevel info -f rawvideo -framerate 10.0 -s 1920x1080 -pix_fmt rgba -i - -r 30 -vcodec libx264 -preset veryfast Nextcloud/Pipe/Video/BoucleResideo.mov'
...

Etape 3 : Shotcut : https://shotcut.org/

 

Oracle Linux / Redhat : systemd change /dev/null permissions

Pour fixer le problème des changements de permission sur /dev/null par systemd j’ai fait la commande suivante :

# grep -riL "ExecStartPost" /usr/lib/systemd/system/*service | xargs grep "TTYPath=/dev/tty" | sed 's/:/ /g' | awk '{print $1}' | xargs sed -i '/^ExecStart.*/i ExecStartPost = -/usr/bin/xset -display :0 -dpms s off'

# systemctl daemon-reload

Pour tous les types TTY j’ai ajouté :

ExecStartPost = -/usr/bin/xset -display :0 -dpms s off

J’ai l’impression que le problème est fixé.

Ubuntu : disk-space-saver : Bof …

En passant

J’ai voulu tester disk-space-saver mais il a planté … trop de fichiers.

disk-space-saver
Gtk-Message: 16:51:43.225: Failed to load module "xapp-gtk3-module"
Gtk-Message: 16:51:43.225: Failed to load module "appmenu-gtk-module"
Gtk-Message: 16:51:45.005: GtkDialog mapped without a transient parent.
This is discouraged.

<--- Last few GCs --->

[11047:0xd780080c000]    77004 ms: Scavenge 1885.0 (1950.3) -> 1879.7
(1951.8) MB, 2.6 / 0.0 ms  (average mu = 0.991, current mu = 0.991)
allocation failure;
[11047:0xd780080c000]    77074 ms: Scavenge 1887.0 (1951.9) -> 1881.7
(1953.7) MB, 2.5 / 0.0 ms  (average mu = 0.991, current mu = 0.991)
allocation failure;
[11047:0xd780080c000]    77141 ms: Scavenge 1888.5 (1953.9) -> 1883.0
(1955.1) MB, 2.5 / 0.0 ms  (average mu = 0.991, current mu = 0.991)
allocation failure;


<--- JS stacktrace --->

[11047:0927/165300.472533:ERROR:v8_initializer.cc(714)] V8 process OOM
(Oilpan: Reserving memory.).

Misère.