HoloLensCameraStream icon indicating copy to clipboard operation
HoloLensCameraStream copied to clipboard

Could not find an encoding property set that matches the given camera parameters

Open antoined73 opened this issue 5 years ago • 3 comments

The plugin works correctly when running the example project, but when I integrate it in my vuforia project, i got this error :

Exception: Could not find an encoding property set that matches the given camera parameters. at HoloLensCameraStream.VideoCapture.GetVideoEncodingPropertiesForCameraParams (HoloLensCameraStream.CameraParameters cameraParams) [0x00000] in <00000000000000000000000000000000>:0 at HoloLensCameraStream.VideoCapture+<StartVideoModeAsync>d__25.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext (System.Object stateMachine) [0x00000] in <00000000000000000000000000000000>:0 at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run () [0x00000] in <00000000000000000000000000000000>:0 at HoloToolkit.Sharing.SessionListener+SwigDelegateSessionListener_2.Invoke () [0x00000] in <00000000000000000000000000000000>:0 at System.Threading.Tasks.SynchronizationContextAwaitTaskContinuation+<>c.<.cctor>b__7_0 (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Action1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.WaitUntil.get_keepWaiting () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext.Exec () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext.ExecuteTasks () [0x00000] in <00000000000000000000000000000000>:0 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0 at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <00000000000000000000000000000000>:0 at System.Action`1[T].Invoke (T obj) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.WaitUntil.get_keepWaiting () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext.Exec () [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.UnitySynchronizationContext.ExecuteTasks () [0x00000] in <00000000000000000000000000000000>:0 UnityEngine.DebugLogHandler:LogException(Exception, Object) UnityEngine.Logger:LogException(Exception, Object) UnityEngine.Debug:LogException(Exception) UnityEngine.WaitUntil:get_keepWaiting() UnityEngine.UnitySynchronizationContext:Exec() UnityEngine.UnitySynchronizationContext:ExecuteTasks() (Filename: currently not available on il2cpp Line: -1)

I imported the dlls and used exactly the same code as the example projet. If you have any ideas, you are more than welcome 😄 Thanks !

EDIT : I made some research and found that the error is thrown here in the plugin. I added the number of media stream properties available after the error (_mediaCapture.VideoDeviceController.GetAvailableMediaStreamProperties(STREAM_TYPE).Count()) and it appears to be equal 0.

EDIT 2 : I tested to enable Vuforia in XRSettings of the Video Panel Example and it seems to work even with Vuroria. I wonder why the plugin does not found any camera parameters in my other project.. weird.

EDIT 3 : I also tried to change the capture pixel format from BGRA32 to PNG and it seems to avoid error. Despite the fact that the hook OnVideoModeStarted is called, it seems that the hook OnFrameSampleAcquired is never called and no frame is acquired...

antoined73 avatar Apr 23 '19 15:04 antoined73

Hello. I have the same issue when Debug or release for HL2. have you managed to resolve this issue?

Verm4 avatar Jul 15 '20 10:07 Verm4

Sorry, I do not work on this project anymore ans I do not remember if I've solved it and if i have, the way 😅 Sometimes a simple incompatibility between your Unity version and the framework can produce a lot of strange behaviors, so maybe it was only this ? Also, I was on HL1 not 2

antoined73 avatar Jul 15 '20 12:07 antoined73

@Verm4 I have the same issue when Debug or release for HL2. have you managed to resolve this issue?

aoko-sys avatar May 12 '21 10:05 aoko-sys