Code Monkey home page Code Monkey logo

vgc's Introduction

Video GIF Capture

An easy to use tool for screen capture and export into GIF and MP4 formats.

Solution architecture

The solution was developed and should be compiled using Microsoft Visual Studio 2019. The target operating system is Windows 10. The compiled output should be used as a PowerToys module, or a standalone executable. The solution consists of five projects, described herein. All projects which use C++ use the latest C++ standard, C++20, to the degree supported by the IDE and compiler.

VGC Core library

This is a C++ project and it compiles into a static library to be used in the main application. It contains functions and classes which wrap existing relevant Windows APIs where they exist, and implement various low level processing algorithms where they don't, or the APIs are undesirable. To ensure the best performance on modern hardware, all operations which could benefit from many CPU cores should be implemented using multithreading.

For screen capture and low-level graphics processing, Direct3D 11 is used. For exporting files using the GIF format, a custom, extensible library is used and its source code is available as part of the project. WASAPI is used for audio capture. Loopback capture is supported.

These OS interop functions are a big potential source of bugs. Bugs are most likely to occur when available system memory is low, the primary storage device is slow, or when captured devices' settings are changed on-the-fly, for example, when changing the screen resolution or when unplugging an audio device. Great attention should be paid to these scenarios. Ideally, the recording, up to the point of failure, should be recoverable, but hard crashes should be absolutely avoided.

Due to large memory requirements of video capture, captured frames are written to the disk as lossless PNG images. The frames may optionally be compressed further using an image difference algorithm. In case RAM is filling up and disk writing speed is limited, the rate of capture (FPS) is automatically reduced. For shorter snippets, users shouldn't have any problems even when running on older hardware.

For MP4 export, ffmpeg should be present on the machine. You can use an existing installation or choose to download it from the internet. It's not required for other features to work.

VGC Main executable

This is also a C++ project and it contains mostly UI code. The UI shall have a native Windows 10 look and feel. There shall be two views.

  1. Recording panel view, which contains controls to start/stop recording and for setting up the recording.
  2. Editor view, which displays the captured output and allows the user to edit, export or discard it.

Only simple editing operations are supported.

MSVC Unit test project

This project shall contain unit tests, mostly for the VGC Core library.

PowerToys DLL project

This project compiles to a dynamically linked library and it implements the PowerToys module interface. The DLL is responsible for running and managing the main executable.

PowerToys settings page

The settings page should contain global user preferences, for example, keyboard shortcuts, options for visual appearance, location of ffmpeg, a button to set it up automatically, additional options for ffmpeg, default recording options, et cetera.

vgc's People

Contributors

ivan100sic avatar

Watchers

 avatar  avatar

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.