Web camera plugin

Hi,

Getting the following errors and warnings when recompiling. UE 4.14. Any ideas how to fix this?

Severity Code Description Project File Line Suppression State
Error C2248 ‘USceneComponent::AttachParent’: cannot access private member declared in class ‘USceneComponent’ WebcameraPlugin C:\Users est\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 27
Severity Code Description Project File Line Suppression State
Error C2248 ‘USceneComponent::AttachParent’: cannot access private member declared in class ‘USceneComponent’ WebcameraPlugin C:\Users est\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 34
Severity Code Description Project File Line Suppression State
Warning C4996 ‘USceneComponent::AttachTo’: This function is deprecated, please use AttachToComponent instead. Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile. WebcameraPlugin C:\Users est\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 43
Warning C4458 declaration of ‘InputComponent’ hides class member WebcameraPlugin C:\Users est\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 86
Warning C4458 declaration of ‘InputComponent’ hides class member WebcameraPlugin C:\Users est\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 238

I think you must replace AttachParent to SetupAttachment(ComponentYouWantToAttach)

Does anyone have a version of this working in 4.14? Looks really useful but I’m struggling a bit with the C++.

Hey there!

This is a neat plugin-- thanks for doing this work!

I’m interested to know if you might have an idea on how one might go about capturing video from a remote webcam or video stream. As far as I understand it, this is primarily used for capturing local webcam devices’ output, and so would need some tweaking to capture video from a remote source.

I’m primarily interested in streaming a live video feed from a web source into a UE4 level.
The best I’ve found so far for this have been all been deprecated and involved QT + HTML5.
As someone who has worked closer to the metal on this than me, do you have any tips or suggestions on where to look?

Thanks!

Does something like the “Stream Media Source” asset work for you?

Yeah, I didn’t know this feature had been finished, thanks!

First: Thank you Temaran for providing this plugin!
Still new in Unreal and trying to get this to work.
Plugin showing up in 13.2 after a recompile but cannot open the example-sene and thus have no idea how to utilize the plugin to get the webcam-feed.

What I did:

  1. Generated visual-studio file.
  2. Tried to Build, but could not succeed because of the same errors that Bella_LV had as well.

Can I comment out the lines and still get the project to run?
Do I need to create C++ classes inside my Project to get the Plugin to run?

If someone who got it to work could post a Demoscene with a simple setup - that would be gorgeous.
Apologies for my little knowledge! Pleas help me improve :))

Best F

@Phantomatic

You should comment out this two lines to get it compiled for 4.13.

https://postimg.org/image/sz6llzuj1/

Dear Tyrus86,

GREAT!! Thank you so much!!

Commenting out the two lines you mentioned did the trick for me.
I had an error complaining about “cooked content” which I solved switching to “DebugGame Editor” instead of “Development Editor”.
Then there were issues with breaking points: pressed “continue” - and it DID IT :smiley: :smiley: :smiley:

Could open the file in UE 4.13.2 and the webcam is working!

Thank you very much Tyrus86, I hope I can return the favor someday :)))

4.14.1: commented out the 3 lines mentioned above, switched to DebugGame Editor, as suggested.

Compiles in Visual Studio, but trying to start the editor crashes every time with “Assertion failed: ModuleManager.IsModuleLoaded(ModuleName) [File:D:\Program Files (x86)\Epic Games\4.14\Engine\Source\Runtime\Core\Public\Modules\ModuleManager.h] [Line: 247]
Tried to get module interface for unloaded module: ‘Webcamera’”

This is with the binary version of the engine, not from source.

Hi, aliasense!
Did you fix it for 4.14?

Hi, did you fix it with VIVE? Could I know how did you make it?

Can I get multiple cameras feed, one by one?

Hello,

I’m successfully getting stream using this plugin within my project in 4.10. However I really need to get stream from multiple cameras (not simultaneously though). Since you wrote “Runs smoothly using x amount of registered webcams” Can you please tell me how did you make this sure? If there’s anything I can do to get streams from all cameras and switch between streams of different cameras, that would be great.

Thanks in advance.

My problem is when connect more than one cameras engine crashes at starting plugin, I using 4.13.x

Same problem here and no amount of refreshing and regenerating VS files would fix it. Then I opened WebcameraPlugin.uproject in VS and found the Plugins section empty. Edited it to this:


{
	"FileVersion": 3,
	"EngineAssociation": [DON'T CHANGE ANYTHING HERE]
	"Category": "",
	"Description": "",
	"Modules": 
		{
			"Name": "WebcameraPlugin",
			"Type": "Runtime",
			"LoadingPhase": "Default"
		}
	],
	"Plugins": 
		{
			"Name": "Webcamera",
			"Enabled": true
		}
	]
}

The other compile errors in WebcameraPluginCharacter.cpp can be fixed like so:


//FirstPersonCameraComponent->AttachParent = GetCapsuleComponent();
becomes
FirstPersonCameraComponent->SetupAttachment(GetCapsuleComponent());


//Mesh1P->AttachParent = FirstPersonCameraComponent;
Mesh1P->SetupAttachment(FirstPersonCameraComponent);

//FP_Gun->AttachTo(Mesh1P, TEXT("GripPoint"), EAttachLocation::SnapToTargetIncludingScale, true);
FP_Gun->SetupAttachment(Mesh1P, TEXT("GripPoint"));


And I updated WebcameraPluginCharacter.cpp to add Webcamera:


using UnrealBuildTool;

public class WebcameraPlugin : ModuleRules
{
	public WebcameraPlugin(TargetInfo Target)
	{
		PublicDependencyModuleNames.AddRange(new string] { "Core", "CoreUObject", "Engine", "InputCore", "Webcamera" });
	}
}

All these changes results in a cleaner DebugGame build in VS and the demo starts and runs correctly in 4.14.3 built from source.

Has anyone discovered a way to improve the resolution of the camera output with this plugin? Both of my webcams are getting configured to 640x480 when they are HD devices that should do 1920 x 1080. Free virtual beer for any solid tips!!

Do u know how I can make it if the video source is from remote place? Can I still use the webcam?

Do u know how I can make it if the video source is from remote place? Can I still use the webcam?

:have you make it run with your own project successfully?

Hi guys!
I have made it used in my project on UE 4.14 with video capture card as webcam successfully.
I would like to write my steps here to help others use this plugin.
I need to use video capture card. It can be registered as webcam if you use a USB converter supporting UVC protocol. In other words, as long as your device can be recognized as imaging device in device manager, you can use this plugin for video streaming.
The instructions here GitHub - Temaran/UE4Webcamera: Adds support for web cameras in Unreal Engine 4 is clear enough. I just make some supplements.
First, if your project is a pure blueprint, you need to new a C++ class such as name “webcam”, the base class is: “I guess you have a pawn in your scene somewhere (the one the camera is attaching to when you play). I would derive from that blueprint’s base class (most likely ACharacter or APawn)”. Then close Visual studio and return back to your project folder, copy the plugin folder to your project’s plugin folder and right click yourproject.uproject, choose Generate Project Files. It will build everything.
Secondly, reopen visual studio, in yourproject.build.cs file, add “Webcamera” to your PublicDependencyModuleNames.AddRang. And you can add any function you want in webcam.cpp&webcam.h just as what Teraman did in his sample project. To use this plugin only for live video streaming, As Teraman remind, “Hook up the Texture you get from running Connect(cameraIndex) to a UPROPERTY to prevent it from being garbage collected in your cpp somewhere (begin play might be a good place).” I just add a UTexture2D property visible to blueprint and call connect&disconnect as in firstpersoncahracter.h&.cpp in Teraman’s sample project. It should build successfully.
Third, in the blueprint level, reparent your blueprint to this new C++ base class webcam. Then just follow Teraman’s sample project “check out the M_Webcamera material and the character blueprints event graphs to see an example of how you can hook up the texture to a mesh.” If you are a UE newb like me, you’d better check the Intro to Materials: Overview | 01 | v4.0 Tutorial Series | Unreal Engine - YouTube and following video to learn something about material to avoid wasting time on debugging for some tiny details.

Of course, thanks @Temaran again for his plugin and his great help to me via email.
Hope you good luck~!

Thank you so much!!! This did the trick, except that I got some build errors on startup, but doing a full rebuild in the engine worked! This apparently happens when you choose to convert the project “In place” instead of copying it somewhere else.