How to change the default file type from webm to gif for 30s ubuntu screencasts?

1.3k views Asked by At

Ubuntu provides an option to record a screencast of 30s by Ctrl + Shift + Alt + R.

The default file type is webm. How do I set the default to gif?

It is wastage to time to convert these files to gif using an online converter.

Instead, I would like them to be saved in gif format by default.

2

There are 2 answers

0
aahnik On BEST ANSWER

I found a great tool to record gifs https://github.com/phw/peek

Peek recording itself

0
aahnik On

Ubuntu records 30s .webm screencasts in Videos Folder via Ctrl+Shift+Alt+R, automatically convert them to GIF in Pictures Folder, and delete video file



#!/bin/bash
cd /home/aahnik/Videos
for f in *.webm;
do 
ffmpeg -i "$f" ../Pictures/"$f"_gif.gif;
rm "$f";
done

Make sure to have ffmpeg installed

  • Save the toGIF.sh in your Videos folder, link
  • make it executable chmod +x /home/Videos/toGIF.sh
  • Go to Settings ---> Keyboard Shortcuts ---> New ShortCut
  • Set a new shortcut like this

Screenshot from 2020-09-10 22-22-16

note: the command should be the path to shell script

  • now whenever you take short screencasts, via default Ctrl+Shift+Alt+R, execute the Shift+Ctrl+ALt+G
  • the script will run in background and convert all .webm in Videos folder to .gif in Pictures Folder, and delete video file.
  • Please let the screencast finish, and then initiate the conversion to GIF, otherwise, the GIF will be incomplete and the video will get deleted before its 30s duration.

Please take a look below for better understanding.

Step 1

Screencast from 10-09-20 10:41:39 PM IST webm_gif

Step 2

Screencast from 10-09-20 10:42:49 PM IST webm_gif