UEVideoRecorder icon indicating copy to clipboard operation
UEVideoRecorder copied to clipboard

Issue in Plugin Installation

Open pranav2w opened this issue 9 years ago • 46 comments

I am facing problem on Plugin Installation.

First of all I had create a C++ project and create new folder named 'Plugins' in Content folder . Then I had extract 'UEVideoRecorder-master.zip' in 'Plugin' folder.

Then I had open C++ project in VC2015 (Run as Admin) and build the project,

Now I am getting below errors:

Error 1 :
Error : Couldn't find module rules file for module 'VideoRecorder'. (Line 1)

Error 2 : Error MSB3075 The command ""D:\Shared Pranav\UnrealEngine-4.14\Engine\Build\BatchFiles\Build.bat" Video14Editor Win64 Development "C:\Users\Pranav\Documents\Unreal Projects\Video14\Video14.uproject" -waitmutex" exited with code 5. Please verify that you have sufficient rights to run this command. Video14 C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets (Line 37)

pranav2w avatar Dec 23 '16 08:12 pranav2w

According to UE4 documentation Plugins directory should be located at project root directory, not in Content folder.

This plugin requires additional libraries to be installed:

  1. Boost. Download the latest version and extract archive. Then create directory named boost at /UE4 root/Engine/Source/ThirdParty and create there file boost.Build.cs with the following content:
using UnrealBuildTool;

public class boost : ModuleRules
{
    public boost(TargetInfo Target)
    {
        Type = ModuleType.External;

        const string LibraryPath = "BOOST_ROOT";

        PublicIncludePaths.Add(LibraryPath);
    }
}

where BOOST_ROOT is path to boost (it should have the form of .../boost_1_xx_x).

  1. VideoRecorder.
  • Clone repository (including submodule), open solution in Visual Studio 2015, select Release configuration and target platform (for example x64). Platform must match the platform of application being developed in UE4.

  • ~~Add BOOST_ROOT to VC++ Directories/IncludeDirectories in property manager to Microsoft.Cpp.PLATFORM.user propery.~~ Boost no longer required for VideoRecorder library. But it still used by plugin itself.

  • Download FFmpeg SDK, add paths to header and library files to corresponding VC++ Directories (IncludeDirectories and Library Directories) in property manager in Visual Studio to the same property as boost in previous step.

  • Build the solution.

  • Create directory with name VideoRecorder at /UE4 root/Engine/Source/ThirdParty, create there file VideoRecorder.Build.cs with the following content:

using UnrealBuildTool;
using System.IO;

public class VideoRecorder : ModuleRules
{
    public VideoRecorder(TargetInfo Target)
    {
        Type = ModuleType.External;

        const string LibraryPath = "PATH_TO_VIDEO_RECORDER_REPO/VideoRecorder";

        PublicIncludePaths.Add(Path.Combine(LibraryPath, "include"));

        if (Target.Platform == UnrealTargetPlatform.Win64)
        {
            PublicLibraryPaths.Add(Path.Combine(LibraryPath, "lib", "x64", "Release"));
            PublicAdditionalLibraries.Add("VideoRecorder.lib");
        }
    }
}

where PATH_TO_VIDEO_RECORDER_REPO is path to cloned repository.

Also do not forget to place FFmpeg dlls at appropriate location (for example along to application .exe this plugin is used with).

Note that this plugin has some DX11-specifiic performance optimizations so using it with other rendering APIs can result in poor performance.

ash3D avatar Dec 25 '16 19:12 ash3D

Unable to load module 'C:/Users/a/Documents/Unreal Projects_Use/recordetest/Plugins/UEVideoRecorder-master/Binaries/Win64/UE4Editor-UEVideoRecorder.dll' because the file couldn't be loaded by the OS.

rlfqudxo avatar Dec 26 '16 17:12 rlfqudxo

This is probably due to lack of access to FFmpeg dlls. It makes sense to put FFmpeg dlls at Windows/System32 directory on development machine in order it to be accessible to UE4 editor for all projects and distribute them with packaged application to end users.

ash3D avatar Jan 03 '17 08:01 ash3D

@ash3D I got problem follow the above method.

1>------ Rebuild All started: Project: UEVideo, Configuration: Development_Editor x64 ------ 1> Cleaning UEVideoEditor Binaries... 1> Creating makefile for UEVideoEditor (no existing makefile) 1> Performing full C++ include scan (no include cache file) 1> Parsing headers for UEVideoEditor 1> Running UnrealHeaderTool "C:\Users\Jason\Documents\Unreal Projects\UEVideo\UEVideo.uproject" "C:\Users\Jason\Documents\Unreal Projects\UEVideo\Intermediate\Build\Win64\UEVideoEditor\Development\UEVideoEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed 1> Reflection code generated for UEVideoEditor in 1.9439201 seconds 1> Performing 13 actions (4 in parallel) 1> [2/13] Resource ModuleVersionResource.rc.inl 1> UEVideoRecorder.generated.cpp 1> Module.UEVideoRecorder.cpp 1> PCH.UEVideo.cpp 1> [5/13] Resource PCLaunch.rc 1> [6/13] Resource PCLaunch.rc 1>C:\Program Files (x86)\Windows Kits\8.1\include\winrt\wrl\implements.h(2033): error C3861: 'InterlockedIncrement': identifier not found 1>C:\Program Files (x86)\Windows Kits\8.1\include\winrt\wrl\implements.h(2040): error C3861: 'InterlockedDecrement': identifier not found 1>D:\Program Files (x86)\UE_4.15\Engine\Source\ThirdParty\boost\boost/config/stdlib/dinkumware.hpp(99): warning C4668: '_HAS_NAMESPACE' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 1>C:\Program Files (x86)\Windows Kits\8.1\include\winrt\wrl\implements.h(2033): error C3861: 'InterlockedIncrement': identifier not found 1>C:\Program Files (x86)\Windows Kits\8.1\include\winrt\wrl\implements.h(2040): error C3861: 'InterlockedDecrement': identifier not found 1>D:\Program Files (x86)\UE_4.15\Engine\Source\ThirdParty\boost\boost/config/stdlib/dinkumware.hpp(99): warning C4668: '_HAS_NAMESPACE' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 1>D:\Program Files (x86)\UE_4.15\Engine\Source\ThirdParty\boost\boost/throw_exception.hpp(3): warning C4668: 'GNUC' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 1>D:\Program Files (x86)\UE_4.15\Engine\Source\ThirdParty\boost\boost/throw_exception.hpp(3): warning C4668: 'GNUC_MINOR' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 1>D:\Program Files (x86)\UE_4.15\Engine\Source\ThirdParty\boost\boost/iostreams/detail/resolve.hpp(68): warning C4668: 'BOOST_IOSTREAMS_GCC' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 1>D:\Program Files (x86)\UE_4.15\Engine\Source\ThirdParty\boost\boost/throw_exception.hpp(3): warning C4668: 'GNUC' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 1>D:\Program Files (x86)\UE_4.15\Engine\Source\ThirdParty\boost\boost/throw_exception.hpp(3): warning C4668: 'GNUC_MINOR' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 1>C:\Users\Jason\Documents\Unreal Projects\UEVideo\Plugins\UEVideoRecorder\Source\UEVideoRecorder\Private\VideoRecordGameViewportClient.cpp(26): warning C4003: not enough actual parameters for macro 'DECL_MEMBER_FUNCTION_TRAITS' 1>C:\Users\Jason\Documents\Unreal Projects\UEVideo\Plugins\UEVideoRecorder\Source\UEVideoRecorder\Private\VideoRecordGameViewportClient.cpp(261): warning C4238: nonstandard extension used: class rvalue used as lvalue 1>C:\Users\Jason\Documents\Unreal Projects\UEVideo\Plugins\UEVideoRecorder\Source\UEVideoRecorder\Private\VideoRecordGameViewportClient.cpp(304): warning C4458: declaration of 'context' hides class member 1> D:\Program Files (x86)\UE_4.15\Engine\Source\ThirdParty\VideoRecorder\include/VideoRecorder.h(31): note: see declaration of 'CVideoRecorder::context' 1>D:\Program Files (x86)\UE_4.15\Engine\Source\ThirdParty\boost\boost/iostreams/detail/resolve.hpp(68): warning C4668: 'BOOST_IOSTREAMS_GCC' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' 1> UEVideoGameModeBase.cpp 1> UEVideo.cpp 1> UEVideo.generated.cpp 1> [10/13] Link UE4Editor-UEVideo.lib 1> Creating library C:\Users\Jason\Documents\Unreal Projects\UEVideo\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-UEVideo.lib and object C:\Users\Jason\Documents\Unreal Projects\UEVideo\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-UEVideo.exp 1>ERROR : UBT error : Failed to produce item: C:\Users\Jason\Documents\Unreal Projects\UEVideo\Plugins\UEVideoRecorder\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-UEVideoRecorder.lib 1> Total build time: 31.57 seconds (Local executor: 0.00 seconds) 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(46,5): error MSB3073: The command ""D:\Program Files (x86)\UE_4.15\Engine\Build\BatchFiles\Rebuild.bat" UEVideoEditor Win64 Development "C:\Users\Jason\Documents\Unreal Projects\UEVideo\UEVideo.uproject" -waitmutex" exited with code -1. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

JasonQWJ avatar Jun 10 '17 07:06 JasonQWJ

Hi,ash3d: I got the same problem just like JasonQWJ .After I added boost and VideoRecorder solution's build.cs to engine, I can generate the uproject which is installed the UEVideoRecorder and got the VS solution. But when I build the solution , the error C:\Program Files (x86)\Windows Kits\8.1\include\winrt\wrl\implements.h(2033): error C3861: “InterlockedIncrement”:Identifier not found happened, but I can‘t find any code which is using InterlockedIncrement ,so is there any problem with the library solution VideoRecoder will cause this problem? Or there is the system problems?

My operate system is Win10 and VS version is VS2015, besides the programing platform of VideoRecoder I chosed is Win8.1 Kit and v140 not v141. My UE4 editor version is 4.15.3

So if you have any idea about this problem ,please help me , thank you very much.

bigbenzhao avatar Jun 10 '17 13:06 bigbenzhao

“InterlockedIncrement” used inside WRL which is part of Windows SDK. UE 4.15+ starts to hide Windows platform atomics such as “InterlockedIncrement” which led to problems. Fortunately, only subset of WRL (namely, ComPtr) required for UEVideoRecorder, thus it is possible to include only required part of WRL (and that part does not use “InterlockedIncrement”). I have updated repository with that fix.

ash3D avatar Jun 11 '17 11:06 ash3D

Thank you @ash3D I compiled the success, but I recorded the video player to very fast. My setting: image

JasonQWJ avatar Jun 12 '17 12:06 JasonQWJ

In order to set veryfast performance preset provide non-negative crf (28 is default) and set performance to 7. Crf value -1 force default for both crf and performance.

ash3D avatar Jun 14 '17 05:06 ash3D

Hi ash3D Can You make a video about adding this plugin to the Unreal engine? if you do, it was very helpful for me and others as well.

pamz3ddesigns avatar Jun 20 '17 11:06 pamz3ddesigns

Hi ash3D! Thanks your great work! I have successfully recorded UE4 video through your plugin. it is used soft encoder. I change the encoder to NVENC encoder, I can record the video in UE4Editor environment. After I package the game , or run it at alone windows in UE4Editor, When I startrecord, the os prints "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information" , and then the app stops run. Do you test your Plugin using NVENC encoder?

I only change the VideoRecorder.cpp : #define CODEC_ID AV_CODEC_ID_HEVC //const AVCodec *const CVideoRecorder::codec = (avcodec_register_all(), avcodec_find_encoder(CODEC_ID)); const AVCodec *const CVideoRecorder::codec = (avcodec_register_all(), avcodec_find_encoder_by_name("nvenc_hevc")); //const AVCodec *const CVideoRecorder::codec = (avcodec_register_all(), avcodec_find_encoder_by_name("nvenc_h264"));

thanks !

telecom999 avatar Jun 21 '17 03:06 telecom999

@telecom999 Did the video you recorded look normal? I recorded out, the playback speed is very fast.

JasonQWJ avatar Jun 27 '17 03:06 JasonQWJ

@telecom999 Thanks for the idea of hardware encoding. I was able to reproduce behavior you described. The reason for the different behavior in UE4Editor environment and standalone window/packaged game turned out to be different frame format being used (8 bit in editor, 10 bit for standalone/packaged). I encountered this problem previously with software encoders too and implemented a workaround. But it turned out that this workaround is in not complete. I have fixed that as well as some other issues and update the repository.

ash3D avatar Jun 27 '17 08:06 ash3D

@ash3D The latest plugin version is good. Thank you very much!
@JasonQWJ yes, please use the the latest plugin version , the recorded video can be played with VLC and Windows Media Player . for the old version, VLC can not play the recorded vedio , Windows Media Player can play it correctly.

telecom999 avatar Jun 28 '17 03:06 telecom999

@ash3D Hi ash3D! I got an error follow the above method. error CS1729: 'UnrealBuildTool.ModuleRules' does not contain a constructor that takes 1 arguments in File UEVideoRecorder.Build.cs

could you help with this?

SuperMustard avatar Jul 25 '17 07:07 SuperMustard

@SuperMustard Wich UE4 version do you use? The plugin targets UE4.15+, if you have older version try to replace line public UEVideoRecorder(ReadOnlyTargetRules Target) : base(Target) in UEVideoRecorder.Build.cs with public UEVideoRecorder(TargetInfo Target).

ash3D avatar Jul 26 '17 04:07 ash3D

@ash3D Hi ash3D! Thank you for your help.

I am using UE4.15.3. After applying the change you mentioned, there is no more error. However, I still can't record the video. default

maybe it's because I don't use the plugin in a correct way. Thanks again.

SuperMustard avatar Jul 27 '17 01:07 SuperMustard

@SuperMustard Hi SuperMustard. Look at Log output. It can contain possible errors descriptions. Maybe you forget to set VideoRecordGameViewportClient in UE4 project settings? Omitting that will result in ignoring any video record operations.

ash3D avatar Jul 28 '17 03:07 ash3D

@ash3D Hi ash3D, It works well now, thank you for your amazing plugin.

SuperMustard avatar Jul 30 '17 02:07 SuperMustard

@SuperMustard Hi, SuperMustard image I set VideoRecordGameViewportClient in UE4 project setting , but still can not record . Is it because I don't use the plugin in a correct way ?

Wilson-w avatar Mar 02 '18 03:03 Wilson-w

@XiangBW What does the Log print?

ash3D avatar Mar 02 '18 04:03 ash3D

@ash3D Hi,ash3D I have already sloved the previous question , but now a new problem have appeared at packaging. [2018.03.05-02.07.31:119][389]UATHelper: Packaging (Windows (64-bit)): xgConsole: D:\work\BVIV_Engine_WBX\Development\Engine\Plugins\UEVideoRecorder\Intermediate\Build\Win64\BVIVApp\Inc\UEVideoRecorder\UEVideoRecorder.generated.cpp(85): error C2027: use of undefined type 'UEngine' [2018.03.05-02.07.31:119][389]UATHelper: Packaging (Windows (64-bit)): xgConsole: D:\work\BVIV_Engine_WBX\Development\Engine\Source\Runtime\Engine\Classes\Engine/GameViewportClient.h(63): note: see declaration of 'UEngine' I have tried adding the "Engine.h" to the "UEVideoRecorder.cpp" . But it's useless.

Wilson-w avatar Mar 05 '18 02:03 Wilson-w

@XiangBW Hi XiangBW. What UE version do you use? And what packaging settings (development, shipping)? "Engine.h" has already been included in "UEVideoRecorderPrivatePCH.h" which is included in "UEVideoRecorder.cpp", so adding it to "UEVideoRecorder.cpp" once more should not have any effect.

ash3D avatar Mar 08 '18 12:03 ash3D

Hi,ash3D. @ash3D I got problem follow the above method. 1>F:\plq\boost_1_67_0\boost/type_traits/is_complete.hpp(65): error C2059: syntax error:“<end Parse>” 1>F:\plq\boost_1_67_0\boost/type_traits/is_complete.hpp(62): error C2238: unexpected mark located ";" Before 1>F:\plq\boost_1_67_0\boost/type_traits/is_complete.hpp(65): error C2988: Unrecognized template declaration/definition

Aqiang223 avatar Apr 20 '18 07:04 Aqiang223

@Aqiang223 Hi Aqiang223. Try older boost version such as 1.65.1.

ash3D avatar Apr 22 '18 16:04 ash3D

Okay, so I've got everything working finally! I'm forever thankful that you made this plugin... But I've got two pretty big questions.

  1. How do I change the output path for the video? When typing in a directory into the "filename" field I get the error:

VideoRecorder: Error: Fail to create file VideoRecorder: Error: for video " VideoRecorder: Error: ‪C:\Users\User\Videos\test.mp4 VideoRecorder: Error: ": VideoRecorder: Error: Invalid argument VideoRecorder: Error: .

Yet when I just type in a filename such as test.mp4 with no directory, the video is saved in Engine\Binaries\Win64 and not even in my project directory... Is this how it's supposed to work?

  1. Why don't the encoded videos work with Unreal Engine 4? No matter what format I try, UE4's media player refuses to play the video. How can I go about making this work? I feel like it's pretty critical that the videos we encode in UE4... can be played back in UE4.

UPDATE:

  1. So I got the file path working by using forward slashes ( / ) instead of backslashes ( \ ). I sort of wish that was documented somewhere, but nevertheless, it works! So if anyone else was confused by that, then there's the solution.

  2. Okay, so along the same lines as the other problem, change the actual file extension to something else besides .mp4 will result in some videos working with the Media Player in Unreal. I changed the file extension to .wmv and it successfully played in the Media Player, however it's only at 30fps.

Again, I sort of wish this was documented somewhere, as this plugin is really one of a kind. Ash, you've made such an awesome and incredibly useful plugin, why let it go so unnoticed with such little documentation?

NCMcClure avatar May 15 '18 08:05 NCMcClure

@XilentRival This plugin was originally developed for specific project and placed on GitHub for development facilities. I didn't expect much interest from other people at that time, thus documentation is poor. Another point is than I'm not actively using and developing it now and some subtle details such as / vs \ in paths are mostly undiscovered. Unreal's Media Player has some restrictions regarding various formats support, I faced this problem with several videos (which was not recorded with this plugin) on player's early version. But I didn't try to play plugin's generated files in Media Player, so I haven't info on which formats/settings is compatible with Media Player.

Generally I agree that it is good idea to add more documentation and track known limitations and issues reported by users in single place. I'll probably do something in that regard in future when I'll take up the plugin development next time (I have several minor ideas which I plan to implement in next version sometime). And I'll probably then fix \ problem.

ash3D avatar May 16 '18 16:05 ash3D

Hello, thank you in advance for the great contribution with this plugin. I also apologize for my bad English. Following the tutorial found here, I still can not get the plugin to work on my project. These are the steps I do once I create the boot and videorecoder folders in the UE directory.

  1. I open the videoRecorder solution, and in properties I add the ffmpeg directories that you download from https://ffmpeg.org/ 1 2

  2. Then I recompile the whole solution which it does but it gives me some warnings. But since I do not have errors, I continue with the installation. 3 4

  3. I am directed to my project and add the plugin in the corresponding folder. then I open the solution and add the ffmpeg directory as I did with the videorecorder solution. 5 6

  4. At the time I recompile my solution and it gives me the following errors. 7 I do not really know what I'm doing wrong. And put the dll of ffmpeg in the folder system32 and installed the sdk in my visual as it was said above. These are my installed add-ons. 8 Could someone help me, telling me what I'm doing wrong? Many thanks in advance for the help and sorry for the inconvenience

yvasquezmonoku avatar Jun 04 '18 18:06 yvasquezmonoku

Hello, @yvasquezmonoku Your English is clear in contradistinction to text in screenshots ). Though by dint of google translate + error codes I got it.

In step 1 your VC++ Directories configuration is somewhat redundant. You can leave it untouched from repository and add FFMPEG_ROOT macro in Microsoft.Cpp.x64.user property sheet instead. image

In step 3 there is no need to add ffmpeg directory to UE project settings. All the needed configuration done in VideoRecorder.Build.cs.

Error in step 4 is probably due to toolchain version mismatch between VideoRecorder solution and UE project. Try to choose v140 toolset for VideoRecorder if your UE project uses VS 2015 to compile (note that it can still been using VS 2017 IDE for editing). image You need to install VC++ 2015 toolset to be able to do this - check this box (you don't have to do this if you have VS 2015 installed): image Or alternatively build VideoRecorder with VS 2015.

ash3D avatar Jun 05 '18 09:06 ash3D

Thank you very much for all the help, a thousand apologies for the screenshots that are not in English. Following what you tell me, I get the error. Libavutil / avconfig.h No such file or directory. Looking for the file manually in the ffmepg SDK I can not find it, then search the internet and find it. It is the following https://github.com/mooncatventures-group/ffmpegDecoder the only thing I do is copy the file in the folder that the visual asks me for. but now I get another error where it says that it can not open the input file avcodec.lib with the code LNK1181, I do not know if this error is because of the Libavutil / avconfig.h that was downloaded. Again, thank you very much for all the help. these are the alerts generated by me and the error 9

yvasquezmonoku avatar Jun 06 '18 02:06 yvasquezmonoku

@yvasquezmonoku avconfig.h should be in FFmpeg SDK at the path FFMPEG_ROOT/include/libavutil, I just checked it with latest FFmpeg version (ffmpeg-4.0-win64-dev/include/libavutil/avconfig.h). Failure to open avcodec.lib is due to improper FFmpeg lib path.

Considering you had already successfully built VideoRecorder earlier, you probably break something with latest changes. If you moved to specifying FFmpeg paths via FFMPEG_ROOT macro in property sheet, check back the path. And do not forget to save property sheet after editing.

ash3D avatar Jun 06 '18 07:06 ash3D