firatkiral / pypeek Goto Github PK
View Code? Open in Web Editor NEWPeek screen recorder and screenshot with annotations
License: GNU General Public License v3.0
Peek screen recorder and screenshot with annotations
License: GNU General Public License v3.0
Hi!
I found this code:
Lines 1049 to 1058 in ac94d6a
systemcall
can be controlled by an attacker, then this is a command injection vulnerability.shell=True
here and build a list to call that command, not a flat string.
Thanks, Sebastian
I love this app!
Would it be possible to put annotations elements on only select frames? For example, sometimes I want to record my web browser app and I have to move from one tab to another in the web app. When on the first tab I may circle something in red I don't want that circle to show up through out the recording because I will show things on the second tab and the thing I circle is no longer visible making the red circle out of place.
My environment:
Python 3.12.1
I can reliably reproduce this error. First, record something in mp4 format, finish the recording, then press save, the GUI will freeze and this error is displayed:
$ pypeek
Traceback (most recent call last):
File "/home/woynert/.local/share/pipx/venvs/pypeek/lib/python3.12/site-packages/pypeek/main.py", line 684, in encoding_done
number = int(number if number.isdigit() else 1)
^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'isdigit'
When running pypeek --shortcut
, the resulting shortcut's target is C:\Users\<username>\Desktop\peek-gui
, which does not work. It must be manually updated to C:\Users\<username>\AppData\Local\Programs\Python\Python310\Scripts\pypeek-gui.exe
.
Hi, thanks for this great app!
It would be nice to be able to define the template for the result file. Allowing some variables, at least date and time.
Issue description says it all. This happened on Ubuntu 22.10 with X11.
Looking at the requirements, they state that only Xorg is supported currently: https://github.com/firatkiral/pypeek#requirements
That is unfortunate, since various Linux distros move from Xorg to Wayland as default, so it would make sense to support it if a broad user base is desired.
I was able to start the application and tried to record on Wayland, but after stopping the recording there are no videos rendered, and I see various error stack traces in the CLI output.
I don't remember original Peek shortcuts but they were useful.
Found this project on peek repo. Nice initiative to build this very useful!
Unfortunately, I got this error:
Traceback (most recent call last):
File "/home/username/.local/pipx/venvs/pypeek/lib/python3.11/site-packages/pypeek/main.py", line 668, in recording_done
drawover = DrawOver(cache_folder, self.drawover_options, self.capture.true_fps, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/climentea/.local/pipx/venvs/pypeek/lib/python3.11/site-packages/pypeek/drawover.py", line 37, in __init__
self.bg_pixmap = QPixmap(os.path.join(image_path, self.image_filenames[0]))
~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
Other issues:
Setup:
Peek rather conveniently names files as Peek 2024-02-13 15-27.gif
. I find that pretty good and useful. pypeek
instead names them like peek_1.gif
.
I think the best option is to allow the user to specify the pattern by themselves.
When running in i3, the area selection does not seem to work at all. pypeek simply records the full screen at all times.
It seems that unlike peek, pypeek starts as a normal window. In i3 that means that the area of the screen is split and some place and size is given to pypeek. Instead, it should be a floating window that is resizable by itself. Now, I made it floating myself by using a shortcut, but that forced the pypeek window to be of a minimum size. So, in general, in i3 it seems that pypeek can only record the full screen (which honestly defeats the purpose).
Hello friend, in the recording there is a BUG in the FrameRate it does not record above 11 to 15 frames, it gets very locked, and if you change the settings, it stays the same, could you please solve it, I found your program very good and beautiful, can I bring a video of it on my channel?
Thank you so much for pypeek!
I'd like to ask you to add window width and height fields in settings for numeric input.
Hi @firatkiral,
I saw the re-addition of shell=True
in 1e218f9 which breaks support for Linux, e.g. when drawing on the video and then saving. For a minimal demo of the problem, here's what it looks like in IPython:
In [1]: import subprocess
In [2]: subprocess.Popen(['echo 1 2 3', '4', '4'], shell=True)
1 2 3
I'm not sure of the Windows affects of shell=True
as of yet, but for a start maybe a patch like this helps both Windows and Linux before a real solution for Windows:
diff --git a/src/pypeek/main.py b/src/pypeek/main.py
index a41be0d..6e3ca79 100644
--- a/src/pypeek/main.py
+++ b/src/pypeek/main.py
@@ -1078,10 +1078,13 @@ class Capture(QThread):
try:
# Shell = True, otherwise the terminal window pops up on Windows app
- process = subprocess.Popen(systemcall, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding='utf-8', errors='replace')
+ shell = (os.name == 'nt')
+ process = subprocess.Popen(systemcall, shell=shell, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, encoding='utf-8', errors='replace')
while True:
realtime_output = process.stdout.readline()
if realtime_output == '' and process.poll() is not None:
+ if process.returncode != 0:
+ vidfile = None
break
if realtime_output:
if "frame=" in realtime_output:
What do you think?
Best, Sebastian
CC #2
Hi, I am not familiar with pip
, I am afraid to forget to keep pypeek updated.
Is there a chance to have pypeek in distro repositories or as a flatpak or snap?
Maybe mine is just ignorance, but I feel uncomfortable with pip
https://www.welivesecurity.com/en/eset-research/pernicious-potpourri-python-packages-pypi/
The installation instructions say it works with Python 3.10 or later. However, Python 3.12 gives:
ERROR: Cannot install pypeek==2.7.10, pypeek==2.7.11, pypeek==2.7.12, pypeek==2.7.13, pypeek==2.7.14, pypeek==2.8.0, pypeek==2.8.2, pypeek==2.8.5, pypeek==2.8.6, pypeek==2.8.7, pypeek==2.8.8, pypeek==2.8.9, pypeek==2.9.0, pypeek==2.9.1, pypeek==2.9.2, pypeek==2.9.3, pypeek==2.9.4, pypeek==2.9.5, pypeek==2.9.6 and pypeek==2.9.7 because these package versions have conflicting dependencies.
The conflict is caused by:
pypeek 2.9.7 depends on pyside6~=6.4.0
pypeek 2.9.6 depends on pyside6~=6.4.0
pypeek 2.9.5 depends on pyside6~=6.4.0
pypeek 2.9.4 depends on pyside6~=6.4.0
pypeek 2.9.3 depends on pyside6~=6.4.0
pypeek 2.9.2 depends on pyside6~=6.4.0
pypeek 2.9.1 depends on pyside6~=6.4.0
pypeek 2.9.0 depends on pyside6~=6.4.0
pypeek 2.8.9 depends on pyside6~=6.4.0
pypeek 2.8.8 depends on pyside6~=6.4.0
pypeek 2.8.7 depends on pyside6~=6.4.0
pypeek 2.8.6 depends on pyside6~=6.4.0
pypeek 2.8.5 depends on pyside6~=6.4.0
pypeek 2.8.2 depends on pyside6~=6.4.0
pypeek 2.8.0 depends on pyside6~=6.4.0
pypeek 2.7.14 depends on pyside6~=6.4.0
pypeek 2.7.13 depends on pyside6~=6.4.0
pypeek 2.7.12 depends on pyside6~=6.4.0
pypeek 2.7.11 depends on pyside6~=6.4.0
pypeek 2.7.10 depends on pyside6~=6.4.0
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
The current version of pyside6 is 6.6.0. If I try to manually pip install pyside6==6.4.0
, I get
ERROR: Ignored the following versions that require a different python version: 6.3.0 Requires-Python <3.11,>=3.6; 6.3.1 Requires-Python <3.11,>=3.6; 6.3.2 Requires-Python <3.11,>=3.6; 6.4.0 Requires-Python <3.11,>=3.6; 6.4.0.1 Requires-Python <3.12,>=3.7; 6.4.1 Requires-Python <3.12,>=3.7; 6.4.2 Requires-Python <3.12,>=3.7; 6.4.3 Requires-Python <3.12,>=3.7; 6.5.0 Requires-Python <3.12,>=3.7; 6.5.1 Requires-Python <3.12,>=3.7; 6.5.1.1 Requires-Python <3.12,>=3.7; 6.5.2 Requires-Python <3.12,>=3.7; 6.5.3 Requires-Python <3.12,>=3.7
ERROR: Could not find a version that satisfies the requirement pyside6==6.4.0 (from versions: 6.6.0)
ERROR: No matching distribution found for pyside6==6.4.0
So it seems like pypeek will only work with exactly Python 3.10 (and not any other version).
Hi @firatkiral ,
when I run pypeek --help
it starts to download pre-compiled ffmpeg binaries:
# pypeek --help
Installing ffmpeg to /tmp/tmp.PqUazPhkz1/pypeek/venv/lib/python3.11/site-packages/pypeek/bin/linux
Downloading https://github.com/zackees/ffmpeg_bins/raw/main/v5.0/linux.zip -> /tmp/tmp.PqUazPhkz1/pypeek/venv/lib/python3.11/site-packages/pypeek/bin/linux.zip
..........................................^CTraceback (most recent call last):
[..]
File "/tmp/tmp.PqUazPhkz1/pypeek/venv/lib/python3.11/site-packages/pypeek/main.py", line 15, in <module>
get_ffmpeg()
File "/tmp/tmp.PqUazPhkz1/pypeek/venv/lib/python3.11/site-packages/pypeek/ffmpeg.py", line 92, in get_ffmpeg
ffmpeg, _ = get_or_fetch_platform_executables_else_raise()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/tmp.PqUazPhkz1/pypeek/venv/lib/python3.11/site-packages/pypeek/ffmpeg.py", line 61, in get_or_fetch_platform_executables_else_raise
download_file(url, local_zip)
[..]
KeyboardInterrupt
That is unexpected, unfortunate and scary in my world:
--help
should never do things like that, display some help quick, and get out of the way.Please re-consider these choices, these are by no means sane defaults. Thank you!
Best, Sebastian
Hi!
Just a quick note that the app uses both "pypeek" and "peek" for a name at different places. I would like to suggest to use "pypeek" only and consistently. Just an idea.
Best, Sebastian
Hi, thanks for the awesome tool.
I'd like to request a feature for removing certain frames. This could just leverage the same slider functionality that already exists (see illustration below).
This feature will be useful for speeding up the animation which could get quite long when it is showing a page being loaded etc.
Thanks
When in dual monitor setup and recording on the second monitor, the cursor is missing from the recorded video.
I have created an initial package for Arch Linux on the AUR
Some things that came to my mind:
.desktop
file for Linux somewhere.
pypeek.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Pypeek
Comment=Simple animated GIF screen recorder with an easy to use interface
Exec=pypeek
Icon=pypeek
Terminal=false
StartupNotify=false
Categories=Utility;
src/pypeek/ffmpeg.py
that you're downloading FFMPEG binaries from ZIP files inside this repo. I think you should prefer using the system's ffmpeg
if it's in the $PATH
and only download if it's not available/compatible.$XDG_CONFIG_HOME/pypeek
if set, otherwise $HOME/.config/pypeek
%appdata%\pypeek
~/Library/Preferences/com.github.pypeek
(not entirely sure about that)I can't find where recordings are saved, I've looked everywhere. Installed from the app store. Thank you.
After looking at the preview of the recording (which looked correct) and saving it, the final video does not only contain the area selected but the full primary screen.
That's an issue when you have sensitive data or areas of your screen that you don't want to expose for whatever reason.
I gave up using the original Peek, every time I record MP4 with the sound it crashes. PyPython seems very promising. ๐ค
Noticed from a quick search that there is both https://github.com/firatkiral/pypeek and https://github.com/pypeek/pypeek
It would make sense to remove the one that is not actively maintained so it is clearer to potential users.
Personally, I think that https://github.com/pypeek/pypeek would look more official but not a big deal.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.