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

gerhardo

Portal Member
January 20, 2007
12
0
Home Country
Sweden Sweden
... here your are the list of supported encoders to go analog.

..but I have the Intervideo codec, but it is still not working. (printouts in another post, almost the same)
As SW seems to be working for some users, there is something that must be setup differently, or this only works with some SW cards.

I do not know how to investigate this.
Can someone post the graph working in MP (is this different from any working graph?)
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
Looks like the problem is that the filters proposed are, unavailable, old or named differently from the hardcoded ones.

I've made some hacking on TVLibrary.dll to fit a cheap product ($21) from MainConcept: but maybe its made only for MCE or Vista

http://www.mainconcept.com/site/index.php?id=17760

The pins behave differently and there is just one filter name "MainConcept (MCE Demo) MPEG Encoder" , the demo version works but puts an overlay on the upper left, checked with graphedit ok, but this is where all the fun stops, the xml graph looks like:

<connect direct="yes" src="Pinnacle_PCTV_300i_PAL_Stereo_BDA_Analog_Capture" srcpin="0" dest="MainConcept_(MCE_Demo)_MPEG_Encoder" destpin="Input Video"/>

<connect direct="yes" src="Pinnacle_PCTV_300i_PAL_Stereo_BDA_Analog_Capture" srcpin="3" dest="MainConcept_(MCE_Demo)_MPEG_Encoder" destpin="Input Audio"/>

When scanning with hacked TVLibrary.dll it ends up like:

8/2/2007 0:44:16 analog: AddAudioCompressor name:Audio Direction:Output
8/2/2007 0:44:16 analog: AddAudioCompressor found:9 compressor
8/2/2007 0:44:16 analog: try compressor:MainConcept (MCE Demo) MPEG Encoder
8/2/2007 0:44:16 analog: connect audio pin->audio compressor
8/2/2007 0:44:16 analog: failed to connect audio pin->audio compressor:80040217
8/2/2007 0:44:16 analog: failed to add audio compressor

I will keep investigating on this ...
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
Dead End .... ?

Well, changed my mind and switched to a new bunch of encoder codecs from Elecard (Basically a SDK from MainConcept) from here:

http://www.elecard.com/products/products-pc/sdk/encoder-sdk/

Hacked TVLibrary.dll to Use

Elecard Layer II Audio Encoder (elaenc.ax) for audio and

MainConcept MPEG-2 Video Encoder-Std (mcm2ve-std.ax) for video part

MediaPortal hard-routes-muxes that to a specific Power Director Cyberlink Muxer installed on Setup.msi (PDMpgMux.ax) alias "PDR MPEG Muxer" as we can see on svn at TvCardAnalogBase.cs CLSID:

2611 : yamp 12653 string monikerPowerDirectorMuxer = @"@device:sw:{083863F1-70DE-11D0-BD40-00A0C911CE86}\{7F2BBEAF-E11C-4D39-90E8-938FB5A86045}";
2612 : _filterAnalogMpegMuxer = Marshal.BindToMoniker(monikerPowerDirectorMuxer) as IBaseFilter;
2613 : int hr = _graphBuilder.AddFilter(_filterAnalogMpegMuxer, "Analog MPEG Muxer");

After all that, the thread handling that muxer eats 70-80% cpu, with a lot of jerks and hickups the video finally shows (after 15 to 30 seconds). Bad move...

So changed that muxer to CLSID 6770E328-9B73-40C5-91E6-E2F321AEDE57 (Cyberlynk Muxer MpegMux.ax) = good video but jerky audio on setuptv analog preview ..... but trying over rtsp and MP client all combinations hoged cpus to dead....

Maybe the MainConcept encoder is trying to "default" to a hq profile ..... don't know now .... still sniffing thread usage .... but something its now clear.

First there is some hardcoded likeness for Cyberlink PowerDirector filters on the actual code. And second, trying to encode a full frame interlaced analog video stream as MPEG2 is a nightmare for the CPU, but adding a streaming via rtsp to MP is a killer if client + server live in the same machine.

I will try to help further but doesn't know how to compile the svn or the tools needed .....

PD: Will any actual developper point me, teach me how to set-up a developping environment to compile the lib? Hacking all this by "hex-hand" is ... well tricky ...

Thanks!
 

gerhardo

Portal Member
January 20, 2007
12
0
Home Country
Sweden Sweden
Can the Pinnacle encoder be used?
The application they provide is really bad, but the application gives snappier video.
Anyway, interresting read.

I assume that there is no way to test this without rebuilding (or hacking DLL)?
(Is the basic setup with encoders/filters etc always the same?)
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
Tryed that gerhardo, i have a pctv 300i, also hate Pinnacle software included with it, but the muxer didn't liked the output from Pinnacle encoders in my tests (versions issue?, who knows!).

Your are right, I'm hacking the TVLibrary.dll with UltraEdit and some hex math to fit the string on place, but now I'm also downloading Visual C# 2005 Express and the svn trunk for TVLibrary to go for real coding.

(another nightmare becouse svn.exe gives me
svn: REPORT request failed on '/svnroot/mediaportal/!svn/vcc/default'
svn: REPORT of '/svnroot/mediaportal/!svn/vcc/default': Could not read response body: Secure connection truncated (https://svn.sourceforge.net)

but, eventually i will get all the code and try to fit a parametric way to change filternames / CLSIDS to test things faster and reach a working combination.

About setup .. well take a look here:

https://svn.sourceforge.net/svnroot/mediaportal/trunk/TvEngine3/Filters/bin/

install.bat reads:

regsvr32.exe /s MPFileWriter.ax
regsvr32.exe /s MpgMux.ax
regsvr32.exe /s PDMpgMux.ax
regsvr32.exe /s RtspSource.ax
regsvr32.exe /s TSFileSource.ax
regsvr32.exe /s TsWriter.ax

PDMpgMux.ax (PowerDirector Mpeg Muxer)
MpgMux.ax (Cyberlink)

I'm sure that there are good reasons to do that, but the analog way is different for each combination and I'm trying to avoid commercial or obsolete products in the solution.

Damn svn.exe .... stopped again .... my cable provider stinks!....

Good luck if you try with Pinnacle encoders, i haven't suceeded that way ....

remember that this is the list of filters that TVServer uses actually:

{ "InterVideo Audio Encoder", "Ulead MPEG Audio Encoder", "MainConcept MPEG Audio Encoder", "MainConcept Demo MPEG Audio Encoder", "CyberLink Audio Encoder", "CyberLink Audio Encoder(Twinhan)", "Pinnacle MPEG Layer-2 Audio Encoder", "MainConcept (Hauppauge) MPEG Audio Encoder", "NVIDIA Audio Encoder" };

{ "InterVideo Video Encoder", "Ulead MPEG Encoder", "MainConcept MPEG Video Encoder", "MainConcept Demo MPEG Video Encoder", "CyberLink MPEG Video Encoder", "CyberLink MPEG Video Encoder(Twinhan)", "MainConcept (Hauppauge) MPEG Video Encoder", "nanocosmos MPEG Video Encoder", "Pinnacle MPEG 2 Encoder" };

But (pherhaps my fault) the muxer (PDMux thing) rejected to connect the pins on my tests.

Let me know if you ring the bell..
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
May the analog (sw) way be with you Luke....

Well, now i (believe) have the part of the full picture, after recompiling TVLibrary a hundred+times with several hacks and what-if changes... men ... what a nightmare ... now i understand why sw encoding on MP its like a pain in the a**.

After lowering resolution to get some CPU available and several other hacks, i finally saw all the jazz inside TvCardAnalogBase.cs and the output graph is .... well a little part of the problem. The other is coding a way to set the right encoder parameters for each single card+cpu+codec+config, no encoder has a standard interface as far as i know and the default parameters are kinda off sense to run on-the-fly.

After playing a lot now i have the analog part running but eating almost 80% cpu, with scaled down 360x288 frames it gets better @50%, enough to use tools to trace CPU usage of the threads, but haven't seen the real light for now.

TVLibrary does their best to get (by any method available) a mpeg-2 stream from our analog thingy to fit them to the rest of the timesink+tshift code+all. Unfortunately doing so, the analog signal gets encoded + muxed + demuxed + muxed + TsSinked to file.

Take a look to the attached graphedit capture of what is happening under the hood when TVServer timeshifts.... (big image ahead)

Doing some hacks 2 steps (red rectangle) can be avoided, that helped, but the worst part is getting into the encoders to tweak the inner settings for our particular systems+cards+codecs combination, a real puzzle.

Finally I "hacked" a solution for my own configuration but must admit that its not a good approach. For the code guys out there, imagine what i have done with FilterGraphTools.LoadGraphFile(_graphBuilder, "hacked.grf"); and some glue code, dirty + shameless but .... enjoyed the game.

Now I finally understood the complex problem ahead and why other projects used Xgraph files like gb-pvr & others ... that way all the settings of the codecs used can be edited with graphedit saving a lot of headaches to the developper behind the scene. After playing with more than 8 kinds of encoders, could you believe that no one has simmilar patterns to reach the same settings?

But MP it's a very different approach and a good one in my own view, i will continue hacking my own hood until something really hits and really helps.

Yet, I don't think that any of my tricks has any value but, if anyone wants to know more please feel free to ask ... Now I'm gonna learn more about handling DirectShow filters parameters to tweak them until my poor 2.6Ghz cpu handles the whole task below 50% usage.

You know what?. Having also a PVR250 over the table, doing all this may not have any kind of sense but, heck,.. I want the Hybrid Pinnacle thingy to work on analog smoothly too and it will or ....

Nice weekend to all :D for reading ...
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
Finally found a way to put the settings on the encoders, but many drawbacks, changed analog resolution to 360x480 + tweaked the encoders to use less cpu. Now it works but the quality its not the same as 720x576

Now i'm trying to refine the graph a little more and also I'm having a hard time finding some sort of "free" MPEG-2 encoder to use. Elecard released some old versions as demo with a video logo overlay. Moonligth encodes just for 5 minutes, Pinnacle encoders can be used but with a very fast & undisturbed machine.

If anyone knows about a MPEG2 video & MPEG Layer II Audio encoder working as a DirectShow filter please point me where.

Cu
 

gerhardo

Portal Member
January 20, 2007
12
0
Home Country
Sweden Sweden
Interresting read...
I sure understand why Frodo et al prefers working on other functions: It is more fun to get a result. Thanks for the job guys!
The best way is likely a HW card (or should I skip cable, get an antenna and DVB?).
The prime reason is still "because it should be possible".

fherrador Thanks for the information. I have not got a solution working (but I have not even tried the code). In any case, it is an enjoyable read. The graph can be very useful.

Since mpeg2 is patented, there are few full downloads available. I have seen hints that ffdshow/mencoder (mplayer encoder) may work, but I have not found that they support function as Directshow encoder filters.

What about http://www.ympeg.com/download.htm?
Free version add logo but full version is not too expensive.

Question: Would the performance be better if the stream was stored non encoded and postprocessed?
(For instance ympeg has a cheap mpeg1 encoder.)
 

fherrador

Portal Member
January 30, 2007
28
1
62
Home Country
Spain Spain
Lets Play ....

Hi Gerhardo, wanna play a little?. OK!, update all to the latest svn and if you have a pinnacle card as i suspect, take a look here http://codec.kiev.ua/mpeg2.htm and add the Pinnacle codecs listed as Pinnacle MPEG2 CODEC box v.5.0.452, they will give you an error on install but forget about it. Then get the attached file (Pinnacle.zip), use Sysenum to get sure you have "Pinnacle MPEG 2 Encoder" on the Video compressors section and "Pinnacle MPEG Layer-2 Audio Encoder" on the Audio Compressors section.... next try to load Pinnacle.grf with graphedit.exe. No errors must be found, we're running .... Close graphedit for now...

Start setuptv and try to tune some channels with your analog card instance, hopefully the tunning will get running, wait a little, MP scans from channel 1-XXX, at least on Spain (there are no analog channels below 23 here so .... imagine), cancel it when some or all channels are on the list (by number or callid).

Try to preview a channel with setuptv preview button (this may work or not, this depends on many factors but again forget if you cant get audio/video or both), the target is at least, no errors and a black window (the preview). If your get audio and/or video = fantastic, it rocks with default params !! Dual core 3Ghz? x64 Overclocked???? No? Hickups?, sounds like a cat & dog figth??? Don't worry yet..

Use the "Manual" control section of setuptv and try to start timeshift on a well known channel, look at tuner:locked and the signal levels. If this happens whitout hickups (15-20 seconds be patient). Press "Record" wait a little and navigate to the recording folder to see if you have a file named after the chanel number.mpg or callid.mpg (maybe under a folder named "manual" under TVServer main installation directory. Stop the recording on Setuptv

Now try to open(play the xxx.mpg file ... may work, may not .... this depends on the filters your default player tries to use.... if it plays without major hickups we are doing well, really good .... (if you really want it to play by all means get mplayer.exe and point it to the file, never fails... unless the file is very very bad composed)

Finally start MediaPortal with the tvplugin already installed, connect to your TVServer and try to watch the same analog channel (for unknown reasons the first channel tunning operation may fail, just change to any other channel & back)

Then finally watch the cpu usage with task manager while watching a channel (better if you start MP in windowed mode).

If in all the above tests the CPU-Eating is too much for your system, here's the possible trick to get more smoothness, this Pinny drivers save the configuration on the registry when touched soooo .... get graphedit.exe and simply load the filters on it (just open the included Pinnacle.grf with graphedit.exe they will show up), right click on each of them and play at will with the settings, the filters will remember the changes when you close the dialog (stop & start TVServer service between tests if necessary), i attach my own settings on this post as gif screen capture for your reference, but your system may behave better/worse ... here you are on your own ...

An afterword .... if anything goes wrong ..... stalls, breaks, spills or simply blows up anything I can not be held responsible :D

Just in case 720x576 is too much for your setup I can give you a tricked down version of tvlibrary.dll just for testing "as proof of concept"...

Wish you the best!

PD: Using an accelerated hardware playing decoder suited for your display card on MP Client will help a lot, specially if you are doing all this only with one computer as I am.

PPD: All this is just a shotcut while MP gurus find their way through the "analog path", don't use this for "production" ;)

PPPD: As Pinnacle drivers are used none of this may work with another kind of cards, specially older AverTV running old VFW drivers ...
 

Users who are viewing this thread

Top Bottom