kandi background
Explore Kits

jcodec | library implementing a set of popular video | Messaging library

 by   jcodec Java Version: v0.2.3 License: BSD-2-Clause

 by   jcodec Java Version: v0.2.3 License: BSD-2-Clause

Download this library from

kandi X-RAY | jcodec Summary

jcodec is a Java library typically used in Messaging applications. jcodec has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.
JCodec is a library implementing a set of popular video and audio codecs. Currently JCodec supports:. JCodec is free software distributed under FreeBSD License.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • jcodec has a highly active ecosystem.
  • It has 983 star(s) with 288 fork(s). There are 78 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 196 open issues and 135 have been closed. On average issues are closed in 161 days. There are 11 open pull requests and 0 closed requests.
  • It has a positive sentiment in the developer community.
  • The latest version of jcodec is v0.2.3
jcodec Support
Best in #Messaging
Average in #Messaging
jcodec Support
Best in #Messaging
Average in #Messaging

quality kandi Quality

  • jcodec has 0 bugs and 0 code smells.
jcodec Quality
Best in #Messaging
Average in #Messaging
jcodec Quality
Best in #Messaging
Average in #Messaging

securitySecurity

  • jcodec has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • jcodec code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
jcodec Security
Best in #Messaging
Average in #Messaging
jcodec Security
Best in #Messaging
Average in #Messaging

license License

  • jcodec is licensed under the BSD-2-Clause License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
jcodec License
Best in #Messaging
Average in #Messaging
jcodec License
Best in #Messaging
Average in #Messaging

buildReuse

  • jcodec releases are available to install and integrate.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • It has 122124 lines of code, 7954 functions and 990 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
jcodec Reuse
Best in #Messaging
Average in #Messaging
jcodec Reuse
Best in #Messaging
Average in #Messaging
Top functions reviewed by kandi - BETA

kandi has reviewed jcodec and discovered the below as its top functions. This is intended to give you an instant insight into jcodec implemented functionality, and help decide if they suit your requirements.

  • Predict the cardinality factor .
  • Compute the CCTION matrix .
  • Read the header information
  • Returns the psd mixture .
  • 1 - D FIF algorithm
  • Converts a list of SPS NAL units into a list of NAL units
  • Estimates the half pen pixel .
  • Decodes a scan .
  • Decodes the reordered spectrum .
  • Calculate the gain for a given channel

jcodec Key Features

Video codecs H.264 main profile decoder; H.264 baseline profile encoder; VP8 decoder (I frames only); VP8 encoder (I frames only); MPEG 1/2 decoder ( I/P/B frames, interlace ); Apple ProRes decoder/encoder; JPEG decoder; PNG decoder/encoder. DivX/Xvid

Audio codecs SMPTE 302M decoder; AAC decoder (JAAD) RAW PCM.

Formats: MP4 ( MOV ) demuxer / muxer; MKV ( Matroska ) demuxer / muxer; MPEG PS demuxer; MPEG TS demuxer; WAV demuxer/muxer; MPEG Audio (MP3) demuxer; ADTS demuxer. DPX parser

Getting started

copy iconCopydownload iconDownload
<dependency>
    <groupId>org.jcodec</groupId>
    <artifactId>jcodec</artifactId>
    <version>0.2.5</version>
</dependency>

Getting a single frame from a movie ( supports only AVC, H.264 in MP4, ISO BMF, Quicktime container ):

copy iconCopydownload iconDownload
int frameNumber = 42;
Picture picture = FrameGrab.getFrameFromFile(new File("video.mp4"), frameNumber);

//for JDK (jcodec-javase)
BufferedImage bufferedImage = AWTUtil.toBufferedImage(picture);
ImageIO.write(bufferedImage, "png", new File("frame42.png"));

//for Android (jcodec-android)
Bitmap bitmap = AndroidUtil.toBitmap(picture);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream("frame42.png")); 

Get all frames from a video file

copy iconCopydownload iconDownload
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());
}

Getting a sequence of frames from a movie ( supports only AVC, H.264 in MP4, ISO BMF, Quicktime container ):

copy iconCopydownload iconDownload
double startSec = 51.632;
int frameCount = 10;
File file = new File("video.mp4");

FrameGrab grab = FrameGrab.createFrameGrab(NIOUtils.readableChannel(file));
grab.seekToSecondPrecise(startSec);

for (int i=0;i<frameCount;i++) {
    Picture picture = grab.getNativeFrame();
    System.out.println(picture.getWidth() + "x" + picture.getHeight() + " " + picture.getColor());
    //for JDK (jcodec-javase)
    BufferedImage bufferedImage = AWTUtil.toBufferedImage(picture);
    ImageIO.write(bufferedImage, "png", new File("frame"+i+".png"));

    //for Android (jcodec-android)
    Bitmap bitmap = AndroidUtil.toBitmap(picture);
    bitmap.compress(Bitmap.CompressFormat.PNG, 100, new FileOutputStream("frame"+i+".png")); 
}

H264 video from png images

copy iconCopydownload iconDownload
File output = new File("test.mp4");
SequenceEncoder enc = SequenceEncoder.createWithFps(NIOUtils.writableChannel(output), new Rational(1, 1));
String[] files = {"frame0.png", "frame1.png", "frame2.png"};
for (String file : files) {
   enc.encodeNativeFrame(AWTUtil.decodePNG(new File(file), ColorSpace.RGB));
}
enc.finish();

Read Tape Timecode from MXF file

copy iconCopydownload iconDownload
TapeTimecode timecode = MXFDemuxer.readTapeTimecode(new File("myfile.mxf"));

Parse DPX metadata

copy iconCopydownload iconDownload
DPXMetadata dpx = DPXReader.readFile(firstDpx).parseMetadata();
System.out.println(dpx.getTimecodeString());

Parse Apple GPS metadata from MOV or MP4 file

copy iconCopydownload iconDownload
MovieBox moov = MP4Util.parseMovie(new File("gps1.mp4"));
UdtaBox udta = NodeBox.findFirst(moov, UdtaBox.class, "udta");
String latlng = udta.latlng();
assertEquals("-35.2840+149.1215/", latlng);

Extract subtitles from MKV file

copy iconCopydownload iconDownload
MKVDemuxer demuxer = new MKVDemuxer(new AutoFileChannelWrapper(new File("subs.mkv")));
DemuxerTrack track = demuxer.getSubtitleTracks().get(0);
Packet packet;
while (null != (packet = track.nextFrame())) {
    String text = takeString(packet.getData());
    System.out.println("time: " + packet.pts + " text: " + text);
}

MP4/M4A/MOV metadata versions

copy iconCopydownload iconDownload
MoovVersions.listMoovVersionAtoms(new File("my.mp4"))

Array of Bitmaps into Video with ffmpeg

copy iconCopydownload iconDownload
for (int i = 0; i<bitmapArray.length(); i++){
    // Write to file while incrementing the file name
    writeToFile(bitmapArray[i], i);
}

Community Discussions

Trending Discussions on jcodec
  • Generation of a video with several images with jcodec
  • Does RTMP support the Display Orientation SEI Message in h264 streams?
  • Array of Bitmaps into Video with ffmpeg
Trending Discussions on jcodec

QUESTION

Generation of a video with several images with jcodec

Asked 2021-Nov-17 at 11:01

I'm using the last 0.2.5 version of jcodec to generate a video with several images. I'm doing this:

AWTSequenceEncoder encoder = AWTSequenceEncoder.createSequenceEncoder(file, 25);

Then for each image:

encoder.encodeImage(image);

The when I'm finished:

encoder.finish();

This return a corresponding video file, without any exception, and I see correctly the first image in VLC, for example, but it seems that the duration of the video is 0. What did I do wrong?

ANSWER

Answered 2021-Nov-17 at 11:01

It was my mistake, I did recreate the AWTSequenceEncoder each time I added an image.

Source https://stackoverflow.com/questions/69993021

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install jcodec

JCodec can be used in both standard Java and Android. It contains platform-agnostic java classes. To use the latest version of JCodec add the maven dependency as below:.
JCodec 0.2.5 JAR, GPG Sign, POM
JCodec JavaSE 0.2.5 JAR, GPG Sign, POM
Encoding using high-level API -- SequenceEncoderDemo.java;
Encoding/decoding using low-level API -- TranscodeMain.java;

Support

Making a video with a set of images from memory:.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.