Search in sources :

Example 1 with JCodecException

use of org.jcodec.api.JCodecException in project ddf by codice.

the class MpegTransportStreamMetadataExtractor method getProgramAssociationTable.

private void getProgramAssociationTable(final MTSPacket packet) throws JCodecException {
    final ByteBuffer payload = packet.getPayload();
    final int pointer = payload.get() & 0xff;
    payload.position(payload.position() + pointer);
    final PATSection programAssociationTable = PATSection.parse(payload);
    if (programAssociationTable == null) {
        throw new JCodecException("Program association table does not exist.");
    }
    programMapTablePacketIdDirectory.addAll(programAssociationTable.getPrograms().values());
    if (programMapTablePacketIdDirectory.isEmpty()) {
        throw new JCodecException("No programs found in transport stream.");
    }
}
Also used : JCodecException(org.jcodec.api.JCodecException) PATSection(org.taktik.mpegts.PATSection) ByteBuffer(java.nio.ByteBuffer)

Example 2 with JCodecException

use of org.jcodec.api.JCodecException in project BoofCV by lessthanoptimal.

the class JCodecSimplified method reset.

@Override
public void reset() {
    try {
        grabber = new FrameGrab(NIOUtils.readableFileChannel(new File(filename)));
    } catch (IOException | JCodecException e) {
        throw new RuntimeException(e);
    }
    try {
        frameCurrent = null;
        frameNext = grabber.getNativeFrame();
    } catch (IOException e) {
        frameNext = null;
    }
}
Also used : FrameGrab(org.jcodec.api.FrameGrab) JCodecException(org.jcodec.api.JCodecException) IOException(java.io.IOException) File(java.io.File)

Aggregations

JCodecException (org.jcodec.api.JCodecException)2 File (java.io.File)1 IOException (java.io.IOException)1 ByteBuffer (java.nio.ByteBuffer)1 FrameGrab (org.jcodec.api.FrameGrab)1 PATSection (org.taktik.mpegts.PATSection)1