No audio/video pins found , no channel found (1 Viewer)

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
Just a kick note, YMPEG cannot be used, it's not a full directshow object, also the uninstaller leaves traces and dirt on the registry, took me 15m to clean the mess. Don´t install it unless you want it to encode directly to a file. Has no mpeg2 stream outputo to play with.
 

Azazyel

Portal Member
February 17, 2007
18
0
Home Country
To answer the OP's question. The "No analog audio/video pins found" error is because the system at the moment requires the audio to come from the capture card. So if you have a video capture and do the audio through the sound card (Line in or Mic), then it wont work.
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
Thinking aloud .....

Right Azazyel, the analog Xbar can be used to get the audio from several sources, depending on the driver or kind of hw, the audio and/or video can be taken from several sources. MP tryes to find the pins using several ways that unfortunately can't cover all the setups.

Yerterday finally found why some codecs simply refuse to work with MP, trying to change the pin settings with SetupCaptureFormat(); when the pins are already connected crashes the codec setup because the frame size and rate are usen on connection to populate the codec filter and most of them doesn't behave very well adapting to the intermediate states. Now i've learned that the AMStream parameters, specially the BmiHeader, must be set before connecting the pins, after that was changed most codecs connect and encode without any complaint.

Knowing that the defaults for several parts of the graph default to settings that don't fit the expected in several cases and that each vendor has their own way to handle the setups of the xbar (most defaut to 320x240 at 29f/sec), the codecs (some can adapt to pin changes some refuse intermediate states like or even change the framerate to 29 when changing the framesize), etc. I'm begining to believe that the only way is to costruct in a strict order, right now just by pushing up the above call before if (!AddAudioCompressor()) most codecs connect and run smoothly.

Graphedit saves exposed filter data as a key who mimics the struct that handles all the params of each filter, whatever its the object, xbar, codec, tuner, the data represents the state of the filter unit.

Knowing that i have changed each call on the process of building the worst case graph (my case & many others on the soft only analog way) represented on the code by this comments:

Code:
[FONT="Fixedsys"]    

    /// Adds the tv capture to the graph and connects it to the crossbar.
    /// At the end of this method the graph looks like:
    /// [          ] ------------------------->[           ]------>[               ]
    /// [ tvtuner  ]                           [ crossbar  ]       [ video capture ]
    /// [          ]----[            ]-------->[           ]------>[  filter       ]
    ///                 [ tvaudio    ]
    ///                 [   tuner    ]

/// Adds the multiplexer filter to the graph.
    // several posibilities
    //  1. no tv multiplexer needed
    //  2. tv multiplexer filter which is connected to a single encoder filter
    //  3. tv multiplexer filter which is connected to two encoder filter (audio/video)
    //  4. tv multiplexer filter which is connected to the capture filter
    // at the end this method the graph looks like this:

    //  option 2: single encoder filter
    //    [                ]----->[                ]      [             ]
    //    [ capture filter ]      [ encoder filter ]----->[ multiplexer ]
    //    [                ]----->[                ]      [             ]
    //
    //
    //  option 3: dual encoder filters
    //    [                ]----->[   video        ]    
    //    [ capture filter ]      [ encoder filter ]------>[             ]
    //    [                ]      [                ]       [             ]
    //    [                ]                               [ multiplexer ]
    //    [                ]----->[   audio        ]------>[             ]
    //                            [ encoder filter ]      
    //                            [                ]
    //
    //  option 4: no encoder filter
    //    [                ]----->[             ]
    //    [ capture filter ]      [ multiplexer ]
    //    [                ]----->[             ][/FONT]

The trick used was this construct on each AddXXXXXXX() call: (video encoder shown)
Code:
          // **** we have a encoder save a file just to know the name used
        FilterGraphTools.SaveGraphFile(_graphBuilder, videoDevices[i].Name+".grf");
        try // in case anything goes wrong ....
        {
            hr = _graphBuilder.RemoveFilter(tmp); // Remove the default filter from the graph
            Release.ComObject("videocompressor", tmp); // Release the object from mem
            tmp = null; // clrear the reference to enable garbage cleaning thread
            // Save a snapshot of the graph without the encoder 
            FilterGraphTools.SaveGraphFile(_graphBuilder, "erased bad encoder.grf");
            // Try to load our file with the single encoder + params saved before
            FilterGraphTools.LoadGraphFile(_graphBuilder, "single video compressor.grf");
            // point tmp to our single hacked filter (with parameters saved on data key!!!!)
            hr = _graphBuilder.FindFilterByName(videoDevices[i].Name, out tmp);
            if (hr != 0)
            {
                Log.Log.WriteFile("analog: yep! hacked video filter not found on graph????");
                // Save another snapshot to see why we didn't found the filter
                FilterGraphTools.SaveGraphFile(_graphBuilder, "video filter not found.grf");
            }
            Log.Log.WriteFile("analog: tmp must not be null here: " +tmp.ToString());
        }
        catch (Exception)
        {
            // if anything goes wrong above recall the original filter chosed by original code
            Log.Log.WriteFile("analog: we dont have a single video encoder graph defined yet?? :-(");
            // recover - bind original video filter to the graph
            hr = _graphBuilder.AddSourceFilterForMoniker(videoDevices[i].Mon, null, videoDevices[i].Name, out tmp);
        }

Before any criticism, yes it's a dirty and awful piece of code, but gave me the opportunity to test any setup to any filter and even combinations of them. In fact its easy, just load the "single whatever.grf" and hack at will, then restart the service and play until it fits the system.

This can also be applied to the xbar or to fit any filter combination using the infinite tee to suply singnal streams to other filters. But, as i just said it's a toy code snap, nothing worth to include on MP mainline.

Just wanted to share the idea with other people playing with the code.

Have a nice day!
 

hakuna

Portal Pro
October 15, 2004
395
1
48
Gothenburg
Home Country
Sweden Sweden
Have you come anywhere with this problem?
Kind of annoying seeing the card but not beeing able to use it since no channels are tuned.
Can you somehow find the channels with TVE2, export the data, remove the card from TVE2 and import the channel list to TVE3? Does that help?

/N
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
Dear hakuna I'm unhapppyly have to inform you that i have finally moved away from mediaportal to other lands, as a long time programmer, digging on the code gave me some crude aswers, that got me away from c# and way back to c++, too complex to give you an idea here & now but the inherent compiled msil code density/lack of history of DirectShow on C# is punching mp badly on its heart. Of course there are ways to solve all the analog problems but the needed strategic decissions will impact the core of the engine to the heart. My advice will be to completely separate the DVB & analog services, mixing all the funtions on a common graph builder is a nightmare. Now that TVEngine is service oriented, why keeping this as a single service engine instance?. You can have a DVBService and a ATSCService and AnalogService and IPTVService etc etc ... just define a common interface and let mpclient call/discover any service like you do when talking with plug-ins, it's just enhancing a piggy back protocol over rtsp, the service providers will pop out from the know how people arround the "other media ends". But.... as I already said, i'm now on other things, namely, a full mux multi -Pic-on-Pic remixer capable of streaming to standard Set top boxes of local cable providers on my country, bussiness is bussiness my friend ;-)

Wish you the best!!!!
 

hakuna

Portal Pro
October 15, 2004
395
1
48
Gothenburg
Home Country
Sweden Sweden
That's to bad.
What SW cards are supported?
Just curious since it seems that it should work, according to frodo on main news page anyway.

Great work anyways as always! /Niclas
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
Your best candidate will be a hardware encoding card like a Hauppauge pvr 150 mce with IR blasters or at least a pvr 250, the software only encoding land depends heavyly on the software bundled from the manufacturer or the purchase & installation of separate products to encode mpeg2 streams, mainly powerdirector and others from mainconcept and cyberlink, etc. But the first (hardware based encoding) its the best move if you, as i suspect, want to record from a cable box or any other kind of external tunner using an external channel changer. If your location is Göteborg, soon enough your country as many other european ones will be switched to dvb-t and analog tv will be almost useless so its better to be prepared for the change .....

Just to satisfy my curiosity, wich kind of card are you trying to fit on mp ?
 

gerhardo

Portal Member
January 20, 2007
12
0
Home Country
Sweden Sweden
fherrador: It was a very educating and entertaining read. Thanks for sharing!

I gave up since my card (Pinnacle PCTV Pro Stereo) does not use the audio encoding on the Brooktree chip. "Just because it should be possible" was not a strong enough reason to continue.

Note: Analogue is still used in most cable-tv networks, at least for the channels included by default even after Sweden completely turns of analog broadcast this fall. (Pay channels uses DVB-C often with encryption (using paired cards?).)
There is still use for analog cards, but HW encode is more or less required.
However, if you have a HD-ready TV, analog is a waste of resources anyway...
 

hakuna

Portal Pro
October 15, 2004
395
1
48
Gothenburg
Home Country
Sweden Sweden
Yes, I have cable, and there are some channels that is not FTA on DVB-T so I wan't to see them, even though the picture quality is crap.
If possible that is, otherwise the old CRT-TV has to do.
Oh, one thing that I could really use it for (well, I'd prefer world peace) is recording. But, most series are downloadable anyway...
It's a hobby, and now the sun is shining so I won't put tons of effort here, but if someone has a solution, it would be nice! :)

fherrador: I know HW is better, but if there is news about SW support, I'd like to know how it is possible.

Fridens liljor! /Niclas
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
This is exactly what happened with the biggest cable operator here in spain, called ono, now all channels work on dvb-c with a custom variation of cryptocard based on a ADB STB model ABQ-1H4G receiver so analog recording and irblasters are the only way to go. No dbv-c card was able to accept the card ..... bad luck .... My cpu is 10m away from the STB so a IRMEGABLaster is wanted .... ;-)
 

Users who are viewing this thread

Top Bottom