Code Monkey home page Code Monkey logo

ue4capture's Introduction

In-Engine Audio and Video Capture Plugin for Unreal Engine 4

This plugin utilises the MovieSceneCapture and AudioMixer modules to capture both audio and video from Unreal Engine 4 projects, without the need for external screen capture tools. This overcomes the lack of audio support when exporting movies using Sequencer, and also facilitates capturing audio and video when performing offscreen rendering on a headless device or inside an NVIDIA Docker container under Linux.

The plugin acts as a MediaIPC producer process, transmitting data to any running MediaIPC consumer process that has been initialised with the prefix "UE4Capture". For details on creating and using MediaIPC consumers, see the documentation from the MediaIPC GitHub repository.

Contents

Requirements

  • Unreal Engine 4.19.0 or newer
  • CMake 3.8 or newer
  • ue4cli
  • conan-ue4cli
  • Under Unreal Engine 4.19, one of the public header files for the UE4 AudioMixer module includes a private header file, causing compilation errors when included by non-Engine modules. To fix this, run the script patch-headers.py in the scripts directory. This issue is fixed in Unreal Engine 4.20.
  • The Conan package for libMediaIPC needs to be compiled by running the command build.py MediaIPC-ue4 from the ue4-conan-recipes repository.
  • Audio capture only works when using an output device based on the AudioMixer module, which requires running the game with the -AudioMixer command-line argument.

Usage

Getting started with UE4Capture plugin is extremely simple. First, create a MediaIPC consumer to receive the capture output:

  • Grab the MediaIPC source code and build the CMake project, including the example producers and consumers.
  • Run the executable for an example consumer (e.g rawdump_consumer.cpp) with the command-line argument "UE4Capture", which will set the correct prefix value.
  • The consumer should display the text "Awaiting control block from producer process...".

Then, setup your UE4 project to act as the MediaIPC producer process:

  • Create a new C++ UE4 project and copy the UE4Capture directory from the appropriate plugin subdirectory for your Engine version to your project's Plugins directory.
  • Modify your default game mode to inherit from the ACaptureGameMode base class (may not work under Windows), or copy the code into your own game mode (works under all platforms.)
  • Build the project by running the command ue4 build from the directory containing the project's .uproject file.
  • Run the project by running the command ue4 run -game -AudioMixer from the directory containing the project's .uproject file.

The capture will now begin automatically:

  • Once the game is running and the default level has loaded, switch back to the window for the consumer process. It should now display the text "Receiving stream data from producer process...". This indicates that the capture has been initiated successfully.
  • Once you close the window for the game, the consumer process will detect that the capture has ended and finalise its output, displaying the text "Stream complete.".
  • In the case of the rawdump_consumer example, the output will be a pair of files (audio.raw and video.raw) containing the raw, uncompressed capture data. You will need to post-process these files using a tool such as FFmpeg or GStreamer to encode the raw bitstreams into a usable video file.

License

Copyright © 2018, Adam Rehn and Aidan Possemiers. Licensed under the MIT License, see the file LICENSE for details.

ue4capture's People

Contributors

adamrehn avatar

Watchers

 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.