GithubHelp home page GithubHelp logo

avatarworld / ffmpegout Goto Github PK

View Code? Open in Web Editor NEW

This project forked from keijiro/ffmpegout

0.0 2.0 0.0 200 KB

Video capture plugin for Unity with FFmpeg.

License: MIT License

C# 91.40% ShaderLab 8.60%

ffmpegout's Introduction

FFmpegOut

gif

FFmpegOut is a Unity plugin that allows the Unity editor and applications to record video using FFmpeg as a video encoder.

Differences between Unity Recorder

First of all, note that Unity Recorder would be a better choice in most cases for the same purpose. It's strongly recommended to check and try it out before installing FFmpegOut.

Unity Recorder

  • Pros: Easy to use. Better UI/UX.
  • Pros: Stable and robust. Officially supported by Unity.

FFmpegOut

  • Pros: Supports a wide variety of codecs.
  • Cons: Non user friendly UI/UX.
  • Cons: Complex legal factors (GPL/LGPL, patent risk)

In short, you should use Unity Recorder unless you need a special codec like ProRes or lossless H.264.

System Requirements

  • Unity 2018.3 or later
  • Windows: Direct3D 11
  • macOS: Metal
  • Linux: Vulkan

FFmpegOut only supports desktop platforms.

FFmpegOut works not only on the legacy rendering paths (forward/deferred) but also on the standard scriptable render pipelines (LWRP/HDRP).

Installation

Download and import the following packages into your project.

Camera Capture component

The Camera Capture component (CameraCapture) is used to capture frames rendered by an attached camera.

inspector

It has a few properties for recording video: frame dimensions, preset and frame rate.

Frame Dimensions (width and height)

The dimensions of recorded video are specified with the Width and Height properties. The size of the screen or the game view will be overridden by these values.

Presets

At the moment the following presets are available for use.

Name Container Description
H.264 Default MP4 Recommended for general use.
H.264 NVIDIA MP4 Highly optimized. Requires a NVIDIA GPU
H.264 Lossless 420 MP4 Recommended for pre-render use.
H.264 Lossless 444 MP4 High quality but not widely supported.
HEVC Default MP4 High quality but slow.
HEVC NVIDIA MP4 Highly optimized. Requires a NVIDIA GPU
ProRes 422 QuickTime
ProRes 4444 QuickTime Supports alpha channel.
VP8 WebM
VP9 WebM High quality but slow.
HAP QuickTime
HAP Alpha QuickTime Supports alpha channel
HAP Q QuickTime

Frame Rate

The Frame Rate property controls the sampling frequency of the capture component. Note that it's independent from the application frame rate. It drops/duplicates frames to fill gaps between the recording frame rate and the application frame rate. To avoid frame dropping, consider using the frame rate controller component (see below).

Frame Rate Controller component

The Frame Rate Controller component is a small utility to control the application frame rate.

inspector

It tries controlling frame rate via Application.targetFrameRate and QualitySettings.vSyncCount. Note that it only works in a best-effort fashion. Although it's expected to provide a better result, it's not guaranteed to work exactly as specified.

When the Offline Mode property is enabled, it explicitly controls the application frame rate via Time.captureFramerate. In this mode, application time is decoupled from wall-clock time so it's guaranteed that no frame dropping happens. This is useful when using the capture component to output pre-render footage.

License

MIT

Note that the FFmpegOutBinaries package is not placed under this license. When distributing an application with the package, it must be taken into account that multiple licenses are involved. See the FFmpeg License page for further details.

ffmpegout's People

Contributors

keijiro avatar thriftysnail avatar

Watchers

James Cloos avatar Vatary 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.