Package org.jaudiotagger.audio.exceptions

Examples of org.jaudiotagger.audio.exceptions.CannotReadVideoException


                    || ftyp.getMajorBrand().equals(Mp4FtypBox.Brand.APPLE_AUDIO.getId())) {
                //Ok, need to do further checks on this track to ensure it is a scene descriptor
                //Level 3-Searching for "mdia" within "trak"
                boxHeader = Mp4BoxHeader.seekWithinLevel(mvhdBuffer, Mp4NotMetaFieldKey.MDIA.getFieldName());
                if (boxHeader == null) {
                    throw new CannotReadVideoException(ErrorMessage.MP4_FILE_IS_VIDEO.getMsg());
                }
                //Level 4-Searching for "mdhd" within "mdia"
                boxHeader = Mp4BoxHeader.seekWithinLevel(mvhdBuffer, Mp4NotMetaFieldKey.MDHD.getFieldName());
                if (boxHeader == null) {
                    throw new CannotReadVideoException(ErrorMessage.MP4_FILE_IS_VIDEO.getMsg());
                }
                //Level 4-Searching for "minf" within "mdia"
                mvhdBuffer.position(mvhdBuffer.position() + boxHeader.getDataLength());
                boxHeader = Mp4BoxHeader.seekWithinLevel(mvhdBuffer, Mp4NotMetaFieldKey.MINF.getFieldName());
                if (boxHeader == null) {
                    throw new CannotReadVideoException(ErrorMessage.MP4_FILE_IS_VIDEO.getMsg());
                }

                //Level 5-Searching for "nmhd" within "minf"
                //Only an audio track would have a nmhd frame
                boxHeader = Mp4BoxHeader.seekWithinLevel(mvhdBuffer, Mp4NotMetaFieldKey.NMHD.getFieldName());
                if (boxHeader == null) {
                    throw new CannotReadVideoException(ErrorMessage.MP4_FILE_IS_VIDEO.getMsg());
                }
            } else {
                //logger.info(ErrorMessage.MP4_FILE_IS_VIDEO.getMsg() + ":" + ftyp.getMajorBrand());
                throw new CannotReadVideoException(ErrorMessage.MP4_FILE_IS_VIDEO.getMsg());
            }
        }

        //Build AtomTree to ensure it is valid, this means we can detect any problems early on
        Mp4AtomTree atomTree = new Mp4AtomTree(raf, false);
View Full Code Here

TOP

Related Classes of org.jaudiotagger.audio.exceptions.CannotReadVideoException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.