Git Product home page Git Product logo

giph's Introduction

giph

giph is a screen recorder that records the desktop, a window or selection and encodes it into a gif file. It prints the encoded gif directly to standard output when omitting the output filename.

demo

I used giph to record a gif of giph recording a gif.

Examples

$ giph -s -l -c 1,1,1,0.3 -b 5 -p -5 out.gif 

Select a window or area with slop. The selection rectangle is highlighted in a transparent blue color abd has a 5px border on the inside. After stopping the recording with either ctrl+c, by running giph --stop or by sending a SIGINT to the processgroup, the resulting gif is written to out.gif.

$ giph -g 100x200+0+0 -d 5 -t 10

Records a 100x200 pixel rectangle in the top left corner of the screen. The recording starts after a 5 seconds countdown and will record for exactly 10 seconds. The resulting gif will be printed to standard output, which makes this able to be piped into other scripts like a file-upload to an image hosting service.

$ giph -f 30 -t 5 -s -a -m out.webm

Records a 5 second video of the users selection at 30 fps. The recording also contains the users desktop audio and microphone. If the recording fails because the default audio source 0 is not the correct one, run pacmd list-sources to get the correct source index or name and pass it to the -as parameter instead of using -a. Example: giph -f 30 -t 5 -s -as 1 -m out.webm (using id) or giph -f 30 -t 5 -s -as alsa_output.pci-0000_04_00.1.hdmi-stereo.monitor -m out.webm (using name)

$ giph -s -t 10 --format webm | curl -F "file=@-" 0x0.st | xclip -selection clipboard

Records a 10 second webm of the users selection, uploads the video to 0x0.st using curl and copies the returned url to the clipboard.

Installation

Arch

$ yay -S giph

Or install giph-git to get the latest development version.

From source

Make sure to install the following dependencies:

  • ffmpeg
  • xdotool

Optionally, install the following dependencies:

  • slop (--select)
  • libnotify (--notify)
  • pgrep (--stop)

Clone the giph repository:

$ git clone https://github.com/phisch/giph.git

And finally install giph:

$ cd giph
$ sudo make install

Desktop Makers

type=discord

I am actively working on giph and other cool projects on the Desktop Makers Discord. It aims to be a community for communities of Linux desktop related projects. If you are looking to collaborate with or want to contribute to great projects, this might be the right place for you.

giph's People

Contributors

barbuk avatar elkowar avatar exorcist365 avatar lonkaars avatar mlvzk avatar phisch avatar tch69 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

giph's Issues

find zenity alternative

Need to evaluate zenity alternatives for a gui.
Zenity windows pop up in the middle of the screen, which makes recording in the middle of the screen annoying.

Some window-managers can spawn zenity windows at specific parts of the screen (like bottom left), but this is a hassle for the user to figure out.

Maybe the recording can be stopped with notifications, and this can be implemented with #4.
Also i'd probably rather remove zenity until someone actually requests a feature like this, instead of keeping a bad feature just in case.

Selection color always white

First of all, this program is awesome and I already have a few nifty scripts built around it.

I am trying to replicate the gif on the example using the -c flag, but every color I enter makes the slop selection window entirely white.

I am using Arch + i3. Is this something I have to set up within slop, like the shaders?

Edit: Hmm, it seems to work if I do -c 0.0,0.0,0.0, which gives black. I somehow need to get all the colors in my scheme into a FLOAT FLOAT FLOAT format...

implement --notify flag (desktop notifications)

When using giph with system keybinds, it is unclear when the recording is completed, and when the encoding process has finished and the final gif is saved.

A flag --notify should enable desktop notifications, which will be displayed by whatever notification server the user has running.

Countdown via notification or otherwise

Hi,
Thanks for the great work. I was wondering if would be possible to emulate a countdown (either via libnotify or otherwise), that lets the user know the recording is about to start (in case of non-interactive launching - so no terminal output and with a delay). I think it would be a worthwhile feature to add. I realize I could hack around this with notifications but it would be great if it was built-in and calling the -y / --notify flag automatically takes care of it.
Best,
Amanjit

giph --stop doesn't seem to work

Hello

I'm currently doing recordings using the command giph -s -y ~/Pictures/Gifs/Recordings/$(date +%s).gif. It starts fine, but when I try to use giph --stop in another terminal to terminate the recording, nothing happens. Looking at the source code, it looks like you use pgrep giph to determine if the process is running. When I run that directly in the terminal, nothing comes up. It looks like the actual process name is bash when I look in htop. So when I use pgrep -f giph, I get a process id. Adding that flag in the source code (the stop_all_recordings function) seems to work. My shell is zsh, which is what I suspect is the reason why this happens.

Slop command not found

/usr/bin/giph: line 272: slop: command not found
2021-03-15 17:04:15: ERROR: could not parse geometry string ''

I know I should install slop in order to fix this, but slop should be added as a dependence.

[Request] Option to choose audio backend

I was wondering if it would be possible to add an option to choose the audio backend? Currently it seems pulseaudio is hardcoded. It would be nice to choose between pulse or alsa.

remove gifski

Remove gifski support, since its gif encoding takes a considerable amount longer than using ffmpeg with pre-generated color palette, and it's quality and file-size is basically the same.

Black screen on Hyprland

Someone recommended this tool to me but I could not get it to work properly on my setup, there is no error but I only get a black rectangle when I view the gif in firefox.

I am using Hyprland (version 0.34.0-1) on Arch, and giph version 1.1.1.

Has this been tested on Wayland?

I'd be happy to help debug this, so if you need me to try out some stuff don't hesitate!

doesn't work on Debian based system(Pop OS)

So I tried to build the program from source
that part worked. However what doesn't work is actually using it

I use Gnome so it might be an issue related to that DE
it would be awesome if I'd be able to use said program on my system

Recording doesn't work

Not sure if #6 is related, but I get an error saying ffmpeg can't record. After some investigation, I fixed it by changing

ffmpeg=(ffmpeg -f x11grab -s "$width"x"$height" -i "$DISPLAY.0+$x,$y")

to

ffmpeg=(ffmpeg -f x11grab -s "$width"x"$height" -i "$DISPLAY+$x,$y")

in function record() on line 347

On my system, $DISPLAY is set to :0.0 which is set on startup in my ~/.xprofile by running systemctl --user import-environment DISPLAY. I'm not sure if this is standard, or if something like :0 is standard, so I'm not sure if I should fork and send a PR to fix this.

handle windows that are partially off-screen

Currently, when a window or geometry is partially outside the root-window, the recording fails without and useful information.

If the area to record is completely outside the root-window, giph should log_error with a proper error message.
Otherwise, it should record the intersecting rectangle between the rectangle to record and the root-window.

Sending SIGINT to giph doesn't do anything

If I call giph from a script, then giph --stop doesn't work, so I tried sending it the SIGINT signal but that doesn't do anything.

pgrep -f giph | xargs kill -SIGINT

Error when trying to record

This is what happened:

$ bash giph -s hello
2019-06-06 08:24:20: INFO: stop recording with ctrl+c or send INT SIGNAL to this process killall -int -g giph
Invalid MIT-MAGIC-COOKIE-1 key2019-06-06 08:24:20: ERROR: recording video with ffmpeg failed

By the way, this project is awesome, I really like it! ๐Ÿ˜„

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.