User Tag List

Page 1 of 2 12 LastLast
Results 1 to 40 of 43

Thread: Web camera plugin

  1. #1
    0

    Web camera plugin

    Hello!

    I had to access the web camera in-engine for one of my projects, so I though I would share it with the community!

    https://github.com/Temaran/UE4Webcamera

    I implemented it using directshow, so only windows support for now.

    Hopefully it's useful to someone
    And if you would like to contribute, please do! It still needs multiplatform support, Easy BP support etc.

    Best regards,
    Temaran

    -------------------------------------------------------------
    Some of my projects related to UE4:

    https://github.com/Temaran/UE4Webcamera
    https://github.com/Temaran/UE4RenderDocPlugin
    https://github.com/Temaran/UE4ShaderPluginDemo
    https://github.com/Temaran/EyeXforUE4 (Forked from Tobii. It was moved there from my github )
    Last edited by Temaran; 01-28-2016 at 03:50 PM.

  2. #2
    0
    Very nice! Thank you for sharing your work!

  3. #3
    0
    Np ^^

    /Temaran

  4. #4
    0
    Temaran, many thanks for camera plugin!

  5. #5
    0
    Thanks a lot for sharing this. I realy would love to implement this in my project for typing in VR like here: https://www.youtube.com/watch?v=SKPYx4CEIlM

    When I try to open your project file I get this:
    Name:  Error.png
Views: 4136
Size:  16.6 KB

    I'm using 4.10.4 at the moment. In your installation instructions you point out not to forget to run UE4's Generate Project Files. Does this mean it has to be a C++ project and that I have to recompile it with visual studio? Or do I have to install the engine from source code?

    Sorry for these noob questions but I'm unfamiliar with C++ and really need this plugin up and running. The last plugin I used (ocean plugin) worked without any C++ so I am unsure if this is even necessary here.

    Thanks a lot for your help!
    Last edited by andtheand; 02-26-2016 at 08:47 AM.

  6. #6
    0
    Quote Originally Posted by andtheand View Post
    Thanks a lot for sharing this. I realy would love to implement this in my project for typing in VR like here: https://www.youtube.com/watch?v=SKPYx4CEIlM

    When I try to open your project file I get this:
    Name:  Error.png
Views: 4136
Size:  16.6 KB

    I'm using 4.10.4 at the moment. In your installation instructions you point out not to forget to run UE4's Generate Project Files. Does this mean it has to be a C++ project and that I have to recompile it with visual studio? Or do I have to install the engine from source code?

    Sorry for these noob questions but I'm unfamiliar with C++ and really need this plugin up and running. The last plugin I used (ocean plugin) worked without any C++ so I am unsure if this is even necessary here.

    Thanks a lot for your help!
    Do you have Visual Studio 2015 installed? If you do, then you might not have the right features installed. UE4 requires the C++ part of the install. Click modify on your install and choose to install that optional feature. I can't remember what it's called exactly.

  7. #7

  8. #8
    0
    Cool, I got it working. It just had to be a C++ Project. Thanks for this awesome plugin!

  9. #9
    0
    Thanks for the plugin, got it compiled using version 4.11. Had to rename an override in WebcameraPluginHUD.h, is now ShowHUD (if I'm correct)
    This shouldn't affect the plugin itself. Runs smoothly using x amount of registered webcams. Was able to catch an internet stream using a virtual cam spawned in vMix or magicCam

    Thanks for sharing!

  10. #10
    0
    andtheand, how to install it? It`s not working for me. Name:  error.jpg
Views: 3729
Size:  7.0 KB

  11. #11
    0
    please make simple tutorial how to add web camera video to texture!

  12. #12
    0
    @grifgont: you need visiual studio installed with c++ libaries. If you then open the example project from the gitub download it will recompile. But I still have some problems integrating this in my own project which was blueprint only.

  13. #13
    0

    Glad to this plugin,but a problem appears in UE4.12

    i am glad to find this plugin using directshow to show my web camera,before i hace used opencv plugin to show two web cameras but it can't show two same web camera at the same time,can show two differ web camera at the same time.
    so i find your plugin using direct show,but when want to open ,it appears can't compile, i opened the project by visual studio ,see some problems i can't solve.could you help me?
    the problems shows like the pic:
    Name:  QQ图片20160812103109.png
Views: 3047
Size:  33.4 KB
    Name:  QQ图片20160812103203.png
Views: 3053
Size:  80.4 KB

  14. #14
    0
    Alas! cannot compile for 4.12, deprecated functions

  15. #15
    0
    just comment the line with the error and it should compile.
    This line is part of the demo, not the plugin, so it's not important

  16. #16
    0
    I am very new to Unreal guys. I am working on a project for work. I need to get this plugin working for HTC VICE. I am getting errors and would not allow me to open the plugin. Not sure what to do. Please Help.

    Regards,
    Sam

  17. #17
    0
    Promoter
    Join Date
    Dec 2014
    Posts
    184
    I want to use this with VIVE, I'll check this plugin today.
    Thanks
    ABC Augmented Reality by UE4
    GooglePlay

    ArchVis VR

  18. #18
    0
    Promoter
    Join Date
    Dec 2014
    Posts
    184
    I don't know where is the problem but it can not start VIVE front camera, i test Unreal4AR plugin that plugin could start VIVE front camera is there any solution ?
    ABC Augmented Reality by UE4
    GooglePlay

    ArchVis VR

  19. #19
    0
    Supporter
    Join Date
    Jul 2014
    Posts
    6
    How can I make it work with 4.13 or later?
    Really need help.

  20. #20
    0
    Promoter
    Join Date
    Dec 2014
    Posts
    184
    It's working with 4.13
    ABC Augmented Reality by UE4
    GooglePlay

    ArchVis VR

  21. #21
    0
    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\test\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\test\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\test\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 43
    Warning C4458 declaration of 'InputComponent' hides class member WebcameraPlugin C:\Users\test\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 86
    Warning C4458 declaration of 'InputComponent' hides class member WebcameraPlugin C:\Users\test\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 238

  22. #22
    0
    Promoter
    Join Date
    Dec 2014
    Posts
    184
    I think you must replace AttachParent to SetupAttachment(ComponentYouWantToAttach)
    ABC Augmented Reality by UE4
    GooglePlay

    ArchVis VR

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

  24. #24
    0
    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!

  25. #25
    0
    Quote Originally Posted by fpruitt View Post
    I'm primarily interested in streaming a live video feed from a web source into a UE4 level.
    Does something like the "Stream Media Source" asset work for you?
    https://docs.unrealengine.com/latest/INT/Engine/MediaFramework/HowTo/StreamMediaSource/

  26. #26
    0
    Yeah, I didn't know this feature had been finished, thanks!

  27. #27
    0
    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.

    Name:  WEBCAM_ERROR.PNG
Views: 2026
Size:  42.0 KB

    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

  28. #28
    0
    @Phantomatic

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

    https://postimg.org/image/sz6llzuj1/
    Last edited by Tyrus86; 12-09-2016 at 11:30 AM.

  29. #29
    0
    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

    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 ))

  30. #30
    0
    Infiltrator
    Join Date
    Aug 2015
    Posts
    20
    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:\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.

  31. #31
    0
    Quote Originally Posted by aliasense View Post
    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\test\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\test\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\test\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 43
    Warning C4458 declaration of 'InputComponent' hides class member WebcameraPlugin C:\Users\test\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 86
    Warning C4458 declaration of 'InputComponent' hides class member WebcameraPlugin C:\Users\test\Downloads\UE4Webcamera-master\UE4Webcamera-master\Source\WebcameraPlugin\WebcameraPluginCharacter.cpp 238



    Hi, aliasense!
    Did you fix it for 4.14?

  32. #32
    0
    Hi, did you fix it with VIVE? Could I know how did you make it?

  33. #33
    0
    Supporter
    Join Date
    Jul 2014
    Posts
    6

    Can I get multiple cameras feed, one by one?

    Quote Originally Posted by cklosters View Post
    Thanks for the plugin, got it compiled using version 4.11. Had to rename an override in WebcameraPluginHUD.h, is now ShowHUD (if I'm correct)
    This shouldn't affect the plugin itself. Runs smoothly using x amount of registered webcams. Was able to catch an internet stream using a virtual cam spawned in vMix or magicCam

    Thanks for sharing!
    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.

  34. #34
    0
    Promoter
    Join Date
    Dec 2014
    Posts
    184
    My problem is when connect more than one cameras engine crashes at starting plugin, I using 4.13.x
    ABC Augmented Reality by UE4
    GooglePlay

    ArchVis VR

  35. #35
    0
    Quote Originally Posted by MDCCLXXVI View Post
    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:\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.
    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:

    Code:
    {
    	"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:

    Code:
    //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:

    Code:
    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.

    David

  36. #36
    0
    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!!

    David

  37. #37
    0

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

    Quote Originally Posted by Matochai View Post
    Does something like the "Stream Media Source" asset work for you?
    https://docs.unrealengine.com/latest/INT/Engine/MediaFramework/HowTo/StreamMediaSource/
    Do u know how I can make it if the video source is from remote place? Can I still use the webcam?

  38. #38
    0
    @andtheand:have you make it run with your own project successfully?

  39. #39
    0
    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 https://github.com/Temaran/UE4Webcamera 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 https://www.youtube.com/watch?v=lngF4VVNER4&list=PLZlv_N0_O1gbQjgY0nDwZNYe_N8IcYWS- 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~!
    Last edited by Totomoon; 02-19-2017 at 04:29 AM.

  40. #40
    0
    Supporter
    Join Date
    Feb 2017
    Posts
    4
    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.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •