freeMXF.org

Open discussion about freeMXF.org tools and MXF in general
It is currently Thu Dec 13, 2018 11:45 pm
Board index » MXF Categories » freeMXF.org Tools



Post new topic Reply to topic  [ 5 posts ] 
Author
Search for:
Message

Offline
Board User

Joined: Fri Feb 12, 2010 8:28 am
Posts: 6

Post Posted: Wed Feb 17, 2010 11:11 am 
Top  
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:
  • GCWriter doesn't perform any interleaving. I can write my own interleaver though, but is there some kind of existing utility class in MXFLib that takes care of that?
  • GCWriter can only write one packet of essence data per stream per content package, since GCWriter::WriteQueueMap is a map<UInt32,WriteBlock> and not say a map<UInt32,list<WriteBlock> >. Is there a way around this problem? At the moment this also means I have to call Flush() after writing each packet due to the lack of fine grain interleaving


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.

 Profile  

Offline
Insider

Joined: Thu Apr 15, 2004 10:39 am
Posts: 198
Location: Scotland

Post Posted: Wed Feb 17, 2010 5:46 pm 
Top  
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.

 Profile WWW  

Offline
Board User

Joined: Fri Feb 12, 2010 8:28 am
Posts: 6

Post Posted: Thu Feb 18, 2010 9:11 am 
Top  
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.

 Profile  

Offline
Board User

Joined: Fri Feb 12, 2010 8:28 am
Posts: 6

Post Posted: Wed Mar 03, 2010 11:59 am 
Top  
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.

 Profile  


Post Posted: Thu Mar 04, 2010 8:09 am 
Top  
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

  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

Jump to:  


Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group :: Style based on FI Subice by phpBBservice.nl :: All times are UTC