Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by WTFusername · Aug 14, 2018 at 07:52 AM · unity4.3

Unity UWP how to record a game screen in a game? (Windows)

First of all, I am sorry about my English. I hear to this community is very powerful! I'm in trouble now. How to record a game screen in a game? in a window environment. I have tried many ways. but it didn't run when it was built with UWP. All of asset store and common method. So I try to save pictures as a function of screencapture and convert them into video. with ffmpeg. But this is also too hard for me to relate to Unity. If you know how to record a video or How to use ffmpeg in Unity or another things. comment please! any method.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by RohitNutalapati · Nov 28, 2018 at 05:29 PM

I'm assuming youre doing something like this to get screenshots : https://docs.unity3d.com/ScriptReference/Time-captureFramerate.html

If you want to automate the ffmpeg cmd part in the application, you can run cmd commands from code like this: https://stackoverflow.com/a/1469790/6806568

Run ffmpeg commands after you have captured all the screenshots. Also check: https://superuser.com/a/1273105

Bear in mind that capturing screenshots is a very taxing process. Not to mention the storage it take up to store all the sceenshots for post processing. If you are not targeting real time then this is a great solution.


If you want to do this real time and need it to be really fast, an other way to do this is using native plugins. Headsup, this is optimal but a LOT of work.

Here is a general overview of what you'd do:

1) Get the camera view into a Texture2D. (https://docs.unity3d.com/ScriptReference/RenderTexture-active.html)

2) Send the texture to a native plugin. (Very good place to start : https://bitbucket.org/Unity-Technologies/graphicsdemos/src/0615fcd65c97/NativeRenderingPlugin/UnityProject/Assets/Plugins/?at=default)

3) Download and set ffmpeg include and library directories in your native plugin project. (https://ffmpeg.zeranoe.com/builds/ -- I usually use dev)

4) Now, the hardest part is to get the RGB data from unity texture thats been sent to the native plugin. (https://github.com/Microsoft/graphics-driver-samples/blob/7696d8388d9d94f2190c8405f1f7a8335924722d/render-only-sample/rostest/util.cpp#L244)
NOTE: This will also depend on Grapchic API that your machine is using. Windows usually uses Direct3D api. If using OpenGL see glGetTexImage.

5) Once you have the RGB data, you can do something like this: https://stackoverflow.com/a/47325076/6806568 to generate a video from it.



This maybe an overkill, but hope this helps someone!
P.S: I've only done parts of this solution myself so this is a hunch.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

150 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rotate 3arrow using two hands (HoloLens2) 0 Answers

Can someone please help me fix the script? in unity3D to move forwards and backwards by swiping to the screen,Rotate and move forward script not working 0 Answers

UNITY Sending RPC from Player 1 to Player 2, But Still Player 1 Values are Changing (The TakeDamage is being called on Shooter's PC and not on other PC where it should go)) 0 Answers

I am working on a unity project that is a very big project but unfortunatly my game has been crashed 2,3 times without any reason..My 2 months hardwork has been wasted.. Plzz help me why this happens on unity..I am using unity 4.3.4 1 Answer

Console is not showing print(""); 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges