Full mkv support & better avi support code ( multi strea (1 Viewer)

chanblard

Portal Member
June 22, 2005
24
0
WARNING :

I saw that in your cvs directory :
Code:
	bool AnalyseStreams()
		{
			sStreams_Sub_No_Subtitle.Id=0;
			sStreams_Sub_No_Subtitle.Filter="";
			cStreams_Audio=0;
			cStreams_Video=0;
			cStreams_Sub=0;
			sStreams_Audio=new FilterStreamInfos[MAX_AUDIOSTREAMS];
			sStreams_Video=new FilterStreamInfos[MAX_VIDEOSTREAMS];
			sStreams_Sub=new FilterStreamInfos[MAX_SUBSTREAMS];   

			IBaseFilter foundfilter=DirectShowUtil.GetFilterByName(graphBuilder,"Ogg Splitter");
			string filter="Ogg Splitter";
			if (foundfilter==null)
			{
				uint fetched=0;
				IEnumFilters enumFilters;
				graphBuilder.EnumFilters(out enumFilters);
				if (enumFilters!=null)
				{
					enumFilters.Reset();
					while (enumFilters.Next(1,out foundfilter,out fetched)==0)
					{
						if (foundfilter!=null && fetched==1)
						{
							IAMStreamSelect pStrm = foundfilter as IAMStreamSelect;
							if (pStrm!=null)
							{
								break;
							}
							Marshal.ReleaseComObject(foundfilter);
						}
					}
					Marshal.ReleaseComObject(enumFilters);
				}
			}

this code don't work because IAMStreamSelect pStrm = foundfilter as IAMStreamSelect; will return a good pStrm for DirectVobSub filter. The problem is that DirectVobSub don't allow to choose audio streams or subtitles streams , so your code see the DirectVobSub first and stop searching , you must use :

Code:
		  public bool AnalyseStreams()
	  {
		  //INITIALIZE
		  sStreams_Sub_No_Subtitle.Id=0;
		  sStreams_Sub_No_Subtitle.Filter="";
		  cStreams_Audio=0;
		  cStreams_Video=0;
		  cStreams_Sub=0;
		  sStreams_Audio=new FilterStreamInfos[MAX_AUDIOSTREAMS];
		  sStreams_Video=new FilterStreamInfos[MAX_VIDEOSTREAMS];
		  sStreams_Sub=new FilterStreamInfos[MAX_SUBSTREAMS];	

		  //RETRIEVING THE CURRENT SPLITTER
		  string filter="Ogg Splitter";
		  IBaseFilter foundfilter=DirectShowUtil.GetFilterByName(filter);
		  if (foundfilter==null && DirectShowUtil.GetFilterByName("Splitter")==null){
			  filter=(m_strCurrentFile.Length>=64)?m_strCurrentFile.Substring(0,64):m_strCurrentFile; 
			  foundfilter=DirectShowUtil.GetFilterByName(filter);
		  }

		  try{
			if (foundfilter!=null)
				{
					int cStreams=0;
					IAMStreamSelect pStrm = foundfilter as IAMStreamSelect;
					if (pStrm!=null)
					{
						pStrm.Count(out cStreams);
						//GET STREAMS
						for (int istream=0;istream<cStreams;istream++)
						{
							AMMediaType sType;AMStreamSelectInfoFlags sFlag;
							int sPDWGroup,sPLCid;string sName;
							object pppunk,ppobject;
							//STREAM INFO
							pStrm.Info(istream,out sType,out sFlag,out sPLCid,
								out sPDWGroup,out sName,out pppunk,out ppobject);

							//VIDEO
							if (sPDWGroup==0 && cStreams_Video<MAX_VIDEOSTREAMS)
							{
								sStreams_Video[cStreams_Video].Name=sName;
								sStreams_Video[cStreams_Video].Id=istream;
								sStreams_Video[cStreams_Video].Filter=filter;
								sStreams_Video[cStreams_Video].Current=false;
								if (cStreams_Video==0)
								{
									sStreams_Video[cStreams_Video].Current=true;
									pStrm.Enable(istream,0);
									pStrm.Enable(istream,AMStreamSelectEnableFlags.Enable);
								}
								cStreams_Video++;
							}
							else
								//AUDIO
								if (sPDWGroup==1 && cStreams_Audio<MAX_AUDIOSTREAMS)
							{
								sStreams_Audio[cStreams_Audio].Name=sName;
								sStreams_Audio[cStreams_Audio].Id=istream;
								sStreams_Audio[cStreams_Audio].Filter=filter;
								sStreams_Audio[cStreams_Audio].Current=false;
								if (cStreams_Audio==0)
								{
									sStreams_Audio[cStreams_Audio].Current=true;
									pStrm.Enable(istream,0);
									pStrm.Enable(istream,AMStreamSelectEnableFlags.Enable);
								}
								cStreams_Audio++;
							}
							else
								//SUBTITLE
								if (sPDWGroup==2 && cStreams_Sub<MAX_SUBSTREAMS && sName.LastIndexOf("off")==-1  && sName.LastIndexOf("No ")==-1&& sName.LastIndexOf("Miscellaneous ")==-1)
							{
								sStreams_Sub[cStreams_Sub].Name=sName;
								sStreams_Sub[cStreams_Sub].Id=istream;
								sStreams_Sub[cStreams_Sub].Filter=filter;
								sStreams_Sub[cStreams_Sub].Current=false;
								if (cStreams_Sub==0)
								{
									sStreams_Sub[cStreams_Sub].Current=true;
									pStrm.Enable(istream,0);
									pStrm.Enable(istream,AMStreamSelectEnableFlags.Enable);
								}
								cStreams_Sub++;
							}
							else 
								//NO SUBTITILE TAG
								if (sPDWGroup==2 && cStreams_Sub<MAX_SUBSTREAMS && (sName.LastIndexOf("off")!=-1 || sName.LastIndexOf("No ")!=-1))
							{
								sStreams_Sub_No_Subtitle.Id=istream;
								sStreams_Sub_No_Subtitle.Current=false;
								sStreams_Sub_No_Subtitle.Filter=filter;
								sStreams_Sub_No_Subtitle.Name=sName;
							}
						}
					}
					Marshal.ReleaseComObject(foundfilter);	
				}	
		  }
		  catch
		  {
		  }
		  if (foundfilter!=null)
			Marshal.ReleaseComObject(foundfilter);

		  return true;
	  }



My msn messenger mail is : blanchardseb@hotmail.com
 

cyberwizzard

New Member
December 15, 2005
1
0
I think you guys are talking about exactly the problem I'm facing: some if not most of my anime files are ogg, mkv or avi with embedded subtitles (rather than an external file) and for some reason they won't show.
I've installed VobSub, updated codecs and looked through the settings but I can't get embedded subtitles to work (even though they are listed in the GUI). For some reason switching to a different audio track works mostly fine.

Are these modifications in the 0.2 beta version or still only in CVS? And if they are indeed implemented, can I somehow debug the cause of this stuff not working?
 

andinaegnaeg

Portal Member
February 2, 2005
41
0
Kempten, Germany
I have to post some missing stuff. In RC1 the switching of audio streams within an avi file in "My Videos" worked perfect. In RC2 I don't see that option any more. :cry:

Is it possible to get that back in the future? It was very handy to have videos in different languages!

All in all you did a really good job and I love my Mediaportal-Computer!!!!

Thanks a lot!
Regards,
Andreas
 

andinaegnaeg

Portal Member
February 2, 2005
41
0
Kempten, Germany
I just want to pudh this thread up again. Has anyone a solution why switching audiostreas in My Videos doesn't work anymore with RC2? It did work wizhin 0.2 RC1!

Thanks to all developers! You did a great job! But pleas eintegrate the switching possibility again!

Thanks a lot!

Mediaportal-fan,
Andinaegnaeg
 

Users who are viewing this thread

Top Bottom