8000 Home · jcodec/jcodec Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Alex Zhukov edited this page Aug 12, 2017 · 7 revisions

Welcome to the jcodec wiki!

Basic FrameGrab usage

Decode all frames from a file

File file = new File("video.mp4");
FrameGrab grab = FrameGrab.createFrameGrab(NIOUtils.readableChannel(file));
Picture picture;
while (null != (picture = grab.getNativeFrame())) {
    System.out.println(picture.getWidth() + "x" + picture.getHeight() + " " + picture.getColor());
}

Picture range

Why did you decide to do -128..+127 instead of 0..255? Do all of the color transforms support -128..+127?

@svitvitskiy The range -128..127 was chosen because it is a native range for the byte type. Alternatively standard range of 0..255 could be used but this creates a necessity to use &0xff all the time in the code. All the transforms that used to be called *8Bit support this range in a form of adjusted clipping ranges. All the arithmetics is the same regardless of the actual range. The range conversion happens only when the final platform-specific image gets extracted (i.e. BufferedImage or Bitmap) if ever.

Custom video filter

Transcoder will automatically insert the necessary color transforms in between filters to build the pipeline. All we have to do is just declare that the filter inputs and outputs are RGB.

Clone this wiki locally
0