Giter Site home page Giter Site logo

bashcaster's Introduction

Bashcaster

Bashcaster is a simple script that uses ffmpeg to record screencasts to videos or GIFs. It can record the whole screen or a window. It can optionally optimize GIFs with gifsicle.

Installation

Put bashcaster.sh wherever you want.

Requirements

Bashcaster only works on X-based GUIs. It should work on any Linux distro, and all common ones should have these tools available for installation:

  • ffmpeg does all the work behind the scenes.
  • xprop and xwininfo are used to retrieve screen and window dimensions.
  • yad shows the stop-icon tray notification and confirmation dialogs.
  • slop is used when available to select rectangles, otherwise a fallback method is used.
  • gifsicle optionally optimizes GIFs.

Examples

Record a window to a GIF:

bashcaster --window output.gif

Record a window to a GIF at 15 frames per second, with the mouse cursor, optimize it, and don’t show confirmation prompts:

bashcaster -coy --window -f 15 output.gif

Record the whole screen to an MKV at 60 fps immediately, without confirmation:

bashcaster -f 60 -y output.mkv

Usage

bashcaster.sh [OPTIONS] OUTPUT-FILE

Bashcaster is a simple script that uses ffmpeg to record screencasts
to videos or GIFs.  It can record the whole screen or a window.  It
can optionally optimize GIFs with gifsicle.

OUTPUT-FILE should end with the desired video type's extension,
e.g. ".mp4" or ".gif".

Click the stop-icon tray notification to stop recording.

Options
  --debug  Print debug info
  --help   I need somebody!

  --force           Overwrite output file if it exists
  -y, --no-confirm  Don't ask for confirmation before recording

  -c, --cursor      Record mouse cursor
  -F, --fullscreen  Record the whole screen (the default)
  -R, --rectangle   Select and record a rectangle
  -W, --window      Select and record a window

  -f, --framerate NUMBER  Video framerate (default: 30)

  -l, --left   NUMBER  Video left edge position (default: 0)
  -t, --top    NUMBER  Video top edge position (default: 0)
  -h, --height NUMBER  Video height
  -w, --width  NUMBER  Video width

  --max-colors NUMBER  Limit colors in palette
  -d, --dither         Enable dithering to reduce filesize
  -o, --optimize       Optimize GIF with gifsicle

Credits

  • Inspired by Silentcast.
  • FFmpeg does all the work.
  • YAD shows dialogs and the stop button.
  • Giphy posted a helpful guide (GitHub repo) showing how to record optimized GIFs with FFmpeg.

Development

Bug reports, feature requests, suggestions β€” oh my!

License

GPLv3

bashcaster's People

Contributors

alphapapa 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

Watchers

 avatar  avatar  avatar  avatar

bashcaster's Issues

Stable release?

Thanks for such a useful tool!
It hasn't been updated in two years (this isn't to point out that it hasn't been maintained) and I think the software is stable enough.
Please consider tagging any commit to indicate stable release?

Guix Package

Hi I'm looking to package this either for Guix upstream inclusion or a custom guix channel.

Are you still using this script?

It seems very useful :)

Running in an environment without system tray

Hi,

I want to try out this program, but it assumes system tray support for operation. I am primarily using Chrome OS at home, and it currently doesn't support system tray for Linux apps, so I can't use this program now.

I am thinking of adding an option to finish recording on a UNIX signal (SIGUSR1 for example). Can you think of a better way that doesn't depending on the tray (and preferably controllable from console)?

Further ffmpeg optimizations

From https://www.reddit.com/r/linux/comments/aa1jzm/bashcaster_an_actually_simple_screen_recorder_for/ecozlfj/

Suggestions for gif recording:

use the mpdecimate filter to remove duplicate frames. In a screen recording there can be huge number of duplicate frames, especially if it's mostly showing a still image of a desktop. Video games can have frame drops, which manifest as duplicate frames in recodings. This should reduce the file size of the resulting gif significantly.

use bayer dithering, which will yield another signficant size reduction.

In a 10 second desktop test recording that I converted to a gif, these two methods lead to a file size reduction of 89% (!) when compared to a gif that just used a plain pallettegen and palletteuse filter complex with no other additions.

I usually use something like this to create gifs:

ffmpeg -i input.mp4 -vsync 0 -filter_complex "[0:v] scale=-1:360,mpdecimate,fps=15,split [a][b];[a] palettegen=max_colors=64 [p];[b][p] paletteuse=dither=bayer:bayer_scale=5" output.gif

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.