Infognition forum
May 18, 2012, 10:24:15 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Last GraphEditPlus version: 1.4.0   Last Video Enhancer version: 1.9.7
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Issue with Video Appearance  (Read 451 times)
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« on: December 29, 2011, 08:49:08 PM »

I know this might have nothing to do with GraphEditPlus, but since I don't find much information on google about it, I thought...
DirectShow video rendering gives me a fat green bar at the bottom of the video, I'm displaying the stream coming from the TV Tuner device and using FFDshow filter.
Anyone else got this behavior, any idea ?  
I know, in the development, before to jump and use DirectShow, I had this issue with Media Player Classic (MPC), changing the input format or output fixed it, but I barely remember.  Anyway, I would understand if the post is off topic and gets removed Smiley lol

Thanks.


Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 530



View Profile WWW
« Reply #1 on: December 30, 2011, 06:30:53 AM »

Can you show your graph and connections' media types?
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #2 on: December 30, 2011, 06:44:48 PM »

Here is the graph. Simple enough, input Source is AverMedia Tv Tuner.
Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 530



View Profile WWW
« Reply #3 on: December 31, 2011, 06:08:26 AM »

What are media types of connections to and from AVerMedia 7231 Analog Capture?
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #4 on: January 03, 2012, 05:13:24 PM »

I can't really tell what Media Type it is...
I never got able to connect these together without creating them using 'DisplayName'.
Here is how I create the 7231 Analog Xbar
Code:
//add AVerMedia 7231 Analog Xbar
            IBaseFilter pAVerMedia7231AnalogXbar = CreateFilter(@"@device:pnp:\\?\pci#ven_1131&dev_7231&subsys_06071461&rev_aa#4&25ba7335&0&00e1#{a799a801-a46d-11d0-a18c-00a02401dcd4}\{ed97d48c-e41e-11d5-9964-00e000000000}");
            System.Threading.Thread.Sleep(250);
            hr = graphBuilder.AddFilter(pAVerMedia7231AnalogXbar, "AVerMedia 7231 Analog Xbar");
            checkHR(hr, "Can't add AVerMedia 7231 Analog Xbar to graph");

And Here is How I create Smart Tee which connects to Analog Capture Output pin.
Code:
//add Smart Tee
            IBaseFilter pSmartTee = (IBaseFilter) new SmartTee();
            hr = graphBuilder.AddFilter(pSmartTee, "Smart Tee");
            checkHR(hr, "Can't add Smart Tee to graph");

I don't know what else to tell you and I hope I'm answering your question.
I will send you my code if you want.

TV stream coming from the Tv Tuner has that green bar at the bottom.
Image that shows the output...


Thanks.

Dave
« Last Edit: January 03, 2012, 07:16:27 PM by floydus » Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 530



View Profile WWW
« Reply #5 on: January 03, 2012, 08:06:16 PM »

You've shown above a graph built in GraphEditPlus. Just click the connections (the wires) and in the left bottom window where all objects properties are displayed you'll see information about media types. The interesting parts are Major Type, Sub Type, resolution, number of bits per pixel and Format Type.
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #6 on: January 03, 2012, 09:55:13 PM »

Ok, I got the requested information:

Between AverMedia 7231 Analog Xbar and AverMedia 7231 Analog Capture (Video IN)

The GraphEditPlus application crashes when requesting Format details (+) symbol
Unhandled exception : Not enough storage is available to process this command.

- FixedSizeSamples : True
- FormatSize : 48
- MajorType : AnalogVideo
- FormatType : AnalogVideo
- SubType : None (SubTypeGUID has a value of (E436...) Normal ?
- SampleSize : 1
- Format : dwActiveHeight --> 480
               dwActiveWidth --> 720
- rcSource (*crashes)
- rcTarget  (*crashes)

Between AverMedia 7231 Analog Xbar and AverMedia 7231 Analog Capture (Audio IN)

- FixedSizeSamples : False
- FormatSize : 0
- MajorType : AnalogAudio
- FormatType : None
- SubType : None (SubTypeGUID has a value of (E436...) Normal ?
- SampleSize : 1

Between AverMedia 7231 Analog Capture (Capture) and Smart Tee Input



And finally the Audio output from the analog capture entity :


That should really help.
There most be something really wrong, many values are different like the FormatSize, 48 and 88... hmmmm

What is really bizarre is that after many channel changes the green goes away...
But initially, it is always there. 
Is it possible to changes the output format values programmatically ?

Thanks again, looks like you really know what you're talking about Smiley I'm glad you do Smiley
« Last Edit: January 03, 2012, 11:37:29 PM by floydus » Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 530



View Profile WWW
« Reply #7 on: January 04, 2012, 11:08:00 AM »

Thanks!
Weird to hear GEP crashing there, probably something's really wrong in the format data or... I wonder how we can reproduce it without AverMedia hardware.

But provided info is enough to answer your question:
AverMedia 7231 Analog Capture gives you a 720x576 image but in its input we see:
dwActiveHeight --> 480             
dwActiveWidth --> 720
So the signal is 720x480 but the filter packs it into 720x576 output filling unused space with zeroes which in YUV colorspace (which it outputs) look as green color. If you don't want it, you should search for a way to configure AverMedia 7231 Analog Capture to output 720x480 or configure the source to provide 720x576.

Different format sizes of input and output are perfectly fine, because input and output has different formats (the former AnalogVideo, the latter VideoInfo), so they are described with different structures with different sizes.
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #8 on: January 04, 2012, 06:07:40 PM »

Thanks, at least I know what the issue really is.
Do you have any suggestions ?
Any DirectShow filter that would let me specify the source size ?
I'm using ffdshow as you know, and all I see is a resize section which is for the output...

AverMedia doesn't let me specify the source size.

Well thanks for your help Dee !

 
Logged
Milardo
Jr. Member
**

Karma: +1/-0
Posts: 54


View Profile
« Reply #9 on: January 05, 2012, 02:07:52 AM »

Hi, here is a filter that might work for resizing

http://www.reactor9.com/index.php?id=vp

www.reactor9.com/fileadmin/files_public/R9DsFilters_1.2.0.zip

http://www.reactor9.com/fileadmin/files/dependencies.zip

I think it is free with no limitations.

Extract the files and use the ds video processor filter.

There might be dependencies unless you already have those in system.

You might need this filter placed before the ds one, if color is funny. Also free

http://www.gdcl.co.uk/YUVxfm.zip

You can still use ffdshow after the ds filter.

Let me know if this helps you.
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #10 on: January 05, 2012, 05:47:40 PM »

I decided to do it via code, because CPU usage is important, here's what I came up with by searching on Google.
And it works like a charm, using OSD feature in ffdshow, I see the input and output are changed, and NO MORE GREEN BAR !

Thanks, Merci !

I think this needs to be done before connecting it, but once the capFilter is created of course.
Code:
//Resize the Input Source so that green bar goes away
SetConfigParms(pBuilder, pAVerMedia7231AnalogCapture, 0, 720, 480);
//connect AVerMedia 7231 Analog Capture and Smart Tee

hr = graphBuilder.ConnectDirect(GetPin(pAVerMedia7231AnalogCapture, "Capture"), GetPin(pSmartTee, "Input"), null);
checkHR(hr, "Can't connect AVerMedia 7231 Analog Capture and Smart Tee");

The resize function :
Code:
// Set the Framerate, and video size
private void SetConfigParms(ICaptureGraphBuilder2 capGraph, IBaseFilter capFilter, int iFrameRate, int iWidth, int iHeight)
        {
            int hr;
            object o;
            AMMediaType media;
            IAMVideoControl videoControl = capFilter as IAMVideoControl;

            Guid cat = PinCategory.Capture;
            Guid med = MediaType.Null;
            Guid iid = typeof(IAMStreamConfig).GUID;
            hr = capGraph.FindInterface(cat, med, capFilter, iid, out o);

            if (hr != 0)
            {
                // If not found, try looking for a video media type
                med = MediaType.Video;
                hr = capGraph.FindInterface(cat, med, capFilter, iid, out o);

                if (hr != 0)
                    o = null;
            }
            if (hr != 0)
            {
                // If not found, try looking for a video media type
                med = MediaType.AnalogVideo;
                hr = capGraph.FindInterface(cat, med, capFilter, iid, out o);

                if (hr != 0)
                    o = null;
            }
            IAMStreamConfig videoStreamConfig = (IAMStreamConfig)o;
            if (videoStreamConfig == null)
            {
                MessageBox.Show("Failed to get IAMStreamConfig");
            }

            videoStreamConfig.GetFormat(out media);
            try
            {
               
   
                DsError.ThrowExceptionForHR(hr);

                // copy out the videoinfoheader
                VideoInfoHeader v = new VideoInfoHeader();
                Marshal.PtrToStructure(media.formatPtr, v);

                // if overriding the framerate, set the frame rate
                if (iFrameRate > 0)
                {
                    v.AvgTimePerFrame = 10000000 / iFrameRate;
                }

                // if overriding the width, set the width
                if (iWidth > 0)
                {
                    v.BmiHeader.Width = iWidth;
                }

                // if overriding the Height, set the Height
                if (iHeight > 0)
                {
                    v.BmiHeader.Height = iHeight;
                }

                // Copy the media structure back
                Marshal.StructureToPtr(v, media.formatPtr, false);

                // Set the new format
                hr = videoStreamConfig.SetFormat(media);
                DsError.ThrowExceptionForHR(hr);

                DsUtils.FreeAMMediaType(media);
                media = null;
                if (videoControl != null)
                {
                    VideoControlFlags pCapsFlags;

                    IPin pPin = DsFindPin.ByCategory(capFilter, PinCategory.Capture, 0);
                    hr = videoControl.GetCaps(pPin, out pCapsFlags);
                    DsError.ThrowExceptionForHR(hr);

                    if ((pCapsFlags & VideoControlFlags.FlipVertical) > 0)
                    {
                        hr = videoControl.GetMode(pPin, out pCapsFlags);
                        DsError.ThrowExceptionForHR(hr);

                        hr = videoControl.SetMode(pPin, 0);
                    }
                }
            }
            finally
            {
                Marshal.ReleaseComObject(videoStreamConfig);
            }
        }


Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 530



View Profile WWW
« Reply #11 on: January 06, 2012, 09:27:01 AM »

Yes, IAMStreamConfig interface is the right way to set up video format of some filter. I'm glad to hear your particular filter supported this interface.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!