-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
windows access violation loading cairo ToyFontFace #171
Comments
Hi. Thanks for your interest in the software! The output you have posted looks like it might not be complete. Please could you double-check that there isn't any missing. I dont have a Windows machine, so testing on Windows is a bit tricky, but it is believed to work on Windows, and it gets tested when there are significant changes. I'll find a Windows machine and see if there is a problem. In the meantime, I'd appreciate it if you could double-check that you posted all the output. Thanks! |
I've checked the output and it is complete...that's why I opened the issue |
Could I send you my layout file? maybe is the file wrong... |
Yes, please do! In theory, the program should report an error parsing the file, but maybe not in this case. Good idea. Please could you send it to [email protected] Thanks! |
Hi I had the chance to look at your file. When I run the program I am getting an error - I am surprised that you don't see anything? It would be interesting to know how you are running the program.
Anyhow - this isn't a very good error message, but it is caused by the following bit in your layout file:
The font size has been set to zero which is causing a problem. If you set this to a larger value it should work. In the meantime I can add some validation for this value so that the error message is improved. Thanks for bringing it to my attention. |
Hello, I've followed your instruction on the website.
Set-ExecutionPolicy Unrestricted -Scope Process
.\venv\Scripts\activate.ps1
python .\venv\Scripts\gopro-dashboard.py --font trebuc.ttf --ffmpeg C:\Users\james\Downloads\ffmpeg-6.0-essentials_build\ffmpeg-6.0-essentials_build\bin input.mp4 output.mp4
Of course the last line has been changed with the line I've sent you before.
And I did receive back any error.
I will check and I'll give you a feedback.
Ottieni BlueMail per Android
Il giorno 21 Gen 2024, 16:18, alle ore 16:18, James Richardson ***@***.***> ha scritto:
…Hi
I had the chance to look at your file. When I run the program I am
getting an error - I am surprised that you don't see anything? It would
be interesting to know how you are running the program.
```
Traceback (most recent call last):
File "/home/richja/dev/gopro-graphics/bin/gopro-dashboard.py", line
362, in <module>
overlay = Overlay(framemeta=frame_meta, create_widgets=layout_creator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout.py", line
96, in __init__
self.scene = Scene(create_widgets(self.entry))
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml.py",
line 210, in create
*[do_element(child, 1) for child in root if want_element(child)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml.py",
line 210, in <listcomp>
*[do_element(child, 1) for child in root if want_element(child)]
^^^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml.py",
line 203, in do_element
return elements[element.tag](element, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml_attribute.py",
line 32, in wrapper
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml.py",
line 167, in create_composite
*[do_element(child, level + 1) for child in element if
want_element(child)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml.py",
line 167, in <listcomp>
*[do_element(child, level + 1) for child in element if
want_element(child)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml.py",
line 203, in do_element
return elements[element.tag](element, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml.py",
line 156, in create_component
widget=method(child, entry=entry)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml_attribute.py",
line 32, in wrapper
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml.py",
line 455, in create_text
font=self.font(iattrib(element, "size", d=16)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/richja/dev/gopro-graphics/gopro_overlay/layout_xml.py",
line 113, in font_at
return fonts.setdefault(size, font.font_variant(size=size))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/home/richja/dev/gopro-graphics/venv/lib/python3.11/site-packages/PIL/ImageFont.py",
line 613, in font_variant
return FreeTypeFont(
^^^^^^^^^^^^^
File
"/home/richja/dev/gopro-graphics/venv/lib/python3.11/site-packages/PIL/ImageFont.py",
line 226, in __init__
self.font = core.getfont(
^^^^^^^^^^^^^
OSError: invalid ppem value
```
Anyhow - this isn't a very good error message, but it is caused by the
following bit in your layout file:
```
<component type="text" y="80" size="0"
rgb="255,255,255,128">Alt(m)</component>
```
The font size has been set to zero which is causing a problem. If you
set this to a larger value it should work. In the meantime I can add
some validation for this value so that the error message is improved.
Thanks for bringing it to my attention.
--
Reply to this email directly or view it on GitHub:
#171 (comment)
You are receiving this because you authored the thread.
Message ID:
***@***.***>
|
Error message should be improved in V0.125.0 which is on PyPI. |
I have just tried this on a windows machine - and i agree - you cannot see the output! Even the improved error message. I don't understand this behaviour. |
OK - This is actually a very different error to what it first appeared.... the program is crashing inside PyCairo.
This seems to be that the required font isn't installed, but I wouldn't expect a fatal error. Still investigating... |
This seems to be a problem in pycairo. Using non-cairo libraries will work, or docker images. |
Hi again, faulthandler.enable() print([x for x in os.listdir('c:/windows/fonts') if "arial" in x])
In my point of view when the class is called somehow the surface is missing: I suppose that the "face" doesn't know where should be added |
Hmm. that is interesting. thanks! |
I found a workaround (not clean but sounds working): and on every file where the "face" is called...sounds working (on win11) ...please check it deeply |
Hello, I have some trouble creating video file on win11... here the command (I removed personal information) and the result:
python .\venv\Scripts\gopro-dashboard.py --font trebuc.ttf --layout-xml C:\Users[...]\layout.xml --use-gpx-only --gpx C:\Users[...]\20230706030824-58228-data.gpx --profile overlay --show-ffmpeg --debug-metadata --print-timings --overlay-size 1920x1080 C:\Users[...]\test.mov
Here the result:
Starting gopro-dashboard version 0.124.0
Running ['ffmpeg', '-version']
Running ['ffmpeg', '-v', 'quiet', '-codecs']
Running ['ffmpeg', '-version']
ffmpeg version is 6.1.1-essentials_build-www.gyan.dev
Using Python version 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)]
GPX/FIT file: 2023-07-02T11:41:40+00:00 -> 2023-07-02T11:53:02+00:00
Timer(loading timeseries - Called: 1, Total: 8.28410, Avg: 8.28410, Rate: 0.12)
Generating overlay at Dimension(x=1920, y=1080)
Timeseries has 6821 data points
Processing....
Timer(processing - Called: 1, Total: 11.99538, Avg: 11.99538, Rate: 0.08)
Using user-defined profile: overlay
Timelapse Factor = 1.000
Layout -> Include component 'speed' = True
Where is my mistake (I suppose I made some)
Thank you
The text was updated successfully, but these errors were encountered: