A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by AndrewRH, Jan 24, 2012.
I need to record both sources, 'Unity' and 'stereo mix' at the same time. Any solutions?
I need to record both sources, Unity and 'Stereo Mix' at the same time. Any solutions? Thanks
Sorry for the late reply!
Yes I think you can do this with option2. If you create a second camera that renders your scene AND the webcam then set AVPro Movie Capture to capture just this invisible camera, it should work. This of course means rendering your scene twice which may not be ideal if you scene is very heavy. In which case you may be able to render your scene to a RenderTexture then simply have a 2nd camera that just displays that RenderTexture+the webcam overlay which MovieCapture is set to capture by being in camera capture mode. Your main camera then would render the RenderTexture to the screen. This should be very optimal.
That's very strange. Using the UI it basicaly just calls StartCapture as well..Are you capturing audio as well? It may be related to audio capture, if ti has to spawn the audio capture component dynmically then this could cause some sync delay...
That's very odd. we've had some reports of it not capture sometimes outside of the editor. We'll definitely investigate this. My hunch is that it's related to multi-threaded rendering, so you could try to disable this (it's in the Player Settings, you need to enable Debug view in the Inspector and then toggle MTRendering).
Most Unity shader don't write a useful value into the alpha channel, they just use their alpha channel to blend into the backbuffer so in general to get an alpha buffer out that is useful for compositing you would need to modify the shaders to write their alpha values out correctly. We'll try to provide a demo of this in the next update.
Yes, if you modify the scripts you could do this indeed. I think one of the samples shows you how to manually control a recording so this should be all that you need to start with.
Thanks for reporting this error, we'll fix this in the next update. If you're forcing an audio device index though, you shouldn't need to have the AVProUnityAudioCapture in your scene as this is what captures audio from Unity and not from an audio device. We'll fix this issue though. Thanks,
Not out of the box. It could be modified to do so though. We'll try to provide an example / component for this in the next update. Thanks,
You should be able to capture alpha from the editor window. In the "Visual" tab there is an option "Support Alpha". Which codec were you capturing with? Were you doing real-time or off-line capture? Were you capturing audio at all? Thanks,
1) WebCamTexture isn't that great....that's why we build our plugin AVPro Live Camera - it better supports higher resolution cameras.. you would have to ask Unity why WebCamTexture doesn't perform well at 1080p...
2) Which component were you using to capture? I would recommend either AVProMovieCaptureFromScene or AVProMovieCaptureFromCamera. The other option AVProMovieCaptureFromTexture is actually very slow... this is something we're going to be fixing in the upcomign release.
So AVProMovieCaptureFromTexture is actually VERY slow and I wouldn't recommend it for real-time captures. Instead you should use one of the other two components as they actually capture directly from the GPU and are very very fast and don't generate Mono garbage as AVProMovieCaptureFromTexture does. We are going to fix AVProMovieCaptureFromTexture in the next update of the plugin so that this is no longer an issue.
Thanks very much for reporting the crash and for these great reproduction steps!! We're currently looking at AVPro Movie Capture so we'll be addressing this issue soon.
I think what he means is Stereo Mix should contain both the Unity audio and the microphone audio if you've set things up correctly. We actually outline these steps in the PDF documentation for the plugin. In Windows control panel you can set it to "listen" to the microphone so that the recording audio will play through the speakers. If you have a Stereo Mix recording source (it may be hidden) then you can enable it and recording from it will have both audio sources.
What is the limiter on the captured size and framerate of the final movie output. Is it tied to CPU speed/Memory or GPU or both?
Basically to do something at say 1920x1080 and 30-60fps to get it silky smooth what would should be the rigs focus? Right now getting stutters and its just not smooth. 2D game runs fine, 200 + fps very smooth until start recording then i see it degrade both in editor and recorded video. Anything else I should look at. Thanks.
When the capture is running it can slow down the game to get a smoother capture result. You can disable these options if you want on the component (they're both under the Performance heading). It very much depends on the codec you're using to encode the video. If you're using uncompressed, then probably your disk writing speed will be the bottleneck. If you're using a codec then it will likely be the bottleneck. Picking the right codec and tuning it's settings correctly is key. We've had great results with x264 and Lagarith codecs and there is more information about these in the PDF manual. Of course we're always striving to improve performance. If you have a specific case that isn't performing well, you can email us email@example.com with your scene so we can try to improve things.
AV Pro capture "Movie capture demo.scene" seems to be captures full area of monitor, my question "Possible to capture only specific Area like '0, 0, 200, 120' on AV Pro? "
No this isn't possible currently. You could though render that region with another camera and then use the FromCamera component to just grab what that camera can see. We plan to add the area support in the future. Thanks,
I tried to reduce the recording bitrate in x264vfw - h.264/mpeg-4 avc codec
It works if I configure in window editor and record in editor.
but doesn't work in game (Movie Capture From Caemra script).
How to solve the problem?
I tried to install virtualtub and in video->compression, I changed the setting, but the setting doesn't apply to my recording in game, do I need to somehow apply the change?
mp4 cannot get audio anyhow, use uncompressed audio (-1) will crash.
Are you writing to MP4 or AVI file?
The reason the recorder is working different in the game/build is because of 32/64-bit differences. Your Unity is probably 64-bit, but perhpas you're making a 32-bit build. The codec has separate configuration for 32-bit and 64-bit, so if you're using both then you need to configure both.
I hope that helps solve you issues.
I purchased your product. It is very useful!!
I tried to capture 360 degree video.
Most of the functions work well, but the orientation of the camera object looks different from the capturing direction. It seems that the movie is always taken with (0,0,0) rotation.
Is there any way to turn around when capturing a 360 degree video?
I look forward to hearing your response.
Yes, we are about to release a new update that includes support for camera rotation while in 360 degree mode.
AVPro Movie Capture version 2.96 has just been released!
You can find the updated version on the Asset Store and the free trial version / demos on our website.
360 surround capture can now render uGUI elements when canvas is set to camera or world modes.
360 surround capture now supports camera rotation
Fixed 360 surround capture orientation, as it was flipped horizontally
Improved motion blur support in 360 camera capture
Added Media Foundation capture option to Editor window
UI / Workflow
Editor window UI improvements, including context hiding and usage warnings
Fixed FromCamera capture bug where build captures would render black to the screen
Fixed bug where editor window would unnecessarily spawn AudioCapture component
Fixed bug where audio capture component would be accessed when it shouldn’t
Fixed crash bug in webcam demo
I recently bought this plugin for an application I am working on. It needs to record a webcam (video and audio) feed and save the recording to a file (MP4 would be preferred, but I'm ok with AVI). I'm using the Capture from Camera component, while displaying the web cam feed using a WebCamTexture (added to a RawImage component on a canvas). I then use the video codec "x264vfw" and audio codec "uncompressed" and set the audio source to be the camera's microphone, and I save out to an AVI file. However, the audio and the video are not synced. I have also tried numerous other video codecs, including the Largarith Lossless Codec, and some others that were listed (DV Video Encoder, MJEP Compressor, etc), and different audio codecs that were listed (IMA ADPCM, PCM, Microsoft ADPCM, MPEG Layer-3) and they all have the sync issue. I also tried saving to an MP4 file using the same codecs (x264vfw and "uncompressed" for audio), but I get a "Failed to create recorder" error. I then tried the same settings and saving to an MP4 file with "Use Media Foundation H264" option checked, but the recording lags so I can't tell if the audio is synced or not (turning off audio recording fixes the lag issue, but doesn't solve my problem since I need audio).
Any help would be greatly appreciated, thank you.
I tried it, but to no avail. I didn't have much time to test these past few months, and I also forgot to say that I am using another C++ DLL that has access to the GPU buffer. I am a bit familiar with the concurrent stuff happening inside the GPU, but I don't see why it would work in the Editor and not outside. I will try using the plugin without the other C++ DLL and report my results here.
EDIT : Removed my other C++ DLL, same result. In a blank project, the plugin works, so the issue reasonably comes from my code, but eh, does not mean I know where or why ^^
EDIT EDIT : Well... After a full clean of my computer, it's working now, so I assume it was an issue on my part, but I won't be able to tell you what it was. Still, I still have a few issues, but now it's definitely working, so the rest can wait. Thank you for your time though
Could the plugin capture the mouse's motion?
Glad you found the solution at least
Yes, you would need to use the "FromScene" capture method, and then use the script attached to render the mouse cursor. We will include this feature in the next update to the plugin.
I want to use the DLL x264 development and DLL Lav development,What should I do?
Do you have this aspect?
I'm not 100% sure what you're asking, but if you install any codec (even a development version) then it should get picked up by the plugin. You'll have to register the DLL / AX file in the standard DirectShow way using regsvr32.exe if there isn't an installed. I don't think the Lav DLL will work well with AVPro Movie Capture because it contains multiple codecs and doesn't let you set which one to use via the GUI...
Is there some developer version of DLL x264 that i can use some of functions in it to implement the functions which i do with x264.exe?
I've got a couple of questions on this package:
My Unity project includes many AVPro Video players, the videos are h264 and I'm using the Windows Media Foundation player. If I use AVPro Movie Capture to record my scenes, will the videos automatically play frame by frame or is there an additional step required to get them to do so?
I'm looking into exporting 360 equirectangular video (for Gear VR playback), but I can't tell if this plugin can record stereo video or if it's only one eye.
yup, there is x264vfw which you can download and install. We cover this in the PDF documentation including how to set it up. It has a section where you can enter parameters, so you should be able to match the x264.exe options. -Thanks,
1) It depends which codec you use to record the videos with. If it is something like Lagarith - then no it will not, because Media Foudnation has no support for Lagarith codec, so you would have to switch the API to DirectShow. If you recording using the x264 encoder or the Media Foundation MP4 option then it will play. If you can let me know which codec you're using I can tell you whether it'll be supported (or you can just test it . I'm not sure what you mean frame-by-frame - it sounds like you want to encode the videos in a way so that you can nicely scrub through them. This should be possible as long as your videos are encoded as only key-frames and don't contain a lot of P or B frames. This can usually be set in the encoder settings. For example you can set this in the x264 encoder settings. Again let me know more about your case so I can give a better answer because it depends very much on the codec used.
2) AVPro Movie Capture does support 360 equirectangular rendering, but it doesn't support stereo. This is a feature we're looking to add soon though.
I've had some success with your awesome plugin so far. I am having a problem recording an mp4 video in real time.I am using the camera capture script you provided.
When I stop capturing the game hangs/stalls for about 15 seconds before continuing. The video looks great, but what can be causing the long hang? When I have uncompressed audio enabled the app hangs. When I have no audio the capture becomes very choppy. Any tips? Thank you @AndrewRH
Thanks for the quick response, Andrew! Some follow up questions:
1. My assumption is that AVPro Movie Capture will slow down the playback rate of my Unity scene, meaning that updates need to happen on a frame-based time delta (vs time-based). The scenes I want to record include videos playing back on quads, and my question was specifically about forcing these videos to keep time sync with the rest of the scene. Do I need to do something extra to make sure that, for example, my video is on frame 67 when the rest of the Unity animation is on frame 67? Does the choice of encoder for these playing back videos really affect the capture, isn't it all just pixels once it's rendered through the camera? To answer your question, all my videos are encoded in H.264, and I'm just using the default value in Adobe Media Encoder for "Key Frame Distance". Should I change that to 1?
2. Do you have an ETA for when stereo rendering will be available?
I think this pause is because the video capture is queueing up frames to compress and when you stop the capture it needs to process all of the remaining frames. We also have an option to skip these pending frames (a boolean parameter in the StopCapture() method) but this may cut off the end of your video capture session. I guess if you have a faster PC or capturing lower resolution it should be able to keep up with the capture better and therefore have a smaller queue to process at the end of the capture.
15 seconds though does sound like a very long time.
I have a few questions for you:
1) Are you capturing to mp4 using the x264vfw codec, or the new experimental Media Foundation mp4 option?
2) What resolution and frame-rate are you capturing at?
3) What is your CPU spec and HDD/SSD type?
I'll do some tests with these different audio settings. Thanks,
1) Ahh, sorry I misunderstood your question. If you are capturing in real-time then the video playback will be in real-time too, so as long as the video playback is fast, it should capture all of the frames just fine. Having a video that is optimised for fast playback will definitely help though, so like in H.264 encoding there are many optimisations you can do (such as disabling CABAC, disabling B-frames, having a smaller GOP - key frame distance etc). Certainly if you're using the offline capture option then Unity will not run in real-time and your videos then really might need to have a small key-frame distance to make seeking fast. IF you're using AVPro Video there is a special option in the Global Settings section which allows the video player to slow down or speed up based on the non-real-time capture time that is used during offline video capture. In order for this to happen quickly (so your captures don't take ages) having the video optimised for playback will definitely help.
2) We hope to have a version with this feature in about a week.
1) Ok thanks, I'm assuming the special option you're talking about is "TimeScale Support"? I can re-export the videos if necessary, what is the ideal format and options you would suggest for my playback videos?
2) That's great news, I'll keep an eye out for this.
hey thanks for quick reply,
I tried the StopCapture(true) with no noticeable change. There actually was quite a drop in freeze time when reducing resolution from 1440p, to 710x411 in editor from 15 seconds to 5 seconds. So there is still freezing just shorter.
1. Yes I am using mp4 + x264vfw with recommended settings from docs.
2. Recording at 2560 x 1440, I set the downscale to half(does this matter much?)
3. CPU Intel core i7-3820, 24gb ram, NVIDIA Geforce GTX 980.
Thanks for taking the time.
EDIT: Oh forgot HD type. It is HDD
Are you able to assist me with the issue I posted about in #426 of this thread?
Hi, I've literally had the reply in "draft" for ages and didn't hit send. I'll post it now
To save to an MP4 file when using the x264vfw encoder you need to install a 3rd party MP4 handler. In the documentatoin we describe how to install GDCL-MP4 filter. This is probably your best bet as H.264 works better in an MP4 container as AVI files don't support all of the features.
The Media Foundation H.264 option currently doesn't support recording from a microphone. We aim to address this in the next update.
I hope that using the GDCL-MPEG4 filter helps to solve your issue.
Our of interest - which webcam are you using? I'm testing here with codecs like Lagarith and not having any issues with audio sync...
Hmmm I already installed the GDCL-MP4 filter. I did it again just to make sure, and now Unity crashes when I try to record a video using the following settings - Realtime, Video codec: x264vfw - H.264/MPEG-4 AVC codec, Audio: Using Audio Source Desktop Microphone (Studio-Microsoft LifeCam) and using Audio Codec MPEG Layer - 3. File name is set to MovieCapture.mp4. If I use Audio Codec Uncompressed it records but the audio is still not synced. I'm using a Microsoft LifeCam webcam.
Also make sure that you're configuring both the 32-bit and 64-bit versions of x264vfw and installing 32-bit and 64-bit GDCL MPEG4 filters. Thanks,
I've done the configuration for the 64 bit version of x264vfw, I'm not sure how to change it so that I'm setting the 32 bit version. I'm running this in the Unity editor so it should be using the 64 bit regardless.
This is what I ran to install the GDCL MPEG4 filters:
and I got a "DLLRegisterServer in <path> succeeded" for each. If I switch to using Unity scene as the audio source, it seems to run for a bit but then Unity freezes and crashes.
Edit: If it helps, I am using Win 10 and Unity 5.5.2.
If I capture offline, will it add the audio also? Example, recording I might get 10 fps, will it still add the audio in sync with the video?
No, offline capture doesn't support any audio.