GithubHelp home page GithubHelp logo

ropery / ffcast Goto Github PK

View Code? Open in Web Editor NEW
539.0 14.0 17.0 197 KB

Run command on rectangular screen regions

License: GNU General Public License v3.0

Shell 91.13% Makefile 4.04% M4 4.83%
screenshot screencast ffmpeg x11 cli bash

ffcast's Introduction

FFcast

FFcast deals with rectangles on screens. Mostly, it selects rectangles. Like most boring jobs, there are many ways to do it: free selection, selection by window, screen number, numeric geometry, or by edge detection. Simple arithmetic operations allow simple combinations and adjustments.

Now FFcast knows all about these rectangles, but what to do with them? Well, like most useless things, there are many ways to use them: in practice, screenshots and screencasts are obviously popular options; in general, the geometry can be utilized by any application that understands X geometry, including window managers, xorg-apps (xclock, xev), byzanz-record, dunst, dzen2, FFmpeg, gifview, ImageMagick, maim, mousetweaks, mpv, Nautilus, screenkey, sxiv, xdotool, xscast, xsnap, zenity, to randomly name a few.

FFcast provides several short commands for common tasks, just to please its users, but hardly ever satisfies anyone. Like most unhelpful tools, it encourages its users to roll their own cigarettes.

Anyway, here’s wonder…​ful demos.

Requirements

Bash 4.3+, FFmpeg (png rec), ImageMagick or GraphicsMagick (trim), xdpyinfo (-x), xprop (-f), xrectsel (-s), xwininfo (-w).

Installation

To build and install from source,

./bootstrap  # generates ./configure
./configure --prefix /usr --libexecdir /usr/lib --sysconfdir /etc
make
make DESTDIR="$dir" install  # $dir must be an absolute path

To get xrectsel along with FFcast, pull in the submodule,

git clone --recursive https://github.com/lolilolicon/FFcast.git

Then build and install as described above, but passing an additional --enable-xrectsel to ./configure.

Usage

See ffcast(1). Perhaps start with EXAMPLES.

ffcast's People

Contributors

rck avatar ropery 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ffcast's Issues

How do I stop the screencasting?

It may be a dumb question but... If i'm running a castig with the rec command from a dmenu script for example, how can I stop the recording?

I tryed killall ffcast already and it didn't work at all and I couldn't find out how to do It.
I do know that I can press q in the terminal that is running ffcast but I can't do that if I'm running it with the dmenu script.

Does not offset?

Hello,

Thank you so much for the nice tool. However, I'm having a problem. When a select an area through my mouse, the recorded part is from the upperleft-corner of my screen ( instead of upper-left corner of my selection) to the lower-right corner of the selection.

My distro is ArchLinux.
My WM is xmonad.

sleep 2 && \
notify-send start && \
ffcast -g 774x533+500+113 -vvv ffmpeg -f x11grab -i $DISPLAY -y -t 8 test.mp4 && \
notify-send end

No audio

There doesn't seem to be any audio/sound recording and the README does mention it but not clearly that it doesn't support it.

Nice to have: option to add small delay before recording

Sometimes after selecting the area on the screen there are some glitches (see below)

It would be nice to be able to start recording after a certain delay (via option)

I am avoiding this by trimming the beginning of the video afterwards via a script, but I never get to know when these 3 seconds end :)

Having a visual indication by seeing the output of recording after the delay would be a fantastic indicator

out2xxike6cis

Unable to select full Output with xrectsel

As I'm lazy, I have ffcast ... bound to a key-binding in order to quickly take arbitrary-sized/positioned video recordings. But, with xrectsel, it seems, selecting what I expected to be the entire region of the X11 Output, selects everything but one full row and one full column of pixels. I assume this is the right most and bottom most row, but am not sure.

Is it possible to enable this functionality? I feel this is a limitation of xrectsel, given your (@lolilolicon) response here: ropery/xrectsel#2 (comment), but having to remember e.g. the number of windows I want to capture is incompatible with my lazy key-binding solution.

It would be neat if I could use ffcast to select an unbounded number of windows (and/or regions / X11 (Xinerama/Xrandr) Outputs / ffcast-allowed selections) and somehow signal that I'm finished. Perhaps e.g. a right-click or key-stroke (as a signal itself or as a modifier for a selection to indicate that it's the "last" selection).

Any ideas how I may achieve this without modification to ffcast and complex logic/script?

Support selecting specific physical displays via XINERAMA

In multi-head setups that use a single large virtual display, fullscreen would be the whole virtual display, including dead space. It would be convenient if we could select only one physical display. The geometry of each physical display should be available via the X server's XINERAMA information, such as:

xdpyinfo -ext XINERAMA | grep -w '^ *head'

The thing we should discuss here, is that whether this information is reasonably universally available and reliable.

So, if you use multi-head, please reply the output of the the command line above, along with your video card/driver.

If this is indeed a reliable way to get the geometry of the pysical displays, we've got a deal :) The hypothetical syntax would be:

ffcast -x 1    # select head #1
ffcast -x 0,2  # select head #0 and #2; they will be union'd as usual...

record a gif screencast

Readers: read the fine wiki: GIF Howto (edit by @lolilolicon).

Hello @lolilolicon I discovered this great project and did:

ffcast rec hello.gif

Now this consumes a lot of space. How can I record an optimized gif screencast, dropping the framerate and optimizing the resulting gif?

Thanks

@vvo never mentioned he wrote gifify (seen on GitLab Handbook) (edit by @lolilolicon).

/usr/local/bin/ffcast: line 110: fg: no job control

i saw issue 8 and know i need to add % after -s, but i have a new error.

[oglop@localhost ffcast]$ ffcast -s % ffmpeg -y -r 15 x.avi
:: please select a region using mouse
/usr/local/bin/ffcast: line 110: fg: no job control

centos 7

[oglop@localhost ffcast]$ ffmpeg
ffmpeg version 2.3.3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Aug 23 2014 01:41:05 with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
  configuration: --prefix=/home/oglop/Downloads/ffmpeg-static/target --extra-cflags=-I/home/oglop/Downloads/ffmpeg-static/target/include --extra-ldflags='-L/home/oglop/Downloads/ffmpeg-static/target/lib -lm' --disable-debug --disable-ffplay --disable-ffserver --disable-doc --enable-gpl --enable-pthreads --enable-postproc --enable-gray --enable-runtime-cpudetect --enable-libfaac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-bzlib --enable-zlib --enable-nonfree --enable-version3 --enable-libvpx --enable-librtmp --extra-libs=-ldl --enable-x11grab

licence

I've love to include this in debian but it needs some form of licence

Unrecognized option 'show_region'

I'm getting the following error when trying to record a gif:

$ ffcast rec hello.gif
:: saving to file: hello.gif
ffmpeg version 2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
  built on Oct  7 2014 16:49:49 with gcc 4.7 (Debian 4.7.2-5)
  configuration: 
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
Unrecognized option 'show_region'.
Error splitting the argument list: Option not found

Presets

Not sure if this is a bug or not. Just what are the presets, where can I find them, can I make my own, can I modify what's there?
The current is 'lossless_slow', but the other options are not readily apparent or documented.
Typical nub questions, but it's not pointed out in the docs.

no browser interaction possible in recorded rectangle

This is the command I'm using:

ffcast -s % ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size %s -i %D+%c -codec:v libx264 -b:v 20000k -vf crop="iw-mod(iw\\,2):ih-mod(ih\\,2)"

After selecting the rectangle I want to record, the selected part just freezes and no more animations or interaction is possible.

Is there anything I'm doing wrong? It's already quite some time when I used ffcast last, but I think I was able to interact with the browser below the recorded rectangle, right?

invalid shell option name

I am trying ffcast with zsh shell and returns:
"/usr/bin/ffcast: line 20: shopt: lastpipe: invalid shell option name"

My system is Debian Squeeze amd64.

What's wrong?

Running ffcast without interactive shell.

Thanks for this cute tool. I'd like to bind a combo key to this command:

    TMP_AVI=$(mktemp /tmp/outXXXXXXXXXX.avi)
    ffcast -s % ffmpeg -y -f x11grab -show_region 1 -framerate 15 \
        -video_size %s -i %D+%c -codec:v huffyuv                  \
        -vf crop="iw-mod(iw\\,2):ih-mod(ih\\,2)" $TMP_AVI        \
    && convert -set delay 10 -layers Optimize $TMP_AVI gif:- | copyq write image/gif - && rm -rf $TMP_AVI

And another key to stop recording.
How can I make it work?

Recommended tool for starting/running w/o terminal?

I'm invoking ffcast via keybinding from my window manager. I'm wondering what you might recommend as a solution to e.g. telling ffmpeg I want it to end the recording. When I run via terminal, I just send ffmpeg SIGINT (CTRL+C) and it seems to work. When I invoke via bindsym ... exec ... w/ i3wm, nada. Even placing the cursor over the capture window hint/border and sending my WM's keybind ... kill, nada.

Thanks, ffcast/xrectsel is great, I just wish it was packaged for Debian too.

please add wayland support

~$ echo $XDG_SESSION_TYPE 
wayland
~$ ffcast -w pad '20 2 2' png screenshot-%s.png
:: please click once in target window

nothing happens when I click on a window.

Output file #0 does not contain any stream

Hi, love the app, use it all the time (http://code.krister.ee/mailgun-digitalocean/)

Just updated my Manjaro and ffcast is broken. The command ffcast -s ffmpeg -vcodec libx264 -b:v 20000k -r 25 recgif_temp.mp4 just produces an error

:: please select a region using mouse
ffmpeg version 2.3.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Jul 31 2014 14:51:38 with gcc 4.9.1 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --enable-avisynth --enable-avresample --enable-decoder=atrac3 --enable-decoder=atrac3p --enable-dxva2 --enable-fontconfig --enable-gnutls --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-pic --enable-postproc --enable-runtime-cpudetect --enable-shared --enable-swresample --enable-vdpau --enable-version3 --enable-x11grab
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 48.100 / 55. 48.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 11.100 /  4. 11.100
  libavresample   1.  3.  0 /  1.  3.  0
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Codec AVOption b (set bitrate (in bits/s)) specified for output file #0 (recgif_what.mp4) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.
Output #0, mp4, to 'recgif_what.mp4':
Output file #0 does not contain any stream

The same error with just ffcast -s ffmpeg recgifat.mp4

If I add -map 0 to it I get a new error: Invalid input file index: 0.
Really useful tool, how do I fix 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.