embed media player into c# interface play webm file

1,096 views
Skip to first unread message

heinekenball wade

unread,
Feb 21, 2012, 9:40:34 PM2/21/12
to WebM Discussion
hello,

I'm trying to embed a media player which could play .webm file. in c#
interface.

c# allow embed windows media player but it couldn't play .webm files,

but windows media player 12 could play .webm file when i click
the .webm file.

have any way to play webm file in c# interface?

thanks,

heinekenball wade

unread,
Feb 23, 2012, 1:13:07 AM2/23/12
to WebM Discussion
After decoded .webm to .yuv file, i could display frames in picturebox
now.
but i have a new problem, how could i display color correctly while
convert YUV(i420)to RGB.
below, is my example, frame size is 352*288, i got gray color frames
after the code...
have someone could give me advise?
//Y
int Y = MyStreamData[y * 352 + x];
//U
int V = MyStreamData[352*288 + (y * 352 + x)/4];
//V
int U = MyStreamData[352 * 288*5/4 + (y * 352 + x)/4];
//R
int R = (int)(Y + ( 1.4075 * (V - 128)));
//G
int G = (int)(Y - (0.3455 * (U - 128) - (0.7169 * (V - 128))));
//B
int B = (int)(Y + (1.7790 * (U - 128)));

Matthew Heaney

unread,
Feb 23, 2012, 1:57:02 PM2/23/12
to webm-d...@webmproject.org

There are both DirectShow components to play WebM files, and Media
Foundation components. WMP12 can play back WebM files if either is
installed on the system.

What version of windows are you using?

What components do you have installed?

What C# interface are you using?

Are you embedding WMP in a web page? Can you send us the HTML?

If your C# interface is simply for embedding WMP, then I think it
should work. But we need more to have more specifics about your C#
code, the HTML, your operating system, and the configuration of your
machine.

-Matt

Mike Melanson

unread,
Feb 23, 2012, 2:42:16 PM2/23/12
to webm-d...@webmproject.org
> After decoded .webm to .yuv file, i could display frames in picturebox
> now.
> but i have a new problem, how could i display color correctly while
> convert YUV(i420)to RGB.
> below, is my example, frame size is 352*288, i got gray color frames
> after the code...
> have someone could give me advise?

So the frames look correct, except that they're gray scale? Or are they
solid gray? If they're gray scale, that sounds like the U and V planes
were not decoded correctly. Print out the first few U & V values to
verify.

--
-Mike Melanson

heinekenball wade

unread,
Feb 24, 2012, 1:20:57 AM2/24/12
to WebM Discussion
Thanks for reply,

> What version of windows are you using?
Windows 7
> What components do you have installed?
my windows media player could play webm files out of my interface, but
if WMP embedded into interface it couldn't play webm.
> What C# interface are you using?
windows form application program.
> Are you embedding WMP in a web page?  Can you send us the HTML?
No.
> If your C# interface is simply for embedding WMP, then I think it
> should work.  But we need more to have more specifics about your C#
> code,
the standard video WMP could play, but webm couldn't.

thanks again.
ball,

heinekenball wade

unread,
Feb 24, 2012, 1:25:04 AM2/24/12
to WebM Discussion
> So the frames look correct, except that they're gray scale? Or are they
> solid gray? If they're gray scale, that sounds like the U and V planes
> were not decoded correctly. Print out the first few U & V values to
> verify.
i thought problem is i misunderstood the i420 format how the Y U V
stored.
no matter how i change U V, the color always wrong.
the same .yuv file could play correctly by vidview.exe
//U
int V = MyStreamData[352*288 + (y * 352 + x)/4];
//V
int U = MyStreamData[352 * 288*5/4 + (y * 352 + x)/4];

thanks and regards,
ball.

heinekenball wade

unread,
Feb 24, 2012, 5:01:22 AM2/24/12
to WebM Discussion
Excuse me,
if i want to transform YUV 4:2:0 to RGB
i need to transform YUV 4:2:0 to YUV 4:4:4 first,
and then transform to RGB.
or
YUV 4:2:0 could transfomr to RGB directly?

thanks,
ball.

Attila Nagy

unread,
Feb 24, 2012, 5:51:38 AM2/24/12
to webm-d...@webmproject.org
you can transform directly, just have to remember that chroma is subsampled on both vertical and horizontal.
for every 2x2 Y samples you get 1 U and 1 V sample.



remember also that I420 is top-down scanned while display expects bottom-up.

-Atti

ball.

--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To post to this group, send email to webm-d...@webmproject.org.
To unsubscribe from this group, send email to webm-discuss...@webmproject.org.
For more options, visit this group at http://groups.google.com/a/webmproject.org/group/webm-discuss/?hl=en.


Reply all
Reply to author
Forward
0 new messages