freeMXF.org http://freemxf.org/forum/ |
|
What is the most correct/simple way to push essence data? http://freemxf.org/forum/viewtopic.php?f=2&t=194 |
Page 1 of 1 |
Author: | Tjoppen [ Wed Feb 17, 2010 11:11 am ] |
Post subject: | What is the most correct/simple way to push essence data? |
Hello, yet another newcomer to the boards here. I'm currently working on an MXF muxer as part of a larger system. I've managed to set up the preface/header partition fairly correct and I'm currently writing the essence data using a GCWriter. The result plays, and I can wrap a number of codecs already. One problem is that GCWriter doesn't do any index generation, which causes A/V desynchronization and an inability to seek. Therefore I have s small list of problems/questions regarding GCWriter:
It seems BodyWriter takes care of almost every thing I need, but it has one big problem: it pulls data rather than the user being able to push data onto it. To fix this I'd have to use some kind of FIFO like system with "fake" EssenceSources somehow synchronized with the one or several threads that are demuxing the input file(s). This seems like a way too hairy solution for my tastes (having already been forced to use a similar solution when sending raw data between callbacks). This all basically boils down to this: what is the simplest way to output internal essence data with index generation when said data is "pushed"? If this isn't possible with MXFLib yet, then I suppose I'll have to add a simple interleaver class and a a simple (VBR only) index generator class to the system. |
Author: | Matt Beard [ Wed Feb 17, 2010 5:46 pm ] |
Post subject: | |
The problem is that BodyWriter will select the appropriate essence stream at different times to maintain the requested file layout. If the writer is writing a partition with audio it is not much help to have you "push" video essence at it. The only ways to allow complex interleaves is to either use the pull model (as BodyWriter does) or buffer an open-ended quantity of essence from all sources. You probably need to build an essence source bufferer if you cannot allow the data to be pushed. I can give you advice on this if it helps. |
Author: | Tjoppen [ Thu Feb 18, 2010 9:11 am ] |
Post subject: | |
Well, converting the entire system to use a pull model is not really feasible. What I suspect may be possible though is that I perform my own interleaving (doable), use IndexManager to handle all the indexing, then somehow work those index tables in after GCWriter has finished writing the current partition (and/or put the tables in the footer). There is one problem though: GCWriter doesn't seem to be able to write more than one essence packet per stream before calling Flush() . If I'm reading the standards and the MXF book correctly this must be done whenever the audio packet rate (AU rate?) is higher than that of the video (which it typically is) - see figure 12.11. Since the incoming audio may be VBR I can't really just concatenate the packets' data before handing it off to GCWriter (something which the book seems to do for CBR audio). Assuming I'm correct, is there a way to hand data to GCWriter in such a way without having to rewrite its code? If not I suspect I have to change GCWriter::WriteQueueMap to a map<UInt32,list<WriteBlock> > as previously suggested, then rework the code a bit. |
Author: | Tjoppen [ Wed Mar 03, 2010 11:59 am ] |
Post subject: | |
Just a quick follow-up I should have posted earlier: I constrained the solution to only use PCM for now and wrote my own interleaver. Wasn't too hard and seems to work well enough, even with multiple channels and mixed bitdepths and samplerates. One question I do have now though: How to I align the preface to the KAG? It seems to be the only thing the MXF analyzer I have complains about now. I looked at MXFFile, Partition and essence.cpp but failed to find anything except MXFFile::Align(), but that only works prior to writing any partition (say the footer), now within the partition that is to be written. I suspect I have to make a minor modification to Partition for this to work. |
Author: | alicia ortis [ Thu Mar 04, 2010 8:09 am ] |
Post subject: | |
Matt Beard wrote: The problem is that BodyWriter will select the appropriate essence stream at different times to maintain the requested file layout. If the writer is writing a partition with audio it is not much help to have you "push" video essence at it.
The only ways to allow complex interleaves is to either use the pull model (as BodyWriter does) or buffer an open-ended quantity of essence from all sources. You probably need to build an essence source bufferer if you cannot allow the data to be pushed. I can give you advice on this if it helps. ..thanks for the idea! Wrinkle Cream Reviews |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |