mardi 9 mars 2021

How to dynamically create an instance of Emgu.CV.VideoWriter c#?

I am simply trying to create an instance of the Emgu.CV.VideoWriter class. It doesn't work because the Size Parameter Value Conversion fails. I am passing the value new Size(1920 * 2, 1080 * 2). But debugging shows that the Invoker Method translates the value to (0, 0)??? Anybody an Idea Why?

This is my Code

            object[] para = new object[]
            {
                "<GUID>.mp4",
                /*backend_idx*/GetBackEndIndex(),
                /*video_codec*/VideoWriter.Fourcc('H', '2', '6', '4'),
                /*FPS*/ 15d,
                /*Size*/new Size(1920 * 2, 1080 * 2),
                /*IsColor*/true
            };

            var constructor = typeof(VideoWriter).GetConstructor(para.Select(p => p.GetType()).ToArray());
            VideoWriter obj = (VideoWriter)constructor.Invoke(para);




Aucun commentaire:

Enregistrer un commentaire