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.
What camera would you recommend? Maybe the issue is my camera.
Logitech C920 is a great webcam, and also the new Brio is very cool. But I don't think the issue is your camera. We found some isue in the code. We're about to release a new version of the plugin which has improved AV sync for webcam recording. We're trying to get the new version released today.
Awesome, thanks for the update.
AVPro Movie Capture version 2.98 has just been released!
You can find the updated version on the Asset Store and the free trial version / demos on our website.
Texture capture component is now much faster
Motion blur capture now works with the Surround 360 and Texture capture components
Added option to include mouse cursor in the capture
Texture capture demo improved
Increased capture resolution limit from 8K to 16K
Fixed audio delay when capturing webcam and microphone
Removed dependency on Media Foundation so older versions of Windows are supported again
Various fixes made to the motion blur component
I'm using the capture form camera feature. When I try to capture an MP4 using the experimental h264 I get a memory leak. The memory usage goes up with every recording and is not released. If you look in task manager you see unity3D memory start to rise. It stops when you stop recording and when you record again it goes up again. Going to different scenes does not release it, using GC.Collect or resources unload also does not lower the memory. Unity ends up crashing once it gets to over 3GB. A built application also has an issues where the memory usage goes up quickly.
Is there a codec you can recommend that is similar to h264 capture a video that is widely used and can be played back on mobile devices?
To replicate the issues create a blank project, import the package and run the "CameraCatupreDemo" and select Experimental h264 option and pick the "x264vfw - H.264/MPEG-4 AVC codec" set extension to mp4.
Hi, thanks for reporting the issue. We'll look into it and get back to you. Thanks,
Unfortunately the update didn't fix the issue. It seems slightly better though - before the audio would play probably a half second before the video, but now it's more like a quarter of second.
I took a picture of the Unity settings and component setup I am using, which I can send to you if you want or think it would help. Thanks!
Edit: Actually I got one of the Logitech 920 cameras that you suggested and it's working much better (about as good as one can expect I think). The camera I was using was a Microsoft LifeCam, so that may have been the problem because it's a cheap camera...
Hi, I bought this asset for using namedpipe movie streaming.
Setup maybe ok(write to avi is ok) x264vfw installed and config maybe ok(superfast,virtualDub Hack ok etc)
But AVProMovieCapture From Scene edit below .then, start recording ...Unity editor freeze and no response.
What can i configure to use named pipe?
(Unity5.5.1p2 + AVPro Movie Capture 2.98 )(I changed project settings .net 2.0 subset →.net 2.0 )
Okay glad to hear its working better! Is there still an issue? Let me know if so...thanks,
Why do you want to use named pipe?
Did you follow the instructions in the PDF docs (page 25 in the FAQ) for how to use ffmpeg with named pipes?
I want to use named pipe for connect ffmpeg (rtp stream).
and I already read page25.
Problem is editor freeze when starting capture.
I change OutputMode to “Named Pipe". but can't start capture.
It should work. Unity freezes because it's waiting for the named pipe to start, so once you start the capture in Unity you need to run the ffmpeg command in the documentation. It should then begin recording. Try doing this with the MovieCaptureDemo scene.
Note that the windows size has to be the same as the resolution in the ffmpeg command. This is currently an experimental feature but we aim to improve it in the future. Let us know how it goes.
AVPro Movie Capture version 2.99 has just been released!
You can find the updated version on the Asset Store and the free trial version / demos on our website.
Added stereo rendering support to the 360 camera capture component. 360 captures can now be rendered in mono, stereo top-bottom or stereo left-right
Fixed a memory leak in the Media Foundation recorder
Here are some screenshots of the new UI to enable stereo mode and a top-bottom 360 video captured with motion blur:
This bug has been fixed in the latest version (2.99), thanks for reporting it!
I'm using AVProMovieCapture and I have a section of the app that starts recording the screen (camera record) and it seems after waiting idle for a bit (3 mins and up), then going to the section that records and starting file capture (through script), there is a huge performance spike. I'm not sure if it matters, but I am using avprolivecamera and avprovideo as well. on windows.
I did a profile of this and it spent about 200 ms on AVProMovieCaptureBase.Update(), then below that -> (I'll just link to image of profiler)
Is this just down to free memory in general? If I go right to recording part of the app after hitting play, it starts up almost immediately.
We are trying to sync up avprovideo audio with what we record with avpromoviecapture. As you know, performance will inevitably throw it off. Let me know what you think, thanks!
So something worrying in your profiler is that Canvas.RenderSubBatch has 97000 calls. This would indicate that your canvas has a lot of elements in it?
Starting a new recording is fail expensive, so I wouldn't be surprised by a spike. What you could do is start the capture earlier and then just have it paused and unpause it when its needed.
The spike could also be related to a garbage collection. Try doing your own GC before starting the capture to see if that moves the spike.
If you just need to capture the whole screen, you can use the FromScene capture component. It is a bit faster than FromCamera because it just captured the final output. FromCamera renders the scene a second time for the capture.
Make sure you're using either 2.98 or 2.99 version of the plugin for best performance. For fast capturing I would recommend x264vfw configured for "veryfast" profile.
Hope that helps a bit. Let me know how it goes.
Thank you for the quick fix runs great
I am working with AV PRO MC 2.99 and Unity 5.6.0f3 and am seeking to capture 360. I am using the demo scene SurroundCaptureDemo with Lagarith(output:2048x1024,@30, both Null Frames and Use MultiThreaded enabled), Capture Audio enabled with Source: Unity, Codec: Uncompressed. It all works well on the video capture, but I cannot get the audio captured for the Source Type: Camera 360. Interestingly, when I set the source type to either Scene or Camera, the audio and video are both recorded. The moment I switch the Source Type to Camera 360, all I can record is a silent movie.
Yes it is due to a bug in the script! We will fix it in the next release. For you now you change it yourself.
In AVProMovieCaptureFromCamera360.cs, change this code:
if (_audioCapture && _audioDeviceIndex < 0 && !_noAudio && _isRealTime)
uint bufferLength = (uint)_audioCapture.BufferLength;
if (bufferLength > 0)
AVProMovieCapturePlugin.EncodeAudio(_handle, _audioCapture.BufferPtr, bufferLength);
int audioDataLength = 0;
System.IntPtr audioDataPtr = _audioCapture.ReadData(out audioDataLength);
if (audioDataLength > 0)
AVProMovieCapturePlugin.EncodeAudio(_handle, audioDataPtr, (uint)audioDataLength);
I don't think this component is fast enough for real-time capture though without a very powerful system It renders the scene multiple timages to generate the cubemap 360 video so it's pretty heavy!
Good luck. Thanks,
Thanks for your quick responses Andrew. I'm pretty satisfied with the recording with the Logitech camera. I can't say why the Microsoft LifeCam camera doesn't work as well, but it could be a driver issue. The only thing is now I have to test the recording using a "keyer" system for a green screen capture... one step at a time I suppose.
The next phase is to play these videos back in Unity, and I'm using your AVPro Video plugin. It plays well, the only problem I've noticed is that I can't scrub the playback (or seek in general). When I do, the video feed looks like it becomes corrupted. At first I thought it was the AVPro Video plugin causing the issue, but when I scrubbed in VLC the same thing happened, so it's apparently an issue with the video encoding.
I've been messing around with it, and I tried using the "Use Media Foundation H264" option. The only problem is that it lags terribly when recording from the microphone. If I set the source to "none" or "Unity", it works really well, and produces videos that can be scrubbed correctly in VLC and in your AVPro Video plugin.
The other thing I've noticed recently (not sure when it started because I wasn't using the option), but if I have the video codec as x264vfw and Unity as the audio source without "Use Media Foundation H264" selected, Unity will freeze after about 5 seconds. It doesn't seem to matter what the audio codec is, though uncompressed and MPEG-3 both do it. This isn't a huge problem because using the "Use Media Foundation" option fixes it, and it doesn't seem to affect other video codecs (switching to Lagarith fixes the issue as well).
Since I'm not too worried about scrubbing/seeking, it's not a huge deal that it doesn't work right, but might be something you want to put on your radar. I saw you have a "Version3.x - your suggestion here" and I would love to see "embed mp4 container support" to make that easier. Thanks for everything!
Seems to work fine. Thank you very much!
If you're having these issure with scrubbing, it's due to there being not enough keyframes. I'm not sure which video codec you used before using the "Media Foundation H.264" option, but if say you were using x264 you can usually specify the keyframe rate by adding "--keyint 30" to the optional options in the codec setup, to force a key-frame rate of every 30 frames.
We plan to expose this and other codec options in the future.
Thanks for your suggestions, I will add them to the list right now
That did the trick. Thanks for all your help!
I want to have mobile camera preview in unity, a small square on top of the screen in my unity scene. Now, I want to record video from mobile device camera with audio enabled and playback after recording. Is this possible with this plugin ?
Yes, the recording is possible. We have a script which can capture from a specific camera. AVPro Movie Capture is Windows only though, and it doesn't play back video - for that you'd need to either use Unity 5.6's video player or our own AVPro Video plugin.
Feel free to download the free trial version of AVPro Movie Capture from our website and give it a try.
I would like to use the trial version of Avpro Movie Capture before buying it (I am on Unity 5.5.2f1) and I have Dll not found exceptions. I did read a little bit of this forum post and saw that I needed to change manually each plugin to the correct architecture via the editor (x86 or x86_64) which I did but nothing changed.
Actually it tells me that I need to place the plugins folder on the root of my project but it's already here. (I made an empty project just to test the plugin).
Any infos on that ?
Hi, which platform are you running on? AVPro Movie Capture only supports Windows desktop.
Also, which version of the plugin are you using? I presume the latest since you just downloaded it?
Yes I just downloaded it so it's the last one.
I am on windows 10 64 bits.
If this can help, my project looks like this :
That's strange - it should work... And can I see the plugin inspector screenshots for those 2 DLL files?
Error messages :
Hmm, do you perhaps have one of the K or N editions of Windows? These don't ship with any media components and require a separate download from Microsoft. Eg:
another thing you could try - what happens if you make an EXE build and then try to run that?
Oh yes it was the windows pack problem, seems to be working fine now. Thanks a lot!
One last question sorry to bother you but is it possible to export as a sequence of png in the full version? I can't find the information
The full version is the same as the trial version, just without the watermark. Currently there is no support to export as a PNG or any other image sequence. This is something we plan to add soon though.
Still having this issue when waiting a while before capturing, I have 3 canvases and 3 cameras, I don't really have a ton of UI elements to be honest.
But yeah when I wait any amount of time over 30 seconds, I get a huge spike before starting capture. I have tried starting capture right in the beginning, then pausing, and resuming when I need it. This still gives me a similar spike.
I am using avpromoviecapture to capture audio and video from avprodecklink (sorry I've been hopping threads on you guys, lol) Whenever I get this performance spike, the output video's audio sync is way off. As in, I open the video, the audio starts but the picture is still black, then after a few seconds you see the video start to play. Is there anyway to wait on this spike if it's unavoidable?
Let me know if you have any thoughts I'm going to try running some tests, also, are there any build/quality settings that should be off/on when using avpromoviecapture?
I can't think of any immediate solutions, so next some questions:
Which component are you using for the capture? FromScene, FromCamera, or FromTexture?
Which codec are you using? Which file extension?
If you try capturing without audio does that make a difference?
If you try another codec (eg uncompressed, or even the media foundation codec) does it make any difference?
Have you tried to eliminate elements to find the cause? Such as, you could try the same capture but with a blank project to see if you still get the spike... Or you could remove the DeckLink components to see if that is the cause.. Divide and conquer style... I think this information would help a lot.
I'm not sure what the cause is but hopefully if you can answer these questions we can get a better idea and hopefully a solution.
Using FromCamera for the capture, using lagarith lossless codec (using dropfolders/handbrake to encode afterwards), file comes out of avpromoviecapture as .avi. Will try capturing without audio, will also try x264.
I am in the process of eliminating elements right now and trying to really find the cause. I tried so far with a project that had 3 canvases, 3 cameras, avpromoviecapture from camera, and that's it. So far no spike.Will keep testing, thanks.
I think I've cracked the case!
The issue was that I had the recording camera set to display 3 as we are using multi-display. We aren't actually displaying this on a monitor any longer, so I set it back to display 1.
I turned everything in my scene off except for the recording camera, a canvas, and a script to trigger startcapture().
My procedure was to wait 3 minutes, then start capture with the follow parameters:
With the camera still set to display 3, it made a crazy amount of draw calls on the Canvas.rendersubbatch
With the same set up, but camera set to display 1, the recording starts with no huge performance spike.
Thanks for the help, the audio sync seems to be a ton better with this as well in build. Hopefully that gives you guys enough information to investigate if you want.
Thanks that's interesting - we're never tried to capture from Display 2 or 3 before...We'll add it to the list to investigate
Glad that it's working nicely now!
I've ran into a few video and audio recording problems when saving to .mp4 in my project and I replicated the same issues in the AVProMovieCapture-64 demo:
(Using the ""x264vfw - H.264/MPEG-4 AVC" video codec)
Audio Codec set to "uncompressed" causes a crash.
Steps to recreate:
-Save the file extension to .mp4.
-Leave Audio Codec default as "uncompressed"
Result: The .exe will crash after a few seconds.
Audio Codec set to "MPEG Layer-3" causes no capture.
Steps to recreate:
-Save the file extension to .mp4
-Set Audio Codec to "MPEG Layer-3"
Result: A message saying a file was written. However no recording actually happens.
I was following .mp4 recommendations in the included "AVProMovieCapture-UserManual" to use a MPEG Layer-3 audio codec. However, this doesn't appear to work.
However, as a work around, I was able to set the audio codec as "IMA ADPCM" and .mp4s are now recorded with video and audio in both the demo project and my own project.
Just wanted to give you a heads up and maybe consider updating the user manual. Thanks!
I'm trying to play a movie with the AVPro Plugin on four monitors (4 x 1920x1080). The movie plays well but with micro-shuttering!
The scene is very light, only:
- 1 Raw Image in a Canvas to display the video + 1 Display UGUI Script
- 1 Media Player
- 4 Cameras watching the same Raw Image
Video framerate: 25 img per second
Duration: max 30 seconds
How can I play my movie without micro-shuttering? What do I do wrong? Is it possible to have playback as smooth as in a common video player (Windows Media Player, VLC... for example)?
Okay, so first thing I recommend is to have your video encoded at 30fps. This is because it will sync up better with the monitors 60hz refresh rate.
The playback should then be better, but it won't be as good as other Media Players because they synchronise frame presentation with the vertical sync of the monitor and also do frame blending to account for frame rate mismatches (eg playing 25fps video on 60hz monitor). We're actually working on a feature right now to improve this situation.
Also I think you posted this to the wrong forum. This forum is for AVPro Movie Capture - a plugin that records Unity into video files. For AVPro Video use the forum here:
Thanks, we'll update the docs We are bringing some better codec support soon. Also - have you tried the new Media Foundation option? It will record to MP4 with AAC audio. Thanks,
I've been looking for an asset to capture stereo 360 video of various VR projects within Unity, and this seemed like a good bet. Unfortunately, the stereo 360 capture included in your trial version doesn't seem to produce usable output.
The stereo videos recorded by AVPro Movie Capture have serious projection issues. The stereo effect is only correct from two perspectives; at all other angles, objects are jarringly out of position from eye to eye.
From taking a peek at your code, it looks like you're just taking two normal 360 images at a fixed distance apart and using that as your stereo picture. If so, that technique isn't sufficient to produce a stereo effect at all angles: see this paper from Google.
Is this issue resolved in the full version? I'd like to use your asset, since it performs well and has a good interface, but this is kind of a deal breaker.
Glad to hear that you like our plugin. Yes the stereo capture is a new option, only just introduced. We use parallel eyes for rendering. We had realised that there were some more correct methods (such as off-center projection and ODS) but we haven't implemented them yet. The ODS approach looks good, but it also looks like quite an expensive operation (tons of rendering!). It looks like a good option to add though for accuracy so we will look into this. The trial and full version are the same except for the watermark. I'm happy to work with you to develop this feature.
Thanks for your response. It's too bad about the stereo capture; I would encourage your team to work on this, since right now there doesn't seem to be any asset on the store capable of doing it.
As part of a workaround, I've been trying to capture footage from multiple camera perspectives at once. I've been having issues with this, also: when I start multiple AVProMovieCaptureFromCamera components recording to different filenames, I'm finding that all of the cameras just dump their frames into a single file and leave the others empty. That single file then flashes between the different camera perspectives.
Based on your changelogs, it seems like multiple camera perspectives should be supported. Am I just doing it wrong?
Edit: Also, trying to record a single camera at resolution above 4096x2048 results in a "Failed to create recorder" error.
Yes currently only a single capture at a time is supported. We're working on fixing up the multiple capture instance support and it should be ready in the next version.
I suspect that it is a limitation of the codec. If you're capturing to H.264 for example it is limited to 4096x4096 by the specification. In theory if you select another codec (or even uncompressed) then it should work at such a high resolution. This is definitely a feature we want to work well so we will do some more testing here for the next release.
Great package, but I have some fundametal issues.
We're using deferred in out project, but tryed forward too.
post effects turn off doesn't help.
post effects we use: HBAO, Post-Process Stack
- Deferred video is white, except transparent objects
- In Forward Skinned Mesh Renderer have strange position-artefacts
We wanna buy package, but until there's this problems, we of course can't.
pictures by order, left-to-right: Editor (deferred), Video (deferred), Video (forward)
Which version of Unity are you using?
I did some tests with deferred and skinned mesh, but it captured just fine.
I then tried to use MSAA with deferred and I got some white parts rendering. So I think if you disable anti-aliasing by MSAA then it should capture correctly.
We'll make a change to the plugin to not allow MSAA when capturing from deferred so that the captures work correctly. I'm not sure if this will solve the skinned mesh issue - I wasn't able to replicate this.
Perhaps you could try to FromScene rendering component instead of FromCamera to see if that makes a difference.
Thanks for reporting this issue and let me know how it goes.