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. InteractiveMediaDev

    InteractiveMediaDev

    Joined:
    Aug 9, 2016
    Posts:
    12
    Hi Andrew,

    I was finally able to test the recording in the unique setup that I need to use it in - basically there's a camera that is connected to a keyer - this keyer takes the camera feed and filters out the green screen and replaces it with an image/video that is pushed in from a BrightSign device. This new feed (which has the green screen removed for the image/video) is then sent to the computer, which shows up as a camera feed to the computer (and to Unity). The microphone comes in through a mixer then into the computer's mic in slot.

    The problem is the audio and video aren't synced up. I'm guessing the issue is that the camera feed is delays probably a half second since it has to go through the keyer which takes a while to process. I don't think this is a problem easily solved but my hopes is that there is some way I can delay the audio feed from being encoded to the video by a certain amount of time in order to fix the delay.

    Ideally if this was possible you could point me in the right direction in the code and I would work on getting it to work. This might be a nice option to add though in a future release (a way to set an audio delay on the recording). If it's not possible then I'm not sure what my next step will be.

    Thanks for your help!

    Edit: I realized I originally wrote "are synced up" which wouldn't be an issue... they AREN'T synced up! However, I ran the video through FFMPEG to delay the audio and that fixes it. We're going to test to see how consistent the delay is, and if the delay stays pretty much the same then we're just going to use FFMPEG to fix it. Thanks!
     
    Last edited: May 19, 2017
  2. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    247

    Realy thanks for your answer, both ways helped, disabling MSAA and FromScene Capture - and caputre go as expected. Going to buy soon!
     
    AndrewRH likes this.
  3. hellaeon

    hellaeon

    Joined:
    Jul 20, 2010
    Posts:
    90
    Hi all,

    I am hoping to capture footage in my sports game from 2 cameras
    The 'replay' recording ideally will switch between them when I ask.

    (1) is a game camera for the desktop view, but also used in VR as a 'stadium' scoreboard 'television' view (Render Texture)
    the other (2), will be a camera purely for the purpose of the replay. Camera (2) wont be seen by any players.
    I want to be able to switch between them - 1,2,1 only for the recording.

    By the looks of it, I need to use the Movie Texture capture components. I think...

    After reading through the thread, I was hoping to find some script or a clear way this might work (with the demo package for testing). I'm also looking over the documentation so I apologize if I missed where it tells me how I can do the above.

    Via c#, how can I trigger the recording when I want it to start, control switching the camera (I read you just turn them on and off? Can someone help out here while I continue investigating?

    Cheers
     
    Last edited: May 26, 2017
  4. AndrewRH

    AndrewRH

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

    The FromCamera component currently only captures from the camera that it is attached to. We could however make it possible to change camera by adding a method to set the _camera member. If you just want to capture the final render to scene (no matter which cameras it is rendering from), then you can use the FromScene component. If the documentation says you can toggle the cameras by switching them on/off, then it may need updating as the camera component on longer allows this.

    It sounds like you just need a modified version of FromCamera component with the ability to change camera.. You might be able to do this by adding this code to AVProMovieCaptureFromCamera:

    Code (CSharp):
    1.     public void SetCamera(Camera camera)
    2.     {
    3.         _camera = camera;
    4.     }
    I hope this helps. Let me know how it goes.

    Thanks,
     
  5. hellaeon

    hellaeon

    Joined:
    Jul 20, 2010
    Posts:
    90
    Thanks for the reply, worked as simple as that.
    Ill try testing it in game now and let you know of any dramas.

    One to add to your feature map....

    Cheers and Beers
     
    Last edited: May 27, 2017
    AndrewRH likes this.
  6. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    Don't know if this belongs here but can also be an Adobe/Lagarith problem:
    I'm encoding video with lagarith and getting artifacts with every Adobe product while decoding the videos. The problems occurs when a unity scene is completly still.

    Here's a test video:
    https://www.dropbox.com/s/du71ym155vmtjfx/AVCaptureProTestClip.avi?dl=0

    The text is scrolling upwards, with 5 seconds pause after 10 seconds. While VLC and MPC-HC Playback is fine Premiere/AE/Media Encoder showing black or random frames in this scrolling pause. Also lenght and framerate readouts are often wrong and it seems to be related to the issue. It happens in 360 and normal cam, with and without alpha channel. Hopefully someone can help.
     
  7. AndrewRH

    AndrewRH

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

    I think this is related to a feature of the Lagarith codec called "Null Frames". Try going to into the codec settings and make sure "Null Frames" is not selected. The "Use Multi-threading" option should be selected.

    I hope this helps you.

    Thanks,
     
    pojoih likes this.
  8. pojoih

    pojoih

    Joined:
    Mar 30, 2013
    Posts:
    226
    Of course!! How could I not saw this. Thanks a lot, seems to be fixed.
     
  9. Rodolinc

    Rodolinc

    Joined:
    Sep 23, 2013
    Posts:
    63
    Hello I'm trying to record a transparent video, I've tried every configuration but no transparent video output. Im using Unity 5.5.2 and the trial version of AV Pro Movie Capture. The camera with the script AVProMovieCaptureFromCamera attached has the clear solid color with alpha 0. SUpport ALpha is enabled. And Lagarith codec with RGBA is used. the only thing I can't find is the "Use Fast Pixel Format" could that be the problem?

    Thanks
     
  10. Luchunpen_0

    Luchunpen_0

    Joined:
    Aug 7, 2014
    Posts:
    58
    Hi.
    Is the way to record movie with audio in NO "IsRealTime" mode ?
    Thanks )
     
  11. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    No, sorry, there is currently no way to record audio for non-realtime captures.
     
  12. Rodolinc

    Rodolinc

    Joined:
    Sep 23, 2013
    Posts:
    63
    Is it possible to have to cameras in the same scene with the AVProMovieCaptureFromCamera component? in short record 2 videos at the same time?
    Thanks
     
  13. Luchunpen_0

    Luchunpen_0

    Joined:
    Aug 7, 2014
    Posts:
    58
    Hi again ).
    Another question. Can I insert AudioClip (or your custom audio data) in result data when capturing is finished, but before save movie to file ?
    If not, maybe you could add this feature in future update ?

    Thanks.
     
  14. eggapple

    eggapple

    Joined:
    Nov 1, 2016
    Posts:
    1
    Which mp3 codec is work ? I have tried lamp mp3 codec , but it didn't work . . .
     
  15. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    Did the audio only feature ever get implemented? I need to record the mic to one file, preferably an mp3. Then the camera and scene audio to a video file. Is this currently possible?
     
    Last edited: Jul 17, 2017
  16. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Currently it is only possible to record a single video at once. We plan to add support for multiple recordings soon. Thanks,
     
  17. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I'm afraid this isn't currently possible. I will add the feature request to the list but it is unlikely to be developed unless there is more request for it. You may want to look at using a command-line tool like FFMPEG to mux an audio file (wav/mp3 etc) into the video file.
    Thanks,
     
  18. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Audio only isn't possible yet as this plugin is still focused on capturing visuals. It's on the list though and is likely to be a feature one day.

    Thanks,
     
  19. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Did you ever figure out a solution for this? I think I remember that is came down to certain Unity shaders / effects just don't write out an alpha value...
     
  20. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    The MP3 codec in Windows doesn't work :( We plan to add a working codec and AAC support soon. Thanks,
     
  21. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hey all, just to let you know - Unity 2017 support is coming in the next update - which should be out this week.

    Thanks,
     
  22. mattmettler

    mattmettler

    Joined:
    Oct 28, 2016
    Posts:
    2
    Hello,

    The plugin works great, but sometimes (maybe 30% of the time?) we get a Unity Cloud Build error that looks like the following:

    Code (CSharp):
    1. 14308: [Unity] Launched and connected shader compiler UnityShaderCompiler after 0.10 seconds
    2. 14309: [Unity] Shader compiler: exception while compiling shader snippet. Thread=-1564019776 Type=0 platform=5. Source:
    3. 14310: [Unity] #line 19 ""
    4. 14311: [Unity] #ifdef DUMMY_PREPROCESSOR_TO_WORK_AROUND_HLSL_COMPILER_LINE_HANDLING
    5. 14312: [Unity] #endif
    6. 14313: [Unity] #include "HLSLSupport.cginc"
    7. 14314: [Unity] #include "UnityShaderVariables.cginc"
    8. 14315: [Unity] #include "UnityShaderUtilities.cginc"
    9. 14316: [Unity] #line 19 ""
    10. 14317: [Unity] #ifdef DUMMY_PREPROCESSOR_TO_WORK_AROUND_HLSL_COMPILER_LINE_HANDLING
    11. 14318: [Unity] #endif
    12. 14319: [Unity] /* UNITY: Original start of shader */
    13. 14320: [Unity]             #pragma vertex vert
    14. 14321: [Unity]             #pragma fragment frag
    15. 14322: [Unity]             #include "UnityCG.cginc"
    16. 14323: [Unity]             struct appdata_t {
    17. 14324: [Unity]                 float4 vertex : POSITION;
    18. 14325: [Unity]                 float2 texcoord : TEXCOORD0;
    19. 14326: [Unity]             };
    20. 14327: [Unity]             struct v2f {
    21. 14328: [Unity]                 float4 vertex : SV_POSITION;
    22. 14329: [Unity]                 half2 texcoord : TEXCOORD0;
    23. 14330: [Unity]             };
    24. 14331: [Unity]             sampler2D _MainTex;
    25. 14332: [Unity]             float4 _MainTex_ST;
    26. 14333: [Unity]             v2f vert (appdata_t v)
    27. 14334: [Unity]             {
    28. 14335: [Unity]                 v2f o;
    29. 14336: [Unity]                 o.vertex = UnityObjectToClipPos(v.vertex);
    30. 14337: [Unity]                 o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
    31. 14338: [Unity]                 return o;
    32. 14339: [Unity]             }
    33. 14340: [Unity]             fixed4 frag (v2f i) : COLOR
    34. 14341: [Unity]             {
    35. 14342: [Unity]                 fixed4 col = tex2D(_MainTex, i.texcoord);
    36. 14343: [Unity]                 clip(-1);
    37. 14344: [Unity]                 return col;
    38. 14345: [Unity]             }
    39. 14346: [Unity] Shader compiler: internal error compiling shader snippet type=0 platform=5: Protocol error - failed to read correct magic number
    40. 14347: [Unity] UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck(String[], String, String, BuildTargetGroup, BuildTarget, BuildOptions, Boolean)
    41. 14348: [Unity] UnityEditor.CloudBuild.Builder:Build()
    42. 14349: [Unity] Launched and connected shader compiler UnityShaderCompiler after 0.06 seconds
    43. 14350: [Unity] Shader compiler: UnityShaderCompiler compiler executable disappeared on thread -1564019776, restarting
    44. 14351: [Unity] Launched and connected shader compiler UnityShaderCompiler after 0.07 seconds
    45. 14352: [Unity] Compiled shader 'AVProMovieCapture/Invisible' in 1.42s
    46. 14353: [Unity]     gles (total internal programs: 5, unique: 2)
    47. 14354: [Unity]     gles3 (total internal programs: 6, unique: 2)
    48. 14355: [Unity]     vulkan (total internal programs: 6, unique: 2)
    49. 14356: [Unity] Shader error in 'AVProMovieCapture/Invisible': Internal error communicating with the shader compiler process
    Any advice on what we can do differently to reduce these issues?
     
  23. NathanRH

    NathanRH

    Joined:
    Oct 24, 2012
    Posts:
    447
    Hi,

    It looks like you either aren't using the latest version of AVPro Movie Capture, or you have some old files floating around from a previous version. This "Invisible" shader is no longer used by our plugin and was removed some time ago. Perhaps deleting all of the AVPro Movie Capture files and importing the latest package. Or if you're already using the latest version, just try deleting that shader.

    I hope this fixes it for you.

    Thanks,
     
  24. InteractiveMediaDeveloper

    InteractiveMediaDeveloper

    Joined:
    Mar 9, 2017
    Posts:
    1
    Hi Andrew,

    I've run into a new issue with the recording plugin - it seems to lock CPU usage that it never releases. Each time someone goes through the recording part of the interactive, the CPU usage for the Unity application increases, until eventually (after a few dozen times through), the CPU usage hits 100% for the Unity application and the computer starts to slow down significantly.

    I've tried a few different things to fix it. My initial setup had a AVProCaptureFromCamera component on a camera in a recording scene. You would go to that scene, record the video, then leave the scene and do other stuff, then eventually it would go back to the recording scene to record a different video. So the AVProCaptureFromCamera was being created and destroyed over and over. This seems to call AVProMovieCapturePlugin.Init() each time, so thought maybe that should only be called once, so I moved the GameObject with the camera with the AVProCaptureFromCamera components on it to my setup scene (which is only done on application startup), and had it set to "DontDestroyOnLoad" so that it is only ever created once. However this didn't fix it... so I added a AVProMovieCapturePlugin.Deinit() to the OnDestroy method of a script that was in my recording scene, so when I left that scene I would deinitialize the plugin. Well that worked, but you could only record once, the 2nd time through it wouldn't record. So I added the AVProMovieCapturePlugin.Init() to the Awake function of the script in the Recording scene (the camera/AVProCaptureFromCamera components were still persistent from the Setup scene), and so now the recording worked again multiple times through, but I was still getting the CPU usage issue.

    Do you have any ideas on what may be happening or how I could potentially deactivate the plugin so that it frees the CPU resources it seems to be using?

    I'm using Unity 5.5.2 and plugin version 2.98.

    Thanks!
     
  25. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Thanks for getting in touch and for explaining the issue you're having.

    I'm afraid nothing springs to mind at the moment, and we have not seen this behaviour before.

    Perhaps you could let us know some details:
    1) Video and audio codec used
    2) Are you using WebcamTexture to display your webcam feed and is this enabled/disabled per capture?

    You could try upgrading to AVPro Movie Capture 2.99 as we did fix a memory leak...

    It sounds like it'd be a good idea to modify the app so that it can run locally on your development machine, or at least see if you can recreate the issue by creating a new app that also records in the same way.

    Thanks,
     
  26. michael554466OG

    michael554466OG

    Joined:
    Feb 28, 2015
    Posts:
    5
    I have a problem, the free one has error in the code to do with identifying the camera, can you fix it?
     
  27. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    It would be great to know what the error is? :)
    Also, which version of Unity?

    Thanks,
     
  28. Murrrly

    Murrrly

    Joined:
    Apr 25, 2013
    Posts:
    16
    Is there ever likely to be support for mobile platforms? Or is there some fundamental limitation that is blocking this from happening?
     
  29. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes we would love to do this. The only thing blocking us is time :) Making these plugins takes a huge amount of work... But yes, we're currently exploring options to make this plugin cross-platform.
    Thanks,
     
  30. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Can you provide any more details please?

    Thanks,
     
  31. dimitriospro

    dimitriospro

    Joined:
    Feb 13, 2017
    Posts:
    1
    Howdy,

    I'm devloping an installation for a museum, and the setup is a PC, a touchscreen display (Display 1, 1200x800) and a Beamer / projector (Display 2, 1920x1080).

    When testing on my PC (two monitors instead of touchscreen / beamer), everything works like a charm and AVPro is freaking awesome ; lightning fast, good quality, no errors. Was pretty easy to setup as well.

    Unfortunately, at the museum, where it really needs to work, it produces the following bug ; the moment the recording starts, the tablet screen (Display 1) gets displaced into the beamer screen (Display 2) ontop of the secondary display application.

    Before recording
    (Tablet left, Beamer right)
    unnamed.png

    After recording begins
    unnamed (1).png

    Any idea how to go about solving this?

    This is the only roadblock I have before upgrading to AVPro. I'm very happy with the plugin, just need this solved asap.

    Thanks a bunch!
    Yours,
    Konstantinos
     
  32. anthony_ribot

    anthony_ribot

    Joined:
    Mar 5, 2015
    Posts:
    3
    Hi,

    We recently upgraded Unity to the 2017 release and the AVPro plugin makes the application crash. Those crashes seem to be related to the Universal Media Player plugin as our application works just fine when there is either AVPro or Universal Media Player, but it crashes when both plugins are used. The crashes happen when the AVPro record is started and when the application is stopped.

    Here is the stack trace from the editor log :
    0x00007FFEFE1E3C58 (KERNELBASE) RaiseException
    0x00007FFEEC4073F2 (UniversalMediaPlayer) UnityRenderEvent
    0x00007FFEEC40477E (UniversalMediaPlayer) UnityRenderEvent
    0x00007FFEEC402F0F (UniversalMediaPlayer) UnityRenderEvent
    0x00000001410B5B8B (Unity) PluginsRenderMarker
    0x0000000140E9DFDE (Unity) GfxDeviceWorker::RunCommand
    0x0000000140EA2AFF (Unity) GfxDeviceWorker::Run
    0x0000000140E822F0 (Unity) GfxDeviceWorker::RunGfxDeviceWorker
    0x00000001415ADA5C (Unity) Thread::RunThreadWrapper
    0x00007FFEFF708364 (KERNEL32) BaseThreadInitThunk
    0x00007FFF01A370D1 (ntdll) RtlUserThreadStart

    Do you already notice this kind of problem, and do you plan on fixing it ?
     
  33. Rodolinc

    Rodolinc

    Joined:
    Sep 23, 2013
    Posts:
    63
    Sadly couldn't find a solution :( we had to use a camera replacement shader to "mask" the objects and record two videos then in a video editor remove the masked zones. but could've been easier if the transparency recording worked.
     
  34. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Yes, the current version (2.99) of AVPro Movie Capture doesn't support Unity 2017. We're about to release a new version (3.0) that does.
    Thanks,
     
  35. Trivium_Dev

    Trivium_Dev

    Joined:
    Aug 1, 2017
    Posts:
    78
    Hi Andrew, do you know when 3.0 will be released? Also I downloaded version 2.99 from the Asset Store and the Readme still says the version is 2.98 (I created a completely new empty project and downloaded it to make sure the files were being downloaded correctly). Can you confirm that the asset store version is actually 2.99?

    Thanks
     
  36. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I just got the latest version from asset store and i can confirm that it is 2.99. Perhaps try getting it from a blank Unity project?

    I think what might be happening is that Unity is locking the DLL files and not allowing them up upgrade correctly. Please try the following to upgrade:

    1) In Unity, close the Movie Capture window if it is open
    2) Close all instances of Unity
    3) Open a new Unity instance, load your project
    4) Without running your game, or clicking on anything in your project, Import the latest package from the AssetStore

    Hopefully this will work. If it doesn't, then try closing Unity, deleting the DLL files and then importing the AssetStore version.

    Also, make sure there aren't somehow multiple copies of the DLLs in your project.

    Please let us know if this works for you. And yes, very soon we are going to be releasing version 3.0 which has a ton of improvements. The aim is to release it this week.
     
  37. AndrewRH

    AndrewRH

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

    AVPro Movie Capture version 3.0 has just been released!

    You can find the updated version on the Asset Store and the free trial version / demos on our website.

    Changes include:

    Upgrade Notes
    • 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
    • Added Unity 2017 support
    • UI revamped to be easier to use and better looking
    • Huge code cleanup: moved everything into a namespace, classes renamed, code documentation improved, documentation updated etc
    • Added new Omni-Directional Stereo (ODS) capture component for capturing stereo 360 in a more accurate way. This new method is much slower and is intended for off-line rendering only. Based on: https://developers.google.com/vr/jump/rendering-ods-content.pdf
    • Added options to automatically stop the capture / render after a certain number of frames or seconds
    • Performance improvements, the capture no longer forces Unity to run at the capture rate
    • Exposed the Camera360 stereo options in the AVPro Movie Capture window
    • CaptureFromCamera and CaptureFromCamera360 components no longer require to be attached to a GameObject with a Camera. The camera can be set manually via the exposed field. If no camera is assigned it will try to find the Camera component on the same GameObject.
    • The free trial version is now on the Unity Asset Store (currently pending review) and allows for 10 seconds of capture without any watermarking.
    Bug fixes
    • Fixed audio capture in Camera360 component
    • Fixed captures trying to use MSAA and Deferred rendering together
    • Fixed a bug where “Start Paused” option would be ignored
    • Fixed issue where UnityAudioCapture component would be enabled when capture started with StartPaused option and Pause/Resume wouldn’t toggle enabled status of UnityAudioCapture component
    • Fixed “Open Last Capture” sometimes not storing the last capture

    Here's a 360 video rendered from Unity with motion-blur:


    Thanks,
     

    Attached Files:

    Last edited: Aug 11, 2017
  38. bluemike

    bluemike

    Joined:
    Oct 26, 2015
    Posts:
    18
    Hi @AndrewRH and @izm1252 ,

    I haven't seen a continuation after this reply.
    I am facing the same problem as @izm1252 : the process stalls right after CaptureBase calls the following line:
    Debug.Log("[AVProMovieCapture] Start Pipe Capture: " + info);
    _handle = NativePlugin.CreateRecorderPipe("\\\\.\\pipe\\mypipe", (uint)_targetWidth, (uint)_targetHeight, (int)_frameRate, (int)(_pixelFormat), _isTopDown, _supportAlpha);
    (I just replaced the _filePath argument with a hardcoded named pipe path.)
    This is with the latest version 3.0 but it happened in the versions before.

    I am running this script from a Windows cmd prompt window, and this is the error I get

    ffmpeg.exe -y -f rawvideo -codec rawvideo -s 640x480 -r 30 -pix_fmt rgb32 -i \\\\.\\pipe\\mypipe -an -c:v libx264 -pix_fmt yuv420p output.mp4
    ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
    built with gcc 5.3.0 (GCC)
    configuration:
    libavutil 55. 17.103 / 55. 17.103
    libavcodec 57. 24.102 / 57. 24.102
    libavformat 57. 25.100 / 57. 25.100
    libavdevice 57. 0.101 / 57. 0.101
    libavfilter 6. 31.100 / 6. 31.100
    libswscale 4. 0.100 / 4. 0.100
    libswresample 2. 0.101 / 2. 0.101
    \\.\pipe\mypipe: No such file or directory
    Any idea what is going on ? I haven't yet come to check if the format is correct, as it seems the named pipe simply doesn't exist / is not created...

    I also tried writing my own listener in C++, based on instructions from here:

    {
    HANDLE hPipe;
    DWORD dwWritten;


    hPipe = CreateFile(TEXT("\\\\.\\pipe\\mypipe"),
    GENERIC_READ | GENERIC_WRITE,
    0,
    NULL,
    OPEN_EXISTING,
    0,
    NULL);

    if (hPipe == INVALID_HANDLE_VALUE)
    {
    // Failed
    return false;
    }

    return true;
    }

    But I keep receiving an invalid handle, although my unity app is running and stalled inside CreateRecorderPipe...
     
    Last edited: Aug 16, 2017
  39. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    That's interesting..We'll test it again here and let you know. Thanks,
     
  40. bluemike

    bluemike

    Joined:
    Oct 26, 2015
    Posts:
    18
    Apparently you haven't fixed it yet in newest version 3.0... If I have multiple cameras with different CaptureFromCamera component in each, 2 video files are created but all frames are going into the first file :(
    Note that it used to work well in older 2.72 version (1.5 years ago or so), so I am stuck there in the meanwhile.

    That's a snapshot of my test app. Let me know if you need a zip of the project.
     

    Attached Files:

  41. bluemike

    bluemike

    Joined:
    Oct 26, 2015
    Posts:
    18
    One more question about the new version 3.0: since you moved all the scripts under Plugins/, it becomes forbidden to regular scripts from accessing AVPro classes, are they are only part of the "firstpass" Mono project generated by Unity. I could cope with the namespace changes, but this is quite a hard piece of migration for existing projects who want to control capture trigger and parameters via scripting. Was it done on purpose, trying to avoid any future scripting dependencies ?
     
  42. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Hi,
    Yes unfortunately the feature of allowing multiple recorders didn't make it into the 3.0 release. We're still working on this and it should be out soon.
    Thanks,
     
  43. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    No we didn't put it under the Plugins folder to block any access, we simply did this to help keep compile times fast. The idea was that it would get built in the first pass, whereas user scripts are compiled in a separate pass. You should still be able to access the AVProMovieCapture scripts from your own scripts though? If you're having trouble please let us know with a specific example so we can fix it. Thanks,
     
  44. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    We looked into the named pipe issue but for us it worked perfectly. The documentation wasn't totally clear so we'll update that. A few things:

    Here is how we set the named pipe path:



    Next we created a batch file for ffmpeg with the following command:

    ffmpeg.exe -y -f rawvideo -codec rawvideo -s 640x480 -r 30 -pix_fmt rgb32 -i \\.\pipe\test_pipe -an -c:v libx264 -pix_fmt yuv420p output.mp4

    Make sure to change -s 640x480 to match the resolution you will be capturing.

    Then press Play in Unity and press the Start Capture button. This will lock up Unity as it waits for the pipe to start reading. Now run the ffmpeg batch file and Unity should unlock and the capture should be piped via ffmpeg.

    I hope that helps.

    Thanks,
     
  45. bluemike

    bluemike

    Joined:
    Oct 26, 2015
    Posts:
    18
    I read a separate thread saying that there is an issue with named pipes and Unity versions anterior to 2017:
    https://forum.unity3d.com/threads/named-pipes.200728/#post-3172185

    I guess you tried with avpro version 3.0 and Unity 2017, right ?
    Did you have to set the "Scripting Runtime Version" in the player settings to "Experimental (.NET 4.6 Equivalent)" -- and tested on Windows 10 only, as the above post says ?

    Anyway I just did the 2017 upgrade too and I'll give it another try.

    My concern here is that I also need simultaneous multiple recordings, which is not yet working in version 3.0, so I am stuck with version 2.72 for that matter :(. I know it's quite outdated for you guys, but I would be very grateful if you confirm that the above test also works for you with avpro version 2.72 and Unity 5.6.

    Also I was not very careful with matching the resolution, but I assumed that the failure to open the pipe from ffmpeg was not related to that.

    Thanks for your help!
     
  46. bluemike

    bluemike

    Joined:
    Oct 26, 2015
    Posts:
    18
    Well, no.
    If you look at the generated projects in Monodevelop, the project Assembly-CSharp will not contain AVPro scripts, whereas the project AVPro-CSharp-firstpass does. So at compile time, even the new Renderheads namespace is not defined in the first project, causing compile error in every depending regular script.
    What I have to do then is put my wrapping scripts inside Plugins, so it will be compiled in firstpass, and then I can refer to them within the scene. Clean, but not very convenient, and a big migration hassle...
     
  47. bluemike

    bluemike

    Joined:
    Oct 26, 2015
    Posts:
    18
    OK I gave it a try, with Unity2017/avpro3.0/.NET4.6.
    But unfortunately I see the same error o_O. ffmpeg insists on not finding the pipe file...

    \\.\pipe\mypipe: No such file or directory​

    I tried with ffmpeg-3.0.1 first, compiled with gcc 5.3.0
    And then I tried with the latest Windows binaries downloaded from ffmpeg.org (version N-86977-g5859b5b, compiled with gcc 7.0.1).

    BTW, I wonder how it worked for you because I had to fix a bug in CaptureBase.cs, in the function GenerateFilename.
    When in named pipe output mode, you should not try to create the Directory \\.\pipe, otherwise it leads to some ugly infinite loop.

    I wonder if I'm missing some system settings.
    I am puzzled...
    @izm1252 did you have a chance to make it work ?
     
  48. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    I just tried with the latest version here:
    https://ffmpeg.zeranoe.com/builds/
    which is version 3.3.3 and it worked well.

    We have found some issues in AVPro Movie Capture 3.0 related to named pipes though so we're releasing a new version (3.01) with fixes to these issues. Hopefully it should be live on the Asset Store later today.

    Thanks,
     
  49. AndrewRH

    AndrewRH

    Joined:
    Jan 24, 2012
    Posts:
    2,806
    Perhaps you could send us one of your scripts to test with?
    Are you actually inheriting from one of our base classes, or just using our classes?

    Thanks,
     
  50. AndrewRH

    AndrewRH

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

    AVPro Movie Capture version 3.01 has just been released!

    You can find the updated version on the Asset Store and the free trial version / demos on our website.

    Changes include:

    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
    • Added named pipe output option to the Capture Window and improvements to the inspector
    Bug fixes
    • Fixed some bugs related to using named pipes
    • Fixed some rare null exceptions that could happen when upgrading from previous version which used specific codec indices
    Thanks,