@@ShakerDev So you could make a script like this that'll detect when a video ends and send the player to a scene, and have the scene start on the ending frame of the video. using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.Video; public class VideoPlayback : MonoBehaviour { public string nextSceneName = "JoeStar4446s Cool Scene"; private VideoPlayer videoPlayer; private void Start() { videoPlayer = GetComponentInChildren(); videoPlayer.loopPointReached += OnVideoFinished; } private void OnVideoFinished(VideoPlayer player) { player.Stop(); // Script by Lua, please credit me lovely SceneManager.LoadScene(nextSceneName); } }
Make sure you have the right objects selected: In the hierarchy, the object with the timeline component; and in the timeline window click on the recorder clip. Also setting/unsetting the lock in both the timeline window and the inspector may help
What I wanna do is play the game in game view and record it in scene view. Is his possible? Im making an RTS game where i need to give commands to the soldiers in the game view but i want them to be reocded from another anglle at high framerate.
@@HaykAmirbekyanTKD No problem :D Just keep your camera needed for gameplay alone, and add a new camera for your cinematic angle. In the recorder clip, in input, change the source from Game View to Targeted Camera, and camera to TaggedCamera. Then all you need to do is give your cinematic camera a unique tag and put that tag in the TaggedCamera field. Doing it this way will let you play the game normally in the game view, but the output video file you get will be what your cinematic camera sees, not what you see. It will of course also have all the other benefits of guaranteed FPS and arbitrarily high resolution and all that. Hope this helps :D
@@aqsasardar Shouldn't be a problem :) If you want pure gameplay clips, you can just remove all the cinemachine stuff and as long as the recorder is there in the timeline, it will record it all to your preferred quality when you enter play mode, and you should have full control in the game. If you want hybrid control and cinematics, it'll work in exactly the same way. Keep what you want and control the player as normal, although you may need to disable some stuff like the first person camera you normally use, but it should be easy enough to get working :)
Thank you fo this useful tutorial. Initially I thought it was so complicated with all those options but once your understand the logics the rest is fun.
the main issue with this approach is that if you record while Unity is running, its gonna lag. Its better to export the game as a build and find a way to record the build. any tips?
@@HaykAmirbekyanTKD If you use Unity Recorder there will guaranteed be no lag in the video, unity will take as long as it needs on each frame to ensure the output video has the exact framerate and resolution you set. There will be no skipped or doubled frames. That is of course not the case if you just screen record a build, which can have skipped or doubled frames, since your screen recorder is unable to tell your game to slow down.
It works, but for some reason, some of my tracks moved around every time I reopened the project, just a bit, but enough to through it all off, so I removed the recorder :/
It seems there's currently no direct way to export with transparency, your options are either to export an image sequence of PNGs, which do have an option for alpha, and stitch them together. Or you could also take the green screen approach and just put a solid color in the background, and composite it out in post
@@EugeneRamirezMapondera I'm not entirely sure what you mean by multipass rendering, but there should be nothing stopping you from creating multiple cameras and selecting the layers that they will see to the different layers you want. Then you should be able to hook a camera to each clip and record them all at once
Thanks, closer to what I'm looking for. I just want cutscenes of my gameplay from different scenes for a trailer for YT, plus I'm trying to create a cutscene for part of the game that shows other scenes. So hopefully I can record these scenes then edit them together in one timeline? Or use an external movie editor program then re-import the full cutscene and then add the audio etc. I usually neglect the animation in my game, only use it when necessary, most is done in code if I can for the gameplay or interactions etc. Thank you, though, getting hard to find exactly what I'm looking for, been weeks searching online. Lots of cutscene videos of one scene, but not multiple.
Hmm, have you made sure the recorder clip has a valid path in the output settings, and did you stretch it across the entire timeline? It's a little hard to help with so little information to go on; does the game slow down when you hit play?
I'm not sure I understand what you mean, the animation you made with timeline itself will be played without problem on mobile once you trigger it. If you're talking about exporting gameplay at runtime on mobile however, unity recorder won't work, as it was designed for editor use only, it slows the game down to be able to record everything without any lag spikes. You'd have to try something else like using the ScreenCapture class to take a screenshot every frame, or try one of the assets on the asset store instead. If you just want to show your cutscene, timeline will work 👍
@@The_True_Duck I meant for instance: the user chooses some settings that can change a predefined animation routine. Users can see what happened on the screen (see personal custom-made cinematic view). I need an option for the user to click the button and get a video on his smartphone. It can take minutes - no problem. Same as a user exporting video from a video editor.
@@andrewshock Ah, understood! Unfortunately you'll have to do some work to make something like that since Unity Recorder is editor-only. You'd have to basically take a screenshot every frame using ScreenCapture.CaptureScreenshot() and stitch them afterwards into a video. You can slow the game down as discussed by setting Time.captureFramerate to e.g. 60fps and there is a code example in the docs for making the screenshots docs.unity3d.com/ScriptReference/Time-captureDeltaTime.html But then you also need to deal with stitching them together using something like FFmpeg and capturing audio with the OnAudioFilterRead callback. The easier solution is to try out some of the assets on the asset store, most are paid but I saw some ones for free as well that might work. Maybe also take a look at some GitHub packages like these, they may be exactly what you want :D github.com/Spirit30/FFmpegUnityBind2 github.com/unity3d-jp/FrameCapturer
@@jamesdavis625 It should be able to record anything that you see in the game view, check that the sprites you're recording actually show up in that camera. If they're aren't, play around with the camera's layers, and make sure the sprites are properly in the camera's frustum.
@@The_True_Duck I was able to record them in Game View, but I can't seem to record sprites in an image sequence with an alpha in Game View, include alpha is greyed out
You have to first make sure you've set a valid location in your file system. But otherwise it will save automatically once the recording clip is done in the timeline window
Don't worry about it. Putting the component on a parent is just a recommendation, everything should work equally fine if you put it on an empty gameobject somewhere in the scene. :)
Nice video Duck! A question that I can't find the answer to is "how can I animate a crowd and cars in super high quality, baked with ambient occlusion for every frame. and light rays that bounce 3-5 times, all that high quality things, because My scene is all animated, I can render it in 5 hours as long as it's HQ i'd be happy" I can't find if it can be coded, if I'd have to set everything to static one frame out of 2 and then cull the odd frames? I dunno.
If you've got an animated scene and want to make it look better, you should just be able to set all those things in your render pipeline settings, camera, post processing volume, lights, etc. Off the top of my head I'm not sure if unity supports that many light bounces, either way I expect you will find it somewhere in the HDRP settings (which you'll want to use for your render if you want maximum photorealism (make a backup before switching!) )
I encountered this issue too. but i found out that one of the assets in my scene has some kind of error. i deleted the asset from the project and i can now see the Cinemachine Track.
You certainly can! In fact unity themselves made a demo short film (ruclips.net/video/iQZobAhgayA/видео.html). There are probably better suited programs like Blender for doing stuff like this, but if you're more comfortable with unity, there's certainly nothing stopping you!
@@The_True_Duck do you think this unity feature is comparable to software like adobe premiere or hitfilm express etc? or is it too slow compared to these software?
@@HassaanALal Premiere and other programs like it are dedicated to making videos, and will naturally have a better workflow when creating them. Unity is primarily dedicated to making games and therefore its needs don't completely overlap with the needs of video editing. In that regard unity's recorder package simply can't compare unless you have a very specific set of needs (rendering one of your games)
I dont understand why screen recording is faster than rendered recording.. I mean if you record both at 1080p they are going to have same results no? Amazing video, no such video is available on youtube on this so thank you.
Screen recording only manages to be real-time because it skips frames (you'll notice this as the occasional lag spike). This happens when your computer does not have the processing power to both run your game and store it as a recording within a 16.6ms window (assuming 60fps). On the other hand, using the recorder package guarantees that there will be no dropped frames, but by necessity this will take longer. Any time where the screen recording would simply use the last frame is a frame that the recorder package would take its time to render. You can actually see the difference in the video! Pressing the "," or "." keys will go back/advance the video by a frame: Looking at the rendered videos (e.g. 4:32) you will see that it updates every frame. Simply screen recording (e.g. 5:55) results in duplicate frames. TL;DR: They may have the same visual resolution, but the rendered one has a greater temporal resolution.
Unity Recorder is the biggest Crap ever! It is only good for still images but for video is a total trash tool. People asking forever developers from Unity to increase (or to add bit ratio compression) or another format like HEVC. Compression is so bad even on High-quality profiles. Only helps record into image format and uses external software (After Effects or o similar)
Quick tip, Unity Recorder is now called Recorder by it self in the package manager.
Thanks, Man!
THANK YOU, i couldnt find it at all in the Unity3d store
NICE BRO !!"!!
Hey one quick question how to let the gameplay scene automatically play after the cutscene can you do tutorial
@@ShakerDev So you could make a script like this that'll detect when a video ends and send the player to a scene, and have the scene start on the ending frame of the video.
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Video;
public class VideoPlayback : MonoBehaviour
{
public string nextSceneName = "JoeStar4446s Cool Scene";
private VideoPlayer videoPlayer;
private void Start()
{
videoPlayer = GetComponentInChildren();
videoPlayer.loopPointReached += OnVideoFinished;
}
private void OnVideoFinished(VideoPlayer player)
{
player.Stop();
// Script by Lua, please credit me lovely
SceneManager.LoadScene(nextSceneName);
}
}
Ah thank you for the straight forward tutorial under an hour 😆 No bull no other instructions mixed about. Very much appreciated
yap so many bullshit tutorials out there.
This is the single most greatest tutorial known to mankind
Love this sort of hand by hand tutorial😭...saved my stupid life!
Hi, 2:42, Inspector is color gray and not edit. Help me
Make sure you have the right objects selected: In the hierarchy, the object with the timeline component; and in the timeline window click on the recorder clip.
Also setting/unsetting the lock in both the timeline window and the inspector may help
I can't blend my cinemashot tracks. They just don't want to blend together, instead they swap places.
Edit: you have to activate "Mix Mode".
Best starter video on the topic. Thank you!
What I wanna do is play the game in game view and record it in scene view. Is his possible? Im making an RTS game where i need to give commands to the soldiers in the game view but i want them to be reocded from another anglle at high framerate.
@@HaykAmirbekyanTKD No problem :D
Just keep your camera needed for gameplay alone, and add a new camera for your cinematic angle.
In the recorder clip, in input, change the source from Game View to Targeted Camera, and camera to TaggedCamera. Then all you need to do is give your cinematic camera a unique tag and put that tag in the TaggedCamera field.
Doing it this way will let you play the game normally in the game view, but the output video file you get will be what your cinematic camera sees, not what you see. It will of course also have all the other benefits of guaranteed FPS and arbitrarily high resolution and all that.
Hope this helps :D
The produced video looked great. Thanks for the intro.
this is good really good, but how can i use this same method for recording or cinematics shot of charachter doing some animation too ??
@@aqsasardar Shouldn't be a problem :)
If you want pure gameplay clips, you can just remove all the cinemachine stuff and as long as the recorder is there in the timeline, it will record it all to your preferred quality when you enter play mode, and you should have full control in the game.
If you want hybrid control and cinematics, it'll work in exactly the same way. Keep what you want and control the player as normal, although you may need to disable some stuff like the first person camera you normally use, but it should be easy enough to get working :)
@@The_True_Duck Alright thanks mate.
Thank you fo this useful tutorial. Initially I thought it was so complicated with all those options but once your understand the logics the rest is fun.
Since We are now rendering scenes, i wonder If we can put Videos as planes, remove the green screen, and export them as VFX?
Yeah that is definitely possible, just record the scene and remove the background later in some video editing program and it will work fine :)
the main issue with this approach is that if you record while Unity is running, its gonna lag. Its better to export the game as a build and find a way to record the build. any tips?
@@HaykAmirbekyanTKD If you use Unity Recorder there will guaranteed be no lag in the video, unity will take as long as it needs on each frame to ensure the output video has the exact framerate and resolution you set. There will be no skipped or doubled frames.
That is of course not the case if you just screen record a build, which can have skipped or doubled frames, since your screen recorder is unable to tell your game to slow down.
Thank you for this video! Very helpful for a Unity beginner!
anyone knows how to get the animation from the unity game?
beautiful land! ty for the info and good explained!
Happy to be of help :D
The scene is a free asset on the asset store, there is a link in the description if you'd like to use it :)
It works, but for some reason, some of my tracks moved around every time I reopened the project, just a bit, but enough to through it all off, so I removed the recorder :/
Great tutorial! Any idea how to get alpha channel or render passes from this for compositing??
It seems there's currently no direct way to export with transparency, your options are either to export an image sequence of PNGs, which do have an option for alpha, and stitch them together. Or you could also take the green screen approach and just put a solid color in the background, and composite it out in post
@@The_True_Duck thanks will keep my fingers crossed for multipass rendering in future. I wonder if using culling masks could help to separate objects.
@@EugeneRamirezMapondera I'm not entirely sure what you mean by multipass rendering, but there should be nothing stopping you from creating multiple cameras and selecting the layers that they will see to the different layers you want. Then you should be able to hook a camera to each clip and record them all at once
Thanks, closer to what I'm looking for. I just want cutscenes of my gameplay from different scenes for a trailer for YT, plus I'm trying to create a cutscene for part of the game that shows other scenes. So hopefully I can record these scenes then edit them together in one timeline? Or use an external movie editor program then re-import the full cutscene and then add the audio etc.
I usually neglect the animation in my game, only use it when necessary, most is done in code if I can for the gameplay or interactions etc.
Thank you, though, getting hard to find exactly what I'm looking for, been weeks searching online. Lots of cutscene videos of one scene, but not multiple.
When I hit play to record it records nothing!
Hmm, have you made sure the recorder clip has a valid path in the output settings, and did you stretch it across the entire timeline? It's a little hard to help with so little information to go on; does the game slow down when you hit play?
@@The_True_Duck I figured it out. I set path to desktop but it still put it in the record folder. I found them. 😉
My quality looks so muddy compared to yours. same exct settings.
is there any chance to export predefined animated scene on user's mobile?
I'm not sure I understand what you mean, the animation you made with timeline itself will be played without problem on mobile once you trigger it.
If you're talking about exporting gameplay at runtime on mobile however, unity recorder won't work, as it was designed for editor use only, it slows the game down to be able to record everything without any lag spikes. You'd have to try something else like using the ScreenCapture class to take a screenshot every frame, or try one of the assets on the asset store instead.
If you just want to show your cutscene, timeline will work 👍
@@The_True_Duck I meant for instance: the user chooses some settings that can change a predefined animation routine. Users can see what happened on the screen (see personal custom-made cinematic view). I need an option for the user to click the button and get a video on his smartphone. It can take minutes - no problem. Same as a user exporting video from a video editor.
@@andrewshock Ah, understood! Unfortunately you'll have to do some work to make something like that since Unity Recorder is editor-only.
You'd have to basically take a screenshot every frame using ScreenCapture.CaptureScreenshot() and stitch them afterwards into a video. You can slow the game down as discussed by setting Time.captureFramerate to e.g. 60fps and there is a code example in the docs for making the screenshots docs.unity3d.com/ScriptReference/Time-captureDeltaTime.html
But then you also need to deal with stitching them together using something like FFmpeg and capturing audio with the OnAudioFilterRead callback.
The easier solution is to try out some of the assets on the asset store, most are paid but I saw some ones for free as well that might work. Maybe also take a look at some GitHub packages like these, they may be exactly what you want :D
github.com/Spirit30/FFmpegUnityBind2
github.com/unity3d-jp/FrameCapturer
@@The_True_Duck thank you!
How do you record sprites? Seems to ignore sprites in recording
@@jamesdavis625 It should be able to record anything that you see in the game view, check that the sprites you're recording actually show up in that camera. If they're aren't, play around with the camera's layers, and make sure the sprites are properly in the camera's frustum.
@@The_True_Duck I was able to record them in Game View, but I can't seem to record sprites in an image sequence with an alpha in Game View, include alpha is greyed out
After recording how it will save???
You have to first make sure you've set a valid location in your file system. But otherwise it will save automatically once the recording clip is done in the timeline window
Legend. Awesome tutorial!
thank you for the explain, it helps me a lot for prepare the scene demo of my game
just what I was looking for does it still work in 2024, plus I will be creating a lofi anime scene :)
@@mikwns3722 Yes it still works, there's a few small changes to the package, but you can still follow the tutorial :)
can u please guide me about my query regarding it ? i have mentioned it here in comments of this video.
Hi, I have a lot of prefabs so I can't put the item in hierarchy under one parent. Any advice? Thank you
Don't worry about it. Putting the component on a parent is just a recommendation, everything should work equally fine if you put it on an empty gameobject somewhere in the scene. :)
Nice video Duck! A question that I can't find the answer to is "how can I animate a crowd and cars in super high quality, baked with ambient occlusion for every frame. and light rays that bounce 3-5 times, all that high quality things, because My scene is all animated, I can render it in 5 hours as long as it's HQ i'd be happy" I can't find if it can be coded, if I'd have to set everything to static one frame out of 2 and then cull the odd frames? I dunno.
If you've got an animated scene and want to make it look better, you should just be able to set all those things in your render pipeline settings, camera, post processing volume, lights, etc. Off the top of my head I'm not sure if unity supports that many light bounces, either way I expect you will find it somewhere in the HDRP settings (which you'll want to use for your render if you want maximum photorealism (make a backup before switching!) )
I double checked, yes you can absolutely set the light bounces that high in the lighting window
i have no option to add recorder track?
you just need to enable unity recorder addon from package maanager.
This is awesome. Thank you!!!!
Theres no such thing as Cinamachine Shot when I right-click. Nor is there a recorder track.
Did you install both their packages in the package manager? (Cinemachine and Recorder)
I encountered this issue too. but i found out that one of the assets in my scene has some kind of error. i deleted the asset from the project and i can now see the Cinemachine Track.
Can I use unity to make short movie ?
You certainly can! In fact unity themselves made a demo short film (ruclips.net/video/iQZobAhgayA/видео.html).
There are probably better suited programs like Blender for doing stuff like this, but if you're more comfortable with unity, there's certainly nothing stopping you!
@@The_True_Duck do you think this unity feature is comparable to software like adobe premiere or hitfilm express etc? or is it too slow compared to these software?
@@HassaanALal Premiere and other programs like it are dedicated to making videos, and will naturally have a better workflow when creating them. Unity is primarily dedicated to making games and therefore its needs don't completely overlap with the needs of video editing. In that regard unity's recorder package simply can't compare unless you have a very specific set of needs (rendering one of your games)
Thanks a lot, very easy to follow.
I dont understand why screen recording is faster than rendered recording.. I mean if you record both at 1080p they are going to have same results no?
Amazing video, no such video is available on youtube on this so thank you.
Screen recording only manages to be real-time because it skips frames (you'll notice this as the occasional lag spike). This happens when your computer does not have the processing power to both run your game and store it as a recording within a 16.6ms window (assuming 60fps). On the other hand, using the recorder package guarantees that there will be no dropped frames, but by necessity this will take longer. Any time where the screen recording would simply use the last frame is a frame that the recorder package would take its time to render.
You can actually see the difference in the video! Pressing the "," or "." keys will go back/advance the video by a frame:
Looking at the rendered videos (e.g. 4:32) you will see that it updates every frame. Simply screen recording (e.g. 5:55) results in duplicate frames.
TL;DR: They may have the same visual resolution, but the rendered one has a greater temporal resolution.
@@The_True_Duck damn, thank you. I didnt know . , keys, your explanation is fabulous about the difference in these rendering techs.
Superb video.
wow amazing feature
awesome tutorial
Thanks for the tip dude.
will just say THANKS!
Thanks for the tip!
valeu cara :)
OR... you could just use a dolly track and a lookAt point, and create any path you want.. much easier than this..
bro this did not help
Unity Recorder is the biggest Crap ever! It is only good for still images but for video is a total trash tool. People asking forever developers from Unity to increase (or to add bit ratio compression) or another format like HEVC. Compression is so bad even on High-quality profiles. Only helps record into image format and uses external software (After Effects or o similar)
.
Why do people actually buy macs? lmao
Don't worry, my computer has since died and my experience with windows was so bad, I switched to Linux XD
bullshit at all