When I write 100 frames MFCreateFMPEG4MediaSink generates multiple moof+mdats.
How do I know how many frames are in each mdat with out parsing the atoms after it is generated ?
Is there a parameter I can set for MFCreateFMPEG4MediaSink so it forces that many frames.
thanks
Standard FMPEG4 media sink would typically package a few frames per moof box, e.g.
<MovieFragmentBox Size="368" Type="moof" Specification="p12" Container="file" TrackFragments="1">
<MovieFragmentHeaderBox Size="16" Type="mfhd" Version="0" Flags="0" Specification="p12" Container="moof" FragmentSequenceNumber="1"></MovieFragmentHeaderBox>
<TrackFragmentBox Size="344" Type="traf" Specification="p12" Container="moof" >
<TrackFragmentHeaderBox Size="28" Type="tfhd" Version="0" Flags="1" Specification="p12" Container="traf" TrackID="1" BaseDataOffset="1123"></TrackFragmentHeaderBox>
<TrackRunBox Size="308" Type="trun" Version="1" Flags="3841" Specification="p12" Container="traf" SampleCount="18" DataOffset="0">
<TrackRunEntry Duration="1000" Size="48020" CTSOffset="0" SamplePadding="0" Sync="1" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="61722" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="48737" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="49846" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="48625" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="34329" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="21388" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="23109" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="20293" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="22243" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="21375" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="22346" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="21611" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="22510" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="21539" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="22698" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="21864" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
<TrackRunEntry Duration="1000" Size="23394" CTSOffset="0" SamplePadding="0" Sync="0" DegradationPriority="0" IsLeading="0" DependsOn="0" IsDependedOn="0" HasRedundancy="0"/>
</TrackRunBox>
</TrackFragmentBox>
</MovieFragmentBox>
<MediaDataBox Size="555657" Type="mdat" Specification="p12" Container="file" dataSize="555649"></MediaDataBox>
(excerpt from one of files produced by MFCreateFMPEG4MediaSink
)
There is no setting to change this behavior. There is no reporting on the chosen value. You need to parse output bitstream to find it out if you need it.