Class MP4

  • All Implemented Interfaces:
    IStreamableFile, IMP4

    public class MP4
    extends Object
    implements IMP4
    A MP4Impl implements the MP4 api
    Author:
    The Red5 Project, Paul Gregoire, (mondain@gmail.com)
    • Field Detail

      • log

        protected static org.slf4j.Logger log
    • Constructor Detail

      • MP4

        public MP4()
        Default constructor, used by Spring so that parameters may be injected.
      • MP4

        public MP4​(File file)
        Create MP4 from given file source.
        Parameters:
        file - File source
    • Method Detail

      • hasMetaData

        public boolean hasMetaData()
        Returns a boolean stating whether the mp4 has metadata
        Specified by:
        hasMetaData in interface IMP4
        Returns:
        boolean true if file has injected metadata, false otherwise
      • hasKeyFrameData

        public boolean hasKeyFrameData()
        Returns a boolean stating whether a mp4 has keyframedata
        Specified by:
        hasKeyFrameData in interface IMP4
        Returns:
        boolean true if file has keyframe metadata, false otherwise
      • setKeyFrameData

        public void setKeyFrameData​(Map<?,​?> keyframedata)
        Sets the keyframe data of a mp4 file
        Specified by:
        setKeyFrameData in interface IMP4
        Parameters:
        keyframedata - Keyframe metadata
      • getKeyFrameData

        public Map<?,​?> getKeyFrameData()
        Gets the keyframe data
        Specified by:
        getKeyFrameData in interface IMP4
        Returns:
        keyframedata Keyframe metadata
      • refreshHeaders

        public void refreshHeaders()
                            throws IOException
        Refreshes the headers. Usually used after data is added to the mp4 file
        Specified by:
        refreshHeaders in interface IMP4
        Throws:
        IOException - Any I/O exception
      • readerFromNearestKeyFrame

        public ITagReader readerFromNearestKeyFrame​(int seekPoint)
        Returns a Reader closest to the nearest keyframe
        Specified by:
        readerFromNearestKeyFrame in interface IMP4
        Parameters:
        seekPoint - Point in file we are seeking around
        Returns:
        reader Tag reader closest to that point
      • writerFromNearestKeyFrame

        public ITagWriter writerFromNearestKeyFrame​(int seekPoint)
        Returns a Writer based on the nearest key frame
        Specified by:
        writerFromNearestKeyFrame in interface IMP4
        Parameters:
        seekPoint - Point in file we are seeking around
        Returns:
        writer Tag writer closest to that point
      • setMetaService

        public void setMetaService​(IMetaService service)
        Sets the MetaService through Spring
        Specified by:
        setMetaService in interface IMP4
        Parameters:
        service - Metadata service