IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Use TSFileREader as basis for further development
Louis
post Jan 9 2013, 10:00 AM
Post #1


Be nice to me, I am new.


Group: New Members
Posts: 2
Joined: 4-January 13
Member No.: 15,266
Card: None


I am in the process of (trying) to write a Live Source filter and have been looking at the TSFileReader source code as a basis for my filter. I am just boggled by all the complexity of it all actually and I have been staring at the code and line-by-line debugging for the past 5 days or so.

The source filter I need to write is fairly simple. I must read a MPEG transport stream from a capture device and write it out to a demuxer. I will be using the MainConcept SDK for the rest of my graph (demux, decode, encode, etc). I don't care about rate control. I know my input stream will have just one video, one audio ES and no others and will always be program 0. I also don't need to support media seeking.

I can see that my source filter must create the output pins on the demuxer since I am a "push" source. I see how that is done in the demux.cpp code. What I don't understand is why all the complexity in the function CTSFileSourcePin::FillBuffer(). I thought it would be as simple as reading some number of bytes (188000 in TSFileSource) and writing them out to the demuxer and the demuxer should figure out what to do with the buffer.

There is a ton of code in CTSFileSourcePin::FillBuffer dealing with calculating PCRs and such but I don't know quite what it all means or if I need it. So, why all the PCR calculation complexity in the FillBuffer function?

Thanks,
Louis
Go to the top of the page
 
+Quote Post
bear
post Jan 9 2013, 04:30 PM
Post #2


Forum Regular


Group: Members
Posts: 3,099
Joined: 24-April 04
From: Queensland
Member No.: 808
Card: VisionPlus DVB-t


Hi Louis,

The TSFileSource code was initally developed for playback of transport stream files using the MS Demultiplexer, it has been further complicated for many other uses like timeshifting and live file changing etc. Not the best example for a simple capture Push Source filter. The purpose of PCR tracking is to maintain the correct stream rate into the demuxer as well as keep an accurate track of the file time etc.

The source code was built from the original "TSSource src.zip" code I recall from best memory, bisswanger (WinSTB@hotmail.com).

Another google suggestion is DVBTSource_2.0.1.5src.zip for a simpler version.
Go to the top of the page
 
+Quote Post
Louis
post Jan 10 2013, 05:41 AM
Post #3


Be nice to me, I am new.


Group: New Members
Posts: 2
Joined: 4-January 13
Member No.: 15,266
Card: None


QUOTE (bear @ Jan 9 2013, 05:30 PM) *
Hi Louis,

The TSFileSource code was initally developed for playback of transport stream files using the MS Demultiplexer, it has been further complicated for many other uses like timeshifting and live file changing etc. Not the best example for a simple capture Push Source filter. The purpose of PCR tracking is to maintain the correct stream rate into the demuxer as well as keep an accurate track of the file time etc.

The source code was built from the original "TSSource src.zip" code I recall from best memory, bisswanger (WinSTB@hotmail.com).

Another google suggestion is DVBTSource_2.0.1.5src.zip for a simpler version.



Thank you for the reply bear. Yes, I discovered that going back some number of versions, I can get a much simpler implementation as well but I'm still looking at 20K lines of code. I'll take a look at the suggested .ZIP file. I found another sample here http://www.pudn.com/downloads178/sourcecod...tail825386.html. It is a really bad sample, but very simple. It doesn't try to parse the TS file to get the pins which is a downside, but if you just run the graph for a moment, the demuxer will create its output pins and then you can build the rest of the graph. WIth your code, I see how I can create the pins on the demuxer myself.

I have been using your sample code with the MainConcept Push demuxer and it mostly works OK. Occasionally I run into a file that won't play properly but for the most part things work.

Louis
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 16th October 2018 - 11:51 PM