Java Code Examples for org.jcodec.common.NIOUtils#closeQuietly()

The following examples show how to use org.jcodec.common.NIOUtils#closeQuietly() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SequenceEncoderMp4.java    From ImageToVideo with Apache License 2.0 5 votes vote down vote up
public void finish() throws IOException {
    // Push saved SPS/PPS to a special storage in MP4
    outTrack.addSampleEntry(H264Utils.createMOVSampleEntry(spsList, ppsList, 4));

    // Write MP4 header and finalize recording
    muxer.writeHeader();
    NIOUtils.closeQuietly(ch);
}
 
Example 2
Source File: JCodecVideoDecoder.java    From cineast with MIT License 5 votes vote down vote up
@Override
public void close(){
	this.fg = null;
	NIOUtils.closeQuietly(this.channel);
	this.channel = null;
	LOGGER.info("closed JCodecVideoDecoder");
}
 
Example 3
Source File: ImageToMJPEGMOVMuxer.java    From CameraV with GNU General Public License v3.0 5 votes vote down vote up
public void finish() throws IOException {
	
	  videoTrack.addSampleEntry(MP4Muxer.videoSampleEntry(imageType, size, ENCODER_NAME));
      
    // Write MP4 header and finalize recording  
	  if (af != null)
		  audioTrack.addSampleEntry(MP4Muxer.audioSampleEntry(af));
	  
    muxer.writeHeader();
    NIOUtils.closeQuietly(ch);
}
 
Example 4
Source File: ImageToH264MP4Encoder.java    From CameraV with GNU General Public License v3.0 5 votes vote down vote up
public void finish() throws IOException {
    // Push saved SPS/PPS to a special storage in MP4
    outTrack.addSampleEntry(H264Utils.createMOVSampleEntry(spsList, ppsList, 4));

    audioTrack.addSampleEntry(MP4Muxer.audioSampleEntry(af));

    // Write MP4 header and finalize recording
    muxer.writeHeader();
    NIOUtils.closeQuietly(ch);
}
 
Example 5
Source File: ImageToVP8Encoder.java    From CameraV with GNU General Public License v3.0 4 votes vote down vote up
public void finish() throws IOException {
 
	muxer.mux(ch);
    NIOUtils.closeQuietly(ch);
}
 
Example 6
Source File: YUVtoWebmMuxer.java    From CameraV with GNU General Public License v3.0 2 votes vote down vote up
public void finish() throws IOException {

        NIOUtils.closeQuietly(ch);
    }