本文整理汇总了Java中org.jcodec.containers.mp4.Brand.MP4属性的典型用法代码示例。如果您正苦于以下问题:Java Brand.MP4属性的具体用法?Java Brand.MP4怎么用?Java Brand.MP4使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.jcodec.containers.mp4.Brand
的用法示例。
在下文中一共展示了Brand.MP4属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SequenceEncoderMp4
public SequenceEncoderMp4(File out)
throws IOException
{
super(out);
this.ch = NIOUtils.writableFileChannel(out);
// Muxer that will store the encoded frames
muxer = new MP4Muxer(ch, Brand.MP4);
// Add video track to muxer
outTrack = muxer.addTrack(TrackType.VIDEO, 5);
// Allocate a buffer big enough to hold output frames
_out = ByteBuffer.allocate(1920 * 1080 * 6);
// Create an instance of encoder
encoder = new H264Encoder();
// Transform to convert between RGB and YUV
transform = ColorUtil.getTransform(ColorSpace.RGB, encoder.getSupportedColorSpaces()[0]);
// Encoder extra data ( SPS, PPS ) to be stored in a special place of
// MP4
spsList = new ArrayList<ByteBuffer>();
ppsList = new ArrayList<ByteBuffer>();
}
示例2: SequenceEncoderMp4
public SequenceEncoderMp4(File out)
throws IOException
{
super(out);
this.ch = NIOUtils.writableFileChannel(out);
// Muxer that will store the encoded frames
muxer = new MP4Muxer(ch, Brand.MP4);
// Add video track to muxer
outTrack = muxer.addTrack(TrackType.VIDEO, timeScale);
// Allocate a buffer big enough to hold output frames
_out = ByteBuffer.allocate(1920 * 1080 * 6);
// Create an instance of encoder
encoder = new H264Encoder();
// Transform to convert between RGB and YUV
transform = ColorUtil.getTransform(ColorSpace.RGB, encoder.getSupportedColorSpaces()[0]);
// Encoder extra data ( SPS, PPS ) to be stored in a special place of
// MP4
spsList = new ArrayList<ByteBuffer>();
ppsList = new ArrayList<ByteBuffer>();
}
示例3: SequenceImagesEncoder
public SequenceImagesEncoder(File out, int screenWidth, int screenHeight) throws IOException {
this.ch = NIOUtils.writableFileChannel(out);
// Transform to convert between RGB and YUV
transform = new RgbToYuv420(0, 0);
// Muxer that will store the encoded frames
muxer = new MP4Muxer(ch, Brand.MP4);
// Add video track to muxer
outTrack = muxer.addTrackForCompressed(TrackType.VIDEO, timescale);
// Allocate a buffer big enough to hold output frames
_out = ByteBuffer.allocate(screenWidth * screenHeight * 6);
// Create an instance of encoder
encoder = new H264Encoder();
// Encoder extra data ( SPS, PPS ) to be stored in a special place of
// MP4
spsList = new ArrayList<ByteBuffer>();
ppsList = new ArrayList<ByteBuffer>();
}
示例4: open
@Override
public void open(String _path, int width, int _height, int _fps) throws IOException {
path = _path;
height = _height;
fps = _fps;
ch = new FileChannelWrapper(FileChannel.open(Paths.get(path), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING));
// Muxer that will store the encoded frames
muxer = new MP4Muxer(ch, Brand.MP4);
// Add video track to muxer
outTrack = muxer.addTrack(TrackType.VIDEO, fps);
// Allocate a buffer big enough to hold output frames
_out = ByteBuffer.allocateDirect(width * height * 6);
// Create an instance of encoder
encoder = new H264Encoder(new JCodecUtils.JHVRateControl(20));
// Encoder extra data ( SPS, PPS ) to be stored in a special place of MP4
spsList = new ArrayList<>();
ppsList = new ArrayList<>();
toEncode = Picture.create(width, height, ColorSpace.YUV420J);
}
示例5: SequenceEncoder
public SequenceEncoder(File out, int frameRate) throws IOException {
this.ch = NIOUtils.writableFileChannel(out);
// Transform to convert between RGB and YUV
transform = new RgbToYuv420(0, 0);
// Muxer that will store the encoded frames
muxer = new MP4Muxer(ch, Brand.MP4);
// Add video track to muxer
outTrack = muxer.addTrackForCompressed(TrackType.VIDEO, frameRate);// original frmae rate is 25
// Allocate a buffer big enough to hold output frames
_out = ByteBuffer.allocate(1920 * 1080 * 6);
// Create an instance of encoder
encoder = new H264Encoder();
// Encoder extra data ( SPS, PPS ) to be stored in a special place of
// MP4
spsList = new ArrayList<ByteBuffer>();
ppsList = new ArrayList<ByteBuffer>();
}
示例6: SequenceEncoder
public SequenceEncoder(File out) throws IOException {
this.ch = NIOUtils.writableFileChannel(out);
// Muxer that will store the encoded frames
muxer = new MP4Muxer(ch, Brand.MP4);
// Add video track to muxer
outTrack = muxer.addTrack(TrackType.VIDEO, 25);
// Allocate a buffer big enough to hold output frames
_out = ByteBuffer.allocate(1920 * 1080 * 6);
// Create an instance of encoder
encoder = new H264Encoder();
// Transform to convert between RGB and YUV
transform = ColorUtil.getTransform(ColorSpace.RGB, encoder.getSupportedColorSpaces()[0]);
// Encoder extra data ( SPS, PPS ) to be stored in a special place of
// MP4
spsList = new ArrayList<ByteBuffer>();
ppsList = new ArrayList<ByteBuffer>();
}
示例7: ImageToH264MP4Encoder
public ImageToH264MP4Encoder(SeekableByteChannel ch, AudioFormat af) throws IOException {
this.ch = ch;
this.af = af;
// Muxer that will store the encoded frames
muxer = new MP4Muxer(ch, Brand.MP4);
// Add video track to muxer
outTrack = muxer.addTrack(TrackType.VIDEO, 25);
// Create an instance of encoder
encoder = new H264Encoder();
// Transform to convert between RGB and YUV
transform = ColorUtil.getTransform(ColorSpace.RGB, encoder.getSupportedColorSpaces()[0]);
// Encoder extra data ( SPS, PPS ) to be stored in a special place of
// MP4
spsList = new ArrayList<ByteBuffer>();
ppsList = new ArrayList<ByteBuffer>();
if (af != null)
audioTrack = muxer.addPCMAudioTrack(af);
}
示例8: initalize
/**
* Initalize a compress class
*
* @param fileHandle - resource to mpeg4 file
* @param width - video width
* @param height - video height
* @throws IOException
*/
public void initalize(File fileHandle, int width, int height) throws IOException{
this.width=width;
this.height=height;
ch=NIOUtils.writableFileChannel(fileHandle);
muxer=new MP4Muxer(ch, Brand.MP4);
outTrack=muxer.addTrackForCompressed(TrackType.VIDEO, frameRate);
outBuffer=ByteBuffer.allocate(width * height * 6);
transform=new RgbToYuv420(0, 0);
encoder=new H264Encoder();
spsList=new ArrayList<ByteBuffer>();
ppsList=new ArrayList<ByteBuffer>();
frameNo=0;
}
示例9: Encoder
public Encoder(File out, int width, int height) throws IOException {
this.ch = NIOUtils.writableFileChannel(out);
_out = ByteBuffer.allocate(width * height * 6);
encoder = new H264Encoder();
spsList = new ArrayList<ByteBuffer>();
ppsList = new ArrayList<ByteBuffer>();
this.ch = NIOUtils.writableFileChannel(out);
muxer = new MP4Muxer(ch, Brand.MP4);
outTrack = muxer.addTrackForCompressed(TrackType.VIDEO, 25);
}
示例10: SequenceMuxer
public SequenceMuxer(File out) throws IOException {
this.ch = NIOUtils.writableFileChannel(out);
// Muxer that will store the encoded frames
muxer = new MP4Muxer(ch, Brand.MP4);
// Add video track to muxer
outTrack = muxer.addTrack(TrackType.VIDEO, 25);
}
示例11: MP4Muxer
public MP4Muxer(SeekableByteChannel output) throws IOException {
this(output, Brand.MP4);
}
示例12: VirtualMovie
public VirtualMovie(VirtualTrack... tracks) throws IOException {
this(Brand.MP4, tracks);
}
示例13: ImageToMJPEGMOVMuxer
public ImageToMJPEGMOVMuxer(SeekableByteChannel ch, AudioFormat af, int framesPerSecond) throws IOException {
this.ch = ch;
this.af = af;
this.framesPerSecond = framesPerSecond;
// Muxer that will store the encoded frames
muxer = new WebOptimizedMP4Muxer(ch, Brand.MP4, 4096*4);
// Add video track to muxer
videoTrack = muxer.addTrack(TrackType.VIDEO, framesPerSecond);
muxer.addTimecodeTrack(framesPerSecond);
videoTrack.setTgtChunkDuration(new Rational(3, 1), Unit.SEC);
if (af != null)
audioTrack = muxer.addPCMAudioTrack(af);
}