Coder Social home page Coder Social logo

moebiussurfing / ofxsurfingcapturer_deprecated Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 0.0 33.47 MB

openFrameworks addon workflow helper for window capture using fast and threaded saving per-frame-stills (.tif), and FFmpeg GPU encoding (.mp4) after using command script.

License: Other

Makefile 2.93% PowerShell 0.07% C++ 97.00%
openframeworks-addon

ofxsurfingcapturer_deprecated's Introduction

ofxSurfingCapturer

Overview

ofxSurfingCapturer is an openFrameworks addon to do fast video capturing but storing still frames to join to video with FFmpeg after capture finished. It helps on all the capture workflow.

Includes the main class:

ofxSurfing_CaptureWindowStills.h
It's much faster (in some machines) because captures and compress still frames (.tif) using threading, and it makes the FFmpeg video (.mp4) encoding using system command-line after all: inisde the OF App or using your favourite external video encoder.
Based on: ofxTextureRecorder.

Screenshots

example-BasicStills:

Uses ofxSurfing_CaptureWindowStills.h

HOW TO / WORKFLOW

  1. F8 : Mounts/prepare the capturer...

  2. F9 : START Recording!

image

  1. F9 : STOP Recording.

  2. F11 : RUN the FFmpeg script to join all the still frames (xxxxx.tif -> output.mp4).

  3. Your videoplayer will auto-start opening the new created video!

image

  1. Ctrl+Alt+BackSpace: Remove all still files.

Data path structure and "ffmpeg.exe" location:

image image

Features

  • Faster than other live-capture-to-video alternatives (bc "raw" still frames + post-encode after).
  • GPU Hardware accelerated (or CPU) video encoding. (Nvidia only yet)
  • Selectable image format: png, jpg, ...etc. tif by default.
  • Key commands to handle all the workflow:
  1. Mount (F8)
  2. Record (F9)
  3. Take PNG Snapshot (F10)
  4. Clear all stills (Ctrl+Alt+BackSpace)
  5. Auto-call batch FFmpeg stills_to_video compression after capture finished (F11),
    auto-opens video with your videoplayer.

Usage

ofApp.h

#include "ofxSurfing_CaptureWindowStills.h"
CaptureWindow capturer;

ofApp.cpp

ofApp::setup(){
	// disable depth to avoid some fbo problems/bugs when using 2D scenes.
	//capturer.setDephEnabled(false);

	// to capture a section only. call before setup
	//capturer.setCustomizeSection(ofRectangle{ 0, 0, canvasSize.get().x, canvasSize.get().y });
	
	//capturer.setup("Captures\\Captures_Projector_1\\", OF_IMAGE_FORMAT_TIFF);
	capturer.setup();

	// add enabler into your gui
	//gui.add(capturer.params);
}

ofApp::draw(){
	capturer.begin();

	///----- draw your scene here -----///

	capturer.end();
	capturer.draw();

	capturer.drawInfo();
	//gui.draw();
}

Dependencies

Notes

  • Includes some FFmpeg scripts, links and a Windows ffmpeg.exe and macOS ffmpeg binary.
  • Video encoding, batch-join stills (xxxxx.tif) to video (output.mp4) requires ffmpeg binary.
  • ofxSurfing_CaptureWindowStills.h could work on macOS and Linux too, bc only relays into ofxTextureRecorder.
  • TODO: Check if window resize don't breaks Fbo capturer size...
  • FFmpeg encode using AMD GPU could work because now you can customize the script on setup.

Tested systems

  • Windows10 / VS2017 / OF +0.11
  • macOS High Sierra / Xcode 10 / OF +0.11

Author

Addon by @moebiusSurfing
(ManuMolina). 2020.

Thanks to the coders of the above original addons:
arturoc.

License

MIT License.

ofxsurfingcapturer_deprecated's People

Contributors

moebiussurfing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.