Miyagi GUI - Videocontrol

kubatp

30-01-2015 17:57:56

Hi,
does anybody have experience with Videocontrol in Miyagi GUI? I cannot make it work. There are no examples in the project source code and I havent found any threads or help about it.
Does anyone use it successfully?
Thank you for help.

kubatp

01-02-2015 20:50:31

Noone has used this control?

Beauty

01-02-2015 22:12:59

Are videos in the feature list?
I don't know, because I never used Miyagi.
Possibly it's not supported.

Did you search in the Axiom forum?
Smiley80 developed Miyagi for Mogre and Axiom. (Axiom is a C# port of Ogre.)

Maybe there is also an alternative: Render a video to a texture, which is attached to a billboard.
Here I found a code snippet for Ogre:
http://www.ogre3d.org/tikiwiki/DirectSh ... re+texture
I think you find more about this somewhere else.

Good luck!

kubatp

02-02-2015 16:28:16

Are videos in the feature list? Yes, it is and it is a part of the project already for four years.

Did you search in the Axiom forum? Yes, I searched everywhere. Ogre, Mogre and Axiom forums, Google...

Maybe there is also an alternative: Render a video to a texture, which is attached to a billboard.
Here I found a code snippet for Ogre:
http://www.ogre3d.org/tikiwiki/DirectSh ... re+texture
I think you find more about this somewhere else.

VideoControl and VideoFileCapture internally use DirectShowLib
https://bitbucket.org/tbohnen/miyagi/src/b237fda4f725c61a72114ee1e9df4b98d36e7508/Projects/Addons/Miyagi.VideoControl/VideoControl.cs?at=default

https://bitbucket.org/tbohnen/miyagi/src/b237fda4f725c61a72114ee1e9df4b98d36e7508/Projects/Addons/Miyagi.VideoControl/DirectShow/VideoFileCapture.cs?at=default

The problem I am having is that when I am using media file (I tried different formats), it throws the exception on these lines
hr = icgb2.RenderStream(null, null, sourceFilter, baseGrabFlt, null);
DsError.ThrowExceptionForHR(hr);

"Unspecified error" in basethreadinitthunk.

When I try to render webcam, it seems to be ok, but I dont see anything inside the control (and I dont see the control as well).

smiley80

02-02-2015 17:33:30

There seems to be a problem with certain video codecs. I have to look into it. Unfortunately, I don't have much spare time and that code is mostly "proudly found elsewhere".

kubatp

02-02-2015 18:26:17

Hi Smiley,
so the control is not working or it is just on some machines/with some codecs?

smiley80

02-02-2015 19:02:50

I have an Xvid video which plays okay, and a WMV one which doesn't. But they both work okay with the AForge DirectShow player, so i don't think it's a codec issue.

kubatp

02-02-2015 19:11:50

I tried three videos
- avi with Indeo Video V4 (IV41)
- wmv with Windows Media Video VC1
- mp4 with H264 - MPEG4 AVC

and none of them worked for me (with the same exception).

What puzzles me even more is that downloaded DirectShowExamples http://sourceforge.net/projects/directshownet/files/DirectShowSamples/2010-February/ and tried it in PlayWnd player and WMV worked (the other ones didnt).

One more observation - I tried WebcamCapture instead of VideoFileCapture. There were no exception and I saw that the webcam was activated (with the diode indicator), but I didnt see anything on the screen. Here is the code:

VideoControl videoControl = new VideoControl("testvideo");
this.CurrentGUI.Controls.Add(videoControl);
videoControl.Capture = new Miyagi.VideoControl.DirectShow.WebcamCapture(VideoControl.CaptureDeviceNames[0]);
videoControl.Size = new Miyagi.Common.Data.Size(640, 400);
videoControl.Location = new Point(10, 10);
videoControl.Visible = true;
videoControl.MaxSize = videoControl.Size;
videoControl.AlwaysOnTop = true;
videoControl.HitTestVisible = true;
videoControl.Start();

Am I missing something?

kubatp

16-02-2015 16:07:20

Is there anything I can do to fix this issue on my side (for example use specific codec)?

Beauty

23-02-2015 19:42:49

I just wanted to know if anyone has had similar questions/issues as I have.
I never had problems with Miyagi, because I never used it.
Instead I just used Windows Forms outside of the render window.
No sweet look, but good enough for scientific applications.

When it's no Miyagi specific problem, I suggest to write a post in the Ogre main forum.
There are many more users. Most of them don't know Miyagi (because it's only for .NET), but there is a good chance that somebody knows how to embedd videos.
Once you know how you do it in Ogre, you can port the code to Miyagi.
Or you get ideas what's the problem with DirectShow, etc.

An idea:
Try to use render to texture (independent of Miyagi) to play videos.
When it works, you can use this texture for your Miyagi GUI.


it throws the exception on these lines
hr = icgb2.RenderStream(null, null, sourceFilter, baseGrabFlt, null);
DsError.ThrowExceptionForHR(hr);

"Unspecified error" in basethreadinitthunk.


You can try to use Mogre/Ogre libraries, which are compiled in debug mode.
Then you have a chance to step more deeply into the code to find the problematic lines in Ogre C++ code.
Either compile it yourself (easy with MogreBuilder) or use my precompiled binary bundle.

MogreBuilder links:
http://www.ogre3d.org/tikiwiki/MogreBuilder
https://bitbucket.org/mogre/mogrebuilder