Screen record in unity3d - unity3d

How to do screen record in unity?
I want to record my screen(gameplay) during my running game.
That should be play/stop , replay , save that recording on locally from device, open/load from my device (which is already we recorded).
In my game one camera which can capture native camera, and one 3d model.
I wish to record that both and use my functionality whenever i want.
Thank you in advance.

This is hard to implement, but not impossible. Because every frame or interval you need to capture screen shot of your camera view and store it in the list. You need good, (Smaller interval but not much. Because when it becomes smaller, needs more memory) interval value. If your interval is big raplay can be seen laggy.
While you play game your ram becomes full and os will terminate the app. So you need to fully cover memory optimization. Another solution is assets in Unity Asset store.
EZ Replay Manager can be used. (Keep in mind: I haven't tried it yet.)
Free
Pro

Check out this open-source project: https://github.com/getsocial-im/getsocial-capture.
By default our project records Main Camera's rendered content. C# examples are in the repo.
You can record in 2 modes:
Continuous mode - capture last X frames.
Manual mode - capture frames on your own when needed. For example, record a timelapse of the level.
Once the recording is done, you can generate GIF, get raw bytes and do whatever you want. E.g. let your users share that GIF with friends.
Here's the recording of a game session from the test app. The recorded GIF shows up in the end:
Disclaimer: I worked at GetSocial at the time of writing.

well i know a guy who post a similar project on github. link :- https://github.com/thanh-nguyen-kim/Unity_Android_Screen_Recorder
but there is a limitation and that is this code is only works on android devices(android means only android not even on ios).
but this is very powerful recorder and it is capture whatever appear on screen(so basically it is a screen recorder made with unity) and also it will capture your microphone output.give it a try.
and if you find any other solution then please also tell me. because it will very helpful for me.because i want to record video with in-game audio and also save it into gallery

Unity now has a screen recording tool builtin. It's called Recorder and doesn't require any coding.
In Unity, go to the Window menu, then click on Package Manager
By default, Packages might be set to "In Project". Select "Unity
Registry" instead
Type "Recorder" in the search box
Select the Recorder and click Install in the lower right corner of the window
That's about all you need to get everything set up and hopefully the
options make sense. The main thing to be aware of that setting
"Recording Mode" to "Single" will take a single screenshot (with
F10)
NOTE: This is a copy of my answer from a Unity screenshots question

Related

How do I create a test app to create many screenshots in UE4?

I'd like to create a test application for my Unreal Engine based game to create screenshots. I'd like to place many (possibly thousands) of cameras throughout the maps and then have my test application enumerate them all and take a screen capture at each camera location.
I came across Taking Screenshots, but wanted to first check to see if this isn't already built into UE4 in the editor, or some tool. I'm also aware of the Screenshot Comparison Tool, but that doesn't seem to be what I need because I don't really want to use UE4 to do the image matching, but instead just want a directory full of images that I can do with what I want.
Any suggestions?
This is not directly what you want to do but I found this article very interesting: https://www.unrealengine.com/en-US/blog/capturing-stereoscopic-360-screenshots-videos-movies-unreal-engine-4?sessionInvalidated=true
It explains how people at Ninja Theory Ltd proceeded to produce their 360 video trailer which is, in the end, producing two 360 screenshots per frame.
So what they did was having everything exported in a folder (as a sequence of images) and then did what they wanted with it. (In this case put them all together with ffmpeg to make a video)
They used a plugin, I do not know if it can be tweaked not to make 360 captures but the built-in "take screenshot" from UE4 could work for you.
More specifically to what you need, you could probably store all positions/transform in an array, loop over it when you want to make the screenshot. Each step, you place your Camera at the specific position, make sure it is the current active camera to change the "view" and take a screenshot.
Taking screenshots and setting parameters such as export folder, resolution etc. ... can be called via console commands and console commands can be executed from code or blueprint using the "execute console command" node (there is an example in the article).
I hope it helps.
I think the best bet you have is rendering camera to a texture.
this way you can have multiple inactive camera then iterate through them, activate them, capture their screen view and going to the next one.
for basic tutorial have a look at
https://www.youtube.com/watch?v=a9iho861SlY

How to record video with ARCore with Unity?

I have been stuck on this problem for over a month now. I just need to record the video feed when people are using the AR app.
There are several options:
1. Take the screenshot in Unity for every frame.
I tried taking a screenshot every frame. This is way too slow. The fps is only 5.
Then I tried saving the texture to an array and encode them to images afterwards. This would take a lot of memory and would cause a significant frame drop on mobile phone. The fps is around 10.
If anyone has a great idea for this method, please let me know.
2. Use native plugins to record video.
I haven't found any solutions on this one. I am afraid that this may conflict with the ARCore.
I know that there is an Android solution but ideally I want to use Unity. Any help is appreciated, thank you!
3. Save the texture from the texture reader api provided by ARCore computer vision example.
There is a Computer Vision example in the directory. And I can get the texture directly from GPU with its api.
However, the fps is still low. With its edge detector example, the fps is around 15. I succeeded in saving those frames to local directory in another thread. But the fps is still not acceptable. The bottomline is 720p at 30fps.
PS: I just need to save the frames. I can handle encoding them into videos.
PPS: Just recording the camera feed and recording the camera feed and the augmented objects together are both okay. Either one achieved is great.
You can easily implement video recording AND sharing using the (really great) NatCorder unity asset (asset store link) and the related NatShare API. I did this very same thing in my own ARCore experiment/"game."
Edit: you may have to implement this workaround to get a smooth framerate.

Video recording of IPhone screen of total game play

I want to record screen video recording during application running and unfortunately apple didn't provide any scratch code on it.
The scenario is there a 'RECORD' button and a 'STOP' button. when I touch 'RECORD', I need to take a video of the entire gameplay (Screen Video) and stop recording when I touch 'STOP'.
Is there any other method besides the screenshot method to do this?
For example - Talking Tom, Angry birds, etc.
Instead of taking a video, you could record the user interactions and replay them. If you use a PRNG for random events, you should also make sure to seed it with the same value while replaying a game.
Screen capture in iOS has a few problems, one of which being performance, and the other being the fact that some animations are not captured because they happen at some low level, out of sight for normal screen capturing methods.
This, of course, will only replay the game on screen.
if we talk about angry birds, that has been developed in COCOS2D and if your game is also developed in cocos2d, you are lucky..!! Maybe if you dig-in you could find a way to use it with UIKit as well...who knows..!!
there is a cocos2d 3rd party utility named -Kamcord that can be used for recording gameplay.
kamcord.com
COCOS2D Kamcord archive link
We provide an SDK called "Everyplay" that allows you to do exactly what you're looking for. It's free to use, and is lightweight.
We provide out-of-the-box integrations for Unity3D, cocos2d (1.x, 2.x), cocos2d-x, and you can of course integrate to a custom OpenGL-based game engine.
The documentation is available at https://developers.everyplay.com/doc
The documentation contains an example app key to use when developing, but you can of course sign up for your own client key at https://developers.everyplay.com/

Reduced quality OpenGL ES screenshots (iPhone)

I'm currently using this method from Apple to take screenshots of my OpenGL ES iPhone game. The screenshots look great. However taking a screenshot causes a small stutter in the game play (which otherwise runs smoothly at 60 fps). How can I modify the method from Apple to take lower quality screenshots (hence eliminating the stutter caused by taking the screenshot)?
Edit #1: the end goal is to create a video of the game play using AVAssetWriter. Perhaps there's a more efficient way to generate the CVPixelBuffers referenced in this SO post.
What is the purpose of the recording?
If you want to replay a sequence on the device you can look into saving the object positions etc instead and redraw the sequence in 3D. This also makes it possible to replay sequences from other view positions.
If you want to show the game play on i.e. youtube or other you can look into recording the game play with another device/camera or record some game play running in the simulator using some screen capture software as ScreenFlow.
The Apple method uses glReadPixels() which just pulls all the data across from the display buffer, and probably triggers sync barriers, etc, between GPU and CPU. You can't make that part faster or lower resolution.
Are you doing this to create a one-off video? Or are you wanting the user to be able to trigger this behavior in the production code? If the former, you could do all sorts of trickery to speed it up-- render to a smaller size for everything, don't present at all and just capture frames based on a recording of the input data running into the game, or other such tricks, or going even further run that whole simulation at half speed to get all the frames.
I'm less helpful if you need an actual in-game function for this. Perhaps someone else will be.
If all else fails.
Get one of these
http://store.apple.com/us/product/MC748ZM/A
And then convert that composite video to digital through some sort of external device.
I've done this when I converted vhs movies to dvd a long time ago.

How to capture a motion in iphone camera

In My application as the user opens the camera, camera should capture a image as soon as there is a difference in image when compared to previous image and camera should always be in capturing mode.
This should be done automatically without any user interaction.Please Help me out as i couldn't find the solution asap.
Thanks,
ravi
I don't think the iPhone camera can do what you want.
It sounds like your doing a type of motion detection by comparing two snapshots taken at different times and seeing if something has changed between the older and the newer image. To that you need:
I don't think the iPhone can do what you want. The camera is not setup to automatically take photos and I don't think the hardware can support the level of processing needed to compare two images in enough detail to detect motion.
Hmmmm, in thinking about it, you might be able to detect motion by somehow measuring the frame differentials in the compression of video. All the video codecs save space by only registering the parts of the video that change from frame-to-frame. So, a large change in the saved data would indicate a large change in the environment.
I have no idea how to go about doing that but it might give you a starting point.
You could try using opencv for motion detection based on differences between captured frames but I'm not sure if the iPhone API allows reading multiple frames from the camera.
Look for motempl.c in the opencv distribution.
You can do a screenshot to automatically capture the image, using the UIGetScreenImage function.