Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Released] AVPro Movie Capture

Discussion in 'Assets and Asset Store' started by AndrewRH, Jan 24, 2012.

  1. trzmiel

    trzmiel

    Joined:
    Nov 5, 2013
    Posts:
    28
    How to change compression quality (bitrate?) of captured MP4?
     
  2. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Currently the quality level is fixed. We do plan to expose more options in the future.

    Were you hoping to make the bitrate higher or lower?

    Thanks,
     
  3. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi everyone - nobody has reported any issues since the 3.3 release, which is great :) But I'm worried that people could be having issues and just not reporting them. Please let me know if anyone is having problems with the latest version.

    Thanks!
     
  4. Spabbage

    Spabbage

    Joined:
    Feb 15, 2015
    Posts:
    37
    We're writing a little in house tool that includes screen capture using this plugin.

    As part of this there's an installer script that removes the old install of the tool, including AVProMovieCapture.dll.

    If the tool has already been run and the dll loaded then attemptimg to remove that dll with File.Delete() will fail. I've had a search and other people have had similar issues with native dlls.

    Do you know of an easy workaround aside from restarting Unity.

    Thanks
     
  5. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,

    It sounds like an interesting project!

    Unfortunately that is just how Unity does things. Once it has loaded a native DLL, it is locked until Unity is restarted. This has been on my personal list of annoyances for a while now, especially since it can hamper users upgrading to new versions of the plugin...

    Internally I imagine Unity is using the LoadLibrary() function to load the DLL:
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx

    It would then need to call FreeLibrary() to release it:
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms683152(v=vs.85).aspx

    I was wondering whether we could call FreeLibrary() ourselves, but without having the right HMODULE it's not possible..

    Thanks,
     
  6. Spabbage

    Spabbage

    Joined:
    Feb 15, 2015
    Posts:
    37
    Thanks for your reply. I thought that might be the case but I wanted to try my luck anyway.

    I might ignore the plugin during install if it already exists or something along those lines.
     
  7. diegoe8

    diegoe8

    Joined:
    Aug 9, 2017
    Posts:
    2
    Hi,
    Can I record a specific region of the screen? I have to record only the center of the screen and I cant. It must be only with CaptureFromScene.

    Thanks
     
  8. gilley033

    gilley033

    Joined:
    Jul 10, 2012
    Posts:
    1,181
    Hi, I am having a particular problem with Cinemachine and this tool. I am using multiple virtual cams and then blending between them by enabling/disabling them. This creates a kind of spline between the virtual cams.

    However, when recording, both in game and in standalone (using either real time capture or offline render), when transitioning between virtual cams, there is a faint image of the previous virtual cam overlaid on top of the current one.

    Overlap.png

    It's kind of hard to see in the image but the circled portions are outlines of the trees as if the previous virtual camera were still rendering.

    Have you run into this before?

    Thanks.
     
  9. madmaxim

    madmaxim

    Joined:
    Feb 11, 2013
    Posts:
    6
    We're working on a museum project using AVPro Movie Capture in Unity to grab short (16 second) clips from a USB webcam (composited with chromakey). What we're finding is that although the mp4s play back well in Windows, when the same videos are played back on Mac or iPhone, the audio sync drifts so that by the end of the videos, audio can be up to a second ahead of the video.

    (Though, it's sporadic, some videos will be in sync, others won't).

    Is there a recommended approach for grabbing to mp4's that are more consistently in sync?

    What we're finding is:
    • MF H264 looks great and a great filesize for emailing, but about 20% of the files drift in audio sync when played on Mac or iPhone
    • x264 grabbed to MP4 (with muxer listed in documentation) stays in sync, but occasionally crashes/freezes and has larger file sizes (not as optimal for emailing)
    We're thinking about grabbing to AVI and then using ffmpeg in a separate step to resave as mp4. But before diving in, wanted to see you if you recommendations in terms of the best approach to grabbing mp4's suitable for emailing that play back well on Windows, Mac, and iPhone.

    Thanks!
     
  10. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    CaptureFromScreen always captures the entire screen.
    You can use CaptureFromCamera and set up a camera that just has the part of the screen that you're interested in. Alternatively you could Graphics.Blit() the part of the screen you want to a RenderTexture and then capture that using the CaptureFromTexture component.

    Thanks,
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hmm that is strange.. No we haven't seen this before...

    Are you using the CaptureFromScreen or CaptureFromCamera component? Does it make a difference with either?

    Thanks,
     
  12. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for getting in touch. We'll investigate this further, but for now I would just recommend that your app doesn't have any hiccups (like garbage collection) that could affect the capture timing. How are you recording the audio, is it directly from Unity, and which codec you are selecting?

    Grabbing to AVI and then converting with ffmpeg is certainly a sound idea and something we've used in the past. The advantage of this is that you can apply higher compression because you are not having to use real-time compression options, so you can get a smaller file size.

    Thanks,
     
  13. DeanMarquette

    DeanMarquette

    Joined:
    Feb 10, 2015
    Posts:
    165
    I'm having problems with this. I attached the camera script to my camera and used the H.264 codec but my captures are always to choppy. I want to render the highest quality but that doesn't seem to be possible, but even on medium quality its still just to choppy. To be honest my screen capture software seems to do a better job as there is no choppiness at all and the quality is durable. I'm not quite sure how the offline rendering works as it seems to be no different than the real time render.
     
  14. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for the report. Could you show us what you're capturing and what your capture settings are?
     
  15. david_arel

    david_arel

    Joined:
    May 10, 2016
    Posts:
    7
    Hi,
    Good job on this asset :) Is there a way to create a video file that has the metadata needed for a video software to recognize it as a 360 stereoscopic video? For example, I would like to record some gameplay, and upload it directly to YouTube without modifications, which will then enable viewers to see the video inside Google Cardboard.
    Thanks for the clarification
     
  16. DeanMarquette

    DeanMarquette

    Joined:
    Feb 10, 2015
    Posts:
    165
    Actually after changing some setting it seems to capture fine using H.264.

    My new problem is the camera settings seems to change position maybe. When I play in the window my character is looking straight at me as he should be but when I turn on the AV capture my character look diagonally. Is there an offset of something?
     
  17. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    That sounds very strange. I have no idea what could cause that. Could you explain more how you're using the plugin in your scene? Perhaps a screenshot of your hierarchy with the capture component? Also which capture component are you using?

    Thanks,
     
  18. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    capturing as PNG/JPG Sequence would be very helpful. I actually only need one frame (Screenshot) and your 360° stereo implementation is the much better than the other 360 capture assets out there. But capturing 3 frames lagarith and then saving a still from the videofile is a hassle :)
     
    david_arel likes this.
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks :) Not yet, but this is a great idea. I will add this to the task list, so hopefully it will appear in upcoming version. Thanks,
     
    david_arel likes this.
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    :D fair point... Well the main aim of our plugin is to capture to video files, but I'm sure we can add image support to. Will add this to the task list. Thanks,
     
  21. Bunker8

    Bunker8

    Joined:
    Feb 8, 2016
    Posts:
    3
    Hi,
    I want to record two videos simultaneously (in two different .avi files), one from a streaming and another from a webcam device.
    For this, I am using the AVProMovieCaptureFromCamera component to record from streaming; and the AVProMovieCaptureFromTexture component to record from the webcam device.
    Separately I can record both without any problem. However, when I use the two in the same scene and at the same time, one of the two .avi files can not be played. Is there any way to record two videos at the same time?
    Thanks
     
  22. jimprucey

    jimprucey

    Joined:
    Aug 12, 2012
    Posts:
    8
    Are there any in-depth tutorials on how to use this plugin?
     
  23. SebastianPatric

    SebastianPatric

    Joined:
    Jan 13, 2013
    Posts:
    30
    Thanks for the plug-in. Audio synchronization is also an issue for me. Recording the same sequence from unity multiple times yields slightly offset audio in each capture. This is mission critical for my use case so I would welcome any suggestions. I would also throw in my vote for controls for bit rate settings. A robust and well documented API geared to be used from code rather than a GUI would make me buy this twice.
     
  24. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    I'm trying to use this to capture footage of my Windows Mixed Reality UWP project. The recorder works in the editor but when I make a build it does not record anything.
     
  25. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    My project is a rally game.

    I need many cameras along the way.

    1- Is it a multi-camera system?
    2- Can you activate and deactivate the cameras by triggers?
    3- Can the cameras be activated and deactivated by a "human" who does the work of the retransmission director? (choose what camera and at what time)

    Thank you
     
  26. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    I got a 360 movie with a Wireframe shader on dark background. It aliases heavily for obvious reasons and I'm trying to get around it. I've tried using the Temporal Antialiasing effect of the PostPro Stack v2, but it seems to have a problem with AVPro Capture slowing down the game time in "Offline Capture" mode and blurrs the whole scene. Is there a fix on your side or do I have to poke to Post Processing Stack team?
     
  27. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    Does this support UWP builds?
     
  28. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Is this asset active? Is there someone?
     
  29. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    Is there a way to actually capture 8192x8192 Pixel Footage? The plugin always claimed "[AVProMovieCapture] Failed to create recorder". I tried different settings, same result. Im on 1080Ti so should be enough memory.
     
  30. Unbound_VR

    Unbound_VR

    Joined:
    Nov 28, 2017
    Posts:
    1
    Rendering to individual frames is an absolute must.

    Our studio never renders directly to video as we have very little control over the final quality.

    For example, if we use the offline renderer and the scene has sound, we have to output the scene audio separately, and then add it to the footage in a video suite later anyway. Which means the completed video will have been compressed twice - once when rendered from Unity and again from the video suite. Three times if we upload it to Youtube etc.

    The same problem arises if the project requires any editing or post adjustments i.e. colour correction, which they nearly always do.

    Also, if we're rendering out a complex scene it could take days, and if it fails we lose the entire render. That doesn't happen with frames. We still have all the frames rendered up until the time it failed and we can restart the render from that point rather than having to try and render it all again.

    Your plugin is great and we'll be using it regularly. As soon as you add individual frame support we wont need to use any other plugin like this, and neither will anyone else. Hopefully that's like, tomorrow, as we have multiple projects to render.
     
  31. 265lutab

    265lutab

    Joined:
    Sep 15, 2014
    Posts:
    155
    Anyone from AVPro?
     
  32. Skjalg

    Skjalg

    Joined:
    May 25, 2009
    Posts:
    211
    Any chance we will see ios and android support for this?
     
    JoeStrout likes this.
  33. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, I'm afraid it doesn't yet support recording multiple videos at once. This is something on our roadmap...
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Not really tutorials... There are the demo scenes that are included in the unitypackage, and there is detailed documentation in the PDF.
     
  35. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for your suggestions. Bit-rate is something we will be exposing very soon. You certainly don't have to use the GUI, but we did make some handy components like CaptureFromCamera etc that you could instantiate via code and then script easily. There is also a script in the Demos/Scripts folder called ScriptCaptureDemo.cs which shows how to use the API for capturing without any GUI or any components. We would still recommend using the components though as they wrap a lot of the management complexity.

    Audio sync is tricky for sure...Perhaps you could send us an example project and we could look into this issue further?

    Thanks,
     
  36. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'm afraid it doesn't support UWP. Only Windows desktop is supported currently. We have UWP support on our roadmap but it is not currently a high priority.

    Thanks,
     
  37. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, you can easily switch cameras. We have a component called CaptureFromCamera which has a camera field. When you want to swich cameras you can call the method SetCamera() to set the new camera. You can set up a system to call this method using triggers, or manually via a UI.

    I hope that helps. Thanks,
     
  38. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Offline Capture mode will just capture as fast as possible. Sometimes this meas the game will slow down, and other times it will speed up. It is not meant to be used while interacting with the game, and is basically a rendering mode for capturing animations.

    I'm not sure why you're getting blur though. I've just tested with the latest PostProcessing Stack 2 and AVPro Movie Capture versions and it seems to work fine for me.

    Perhaps you can post a screenshot of the issue and let me know which versions you're using and also which CaptureFrom component and Unity version.

    Thanks,
     
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes there is, but you need to select a compatible codec. Which codec are you trying to use?

    Formats like H.264 and H.265 do not support such a high resolutions, as their specification only goes up to 8,192×4,320. Sadly the Microsoft encoder doesn't yet support even this resolution.

    You can use AVI uncompressed, but the highest I've been able to get that to encode at is 8192x5240. You can also encode wider, like 16384x1080. These limitations are all from the encoder. Internally the only limit we place is that captures can't be larger than 16384 x 16384. To get 8192x8192 you would probably need to use a codec like ProRes, which we don't yet support...

    Thanks,
     
  40. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes it's active - I was just away on holiday :)
     
  41. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for this suggestion. We are looking at adding PNG exporting support soon.
     
  42. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Unlikely...we wish we had more time!
     
  43. Divinyx

    Divinyx

    Joined:
    Dec 14, 2014
    Posts:
    5
    I'm in a spot where I'd like to capture a different game window while the main Unity window is running in the background. The Unity window acts as a lobby to start different games. Is it possible to switch the window being captured?
     
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'm afraid that isn't currently possible. In the future we may offer a full desktop capture option which may help your case. Currently though we can only capture from the Unity D3D context...
     
  45. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi Everyone,

    AVPro Movie Capture version 3.3.2 has just been released!

    You can find the updated version on the Asset Store here:
    more information and demos are available on our website.

    Changes include:

    Version 2.x Upgrade Notes
    • If upgrading from version 2.x then you must delete all of the files for any previous copies of AVPro Movie Capture in your project before importing this version. This is because many files have been renamed and the folder structure has changed significantly.
    Improvements
    • UnityAudioCapture component can now be attached to other objects besides the AudioListener, such as the AudioSource component, and it can mute the audio once it has grabbed it
    Bug Fixes
    • Fixed a bug where RenderTextures with generate mipmaps enabled couldn’t be captured
    • Fixed some shaders that had been automatically upgraded for newer versions of Unity so they’re backwardly compatible again
    • Fixed 360 stereo ODS capture problem with some image effects (such as HBAO) which needed reactivation
    Other
    • Updated all copyright messages to 2018
    • Now also uploading versions using Unity 5.5 and 5.6 to prevent the script/shader upgrade warnings
    • Tested with Unity 2018.1.0b8
    Thanks,
     
    n97968 likes this.
  46. vntana_legacy

    vntana_legacy

    Joined:
    Jan 16, 2017
    Posts:
    5
    Love the app; just have a question. I want to change the codec that is used to record in code. Right now, I'm using

    CaptureFromCamera Capture = set_with_GetComponent();
    Capture._videoCodecPriority = new string[1] { desiredCodec };

    which shows correctly in the editor, and even works as I expected if I press "Start Recording" in the editor. What does NOT work is calling:

    Capture._videoCodecPriority = new string[1] { desiredCodec };
    Capture.StartCapture(); /// or Capture.QueueStartCapture();

    The above code starts recording with the first available entry BEFORE I change it, and then it appears to change the list (when I press stop recording in Editor). Any idea why this would happen?
     
  47. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Ahh yes.. The codecs are evaluated during Awake(), so if you change the codec priority, then you need to call Capture.SelectCodec() to update it. Sorry about this - we will make the API clearer in future.

    Thanks,
     
  48. koncon

    koncon

    Joined:
    Oct 21, 2016
    Posts:
    2
    Hi

    I want to use named pipe and ffmpeg to streaming video, but I meet a problem.
    Currently, my project will use Thread to call ffmpeg when start streaming.
    If I use named pipe, it will block all project until ffmpeg read pipe buff.
    However, my project is blocked and can't start ffmpeg.
    If I start ffmpeg first, it will show "can't find pipe buff".
    How can I solve this problem?

    Thanks.
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for your post and for reporting this issue.

    We will try to make a better solution for this. But in the meantime, you could just add a Sleep(1000) to the top of your thread function that opens up FFMPEG. So you would start your thread, then start AVPro MovieCapture, and the thread should wait 1 second before trying to open FFMPEG.

    I hope that helps.
     
  50. koncon

    koncon

    Joined:
    Oct 21, 2016
    Posts:
    2
    Hi

    Thanks, it works!
    However, there is another problem.
    I use ffmpeg to record mic audio and combine with named pipe video, but my audio is hard to sync with video.
    I use -itsoffset to shift audio data but video start time is not constant.
    Please help me to solve it, thanks.