Beispiel #1
0
        /**
         * Finds SPS & PPS parameters inside a .mp4.
         * @param path Path to the file to analyze
         * @throws IOException
         * @throws FileNotFoundException
         */
        public MP4Config(System.String path)
        {
            StsdBox stsdBox;

            // We open the mp4 file and parse it
            try {
                mp4Parser = MP4Parser.parse(path);
            } catch (IOException ignore) {
                // Maybe enough of the file has been parsed and we can get the stsd box
            }

            // We find the stsdBox
            stsdBox      = mp4Parser.getStsdBox();
            mPPS         = stsdBox.getB64PPS();
            mSPS         = stsdBox.getB64SPS();
            mProfilLevel = stsdBox.getProfileLevel();

            mp4Parser.close();
        }
 public System.String getProfileLevel()
 {
     return(MP4Parser.toHexString(sps, 1, 3));
 }
Beispiel #3
0
 public MP4Config(byte[] sps, byte[] pps)
 {
     mPPS         = Base64.EncodeToString(pps, 0, pps.Length, Base64Flags.NoWrap);
     mSPS         = Base64.EncodeToString(sps, 0, sps.Length, Base64Flags.NoWrap);
     mProfilLevel = MP4Parser.toHexString(sps, 1, 3);
 }
Beispiel #4
0
 public MP4Config(System.String sps, System.String pps)
 {
     mPPS         = pps;
     mSPS         = sps;
     mProfilLevel = MP4Parser.toHexString(Base64.Decode(sps, Base64Flags.NoWrap), 1, 3);
 }