protected ParsableBox createMvhd ( Movie movie ) { MovieHeaderBox mvhd = new MovieHeaderBox ( ) ; mvhd . setVersion ( 1 ) ; mvhd . setCreationTime ( getDate ( ) ) ; mvhd . setModificationTime ( getDate ( ) ) ; mvhd . setDuration ( 0 ) ; //no duration in moov for fragmented movies long movieTimeScale = movie . getTimescale ( ) ; mvhd . setTimescale ( movieTimeScale ) ; // find the next available trackId long nextTrackId = 0 ; for ( Track track : movie . getTracks ( ) ) { nextTrackId = nextTrackId < track . getTrackMetaData ( ) . getTrackId ( ) ? track . getTrackMetaData ( ) . getTrackId ( ) : nextTrackId ; } mvhd . setNextTrackId ( ++ nextTrackId ) ; return mvhd ; }
Creates a single mvhd movie header box for a given movie .