adding MediaEncoderCategory filters as TvEncoderFilters? (1 Viewer)

tanstaafl

Portal Member
December 19, 2007
13
0
Uppsala
Home Country
Sweden Sweden
I've experimented with changing AddTvEncoderFilter in
TvLibrary\Implementations\Analog\Components\Encoder.cs
so that it searches for encoding filters of FilterCategory.MediaEncoderCategory as well as of AMKSEncoder
category (relevant code snippet below).

I use this to enable "MCE-style" software encoder filter (video/audio input , mpeg2 out in single filter) with my
analog SW-encoding card, and it works well on my system.

I'm aware you want to restrict the use of SW-encoding filters to those known to work, but I'm wondering if there's
any particular reason SW/HW-filters are treated differently, i.e. HW-filters in AddTvEncoderFilter and SW-filters in
Add(Audio||Video)Compressor? From the system's point of view, there shouldn't be any difference between the
two types, should there?

To be clear, this is a general question, not really a suggestion for code change.

Code:
private bool AddTvEncoderFilter(bool matchPinNames, bool mpeg2ProgramFilter, IFilterGraph2 _graphBuilder, Tuner _tuner, TvAudio _tvAudio, Crossbar _crossbar, Capture _capture)
    {
      Log.Log.WriteFile("analog: AddTvEncoderFilter - MatchPinNames: {0} - MPEG2ProgramFilter: {1}", matchPinNames, mpeg2ProgramFilter);
      bool finished = false;
      DsDevice[] hwDevices;
	  DsDevice[] swDevices;
	  DsDevice[] devices;
		// first get all hw/sw encoder filters available on this system
      try
      {
		  swDevices = DsDevice.GetDevicesOfCat(FilterCategory.MediaEncoderCategory);
        hwDevices = DsDevice.GetDevicesOfCat(AMKSEncoder);
		devices = new DsDevice[hwDevices.Length + swDevices.Length];
		int idx = 0;
		for (int i = 0; i < hwDevices.Length; i++)
		{
			devices[idx] = hwDevices[i];
			idx++;
		}
		for (int i = 0; i < swDevices.Length; i++)
		{
			devices[idx] = swDevices[i];
			idx++;
		}
		
        devices = DeviceSorter.Sort(devices, _tuner.TunerName, _tvAudio.TvAudioName, _crossbar.CrossBarName, _capture.VideoCaptureName, _capture.AudioCaptureName, _videoEncoderDevice, _audioEncoderDevice, _multiplexerDevice);
// tanstaafl: no changes beyond this point
 

misterd

Retired Team Member
  • Premium Supporter
  • April 4, 2006
    1,597
    314
    Home Country
    Germany Germany
    There are many changes planned for 1.1.0 for the encoding section of analog cards, including adding support for "MCE-style" encoders.

    MisterD
     

    stalkersvr

    Portal Member
    April 12, 2009
    49
    16
    I'am try such method of patching. I think, that more correct to find MCE-style encoders in MediaMultiplexerCategory, because in MediaEncoderCategory there are some number of Audio/Video only encoders.
    But in Win7 in MediaMultiplexerCategory exist an "Microsoft MPEG-2 Encoder" that can be used in graph, but it does not show any audio/video in MediaPortal. So must be some sort of workaround for this encoder.
    But MainConcept (MCE) MPEG Encoder included with my Compro tuner works fine. Channel changed was more fasted and tv server use less cpu time.
     

    Users who are viewing this thread

    Top Bottom