This article brings you an introduction to the tools used by Java to process audio, video, documents, and pictures. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
For developers, the operation of files is often essential, but it may feel strange. This article provides you with some available tools to help you process various types of documents.
Audio, Video
Recommended tool: FFmpeg, which provides a complete solution for recording, converting and streaming audio and video, and can be used on Linux, Windows, Mac OS X and other platforms After compiling and running, we can create a script tool class and encapsulate it for use by the program. It can quickly obtain various parameters of audio and video format files, including duration, bit rate, frame rate, etc. And it supports many file formats, so you can use it with confidence. In addition, we can also use it to do other advanced operations such as cropping audio and video, converting audio and video, etc.
Document
Recommended tool: POI, this is really powerful. It can operate doc, docx, xls, xlsx, ppt, pptx version of office files, and can obtain the attributes of the file. , content and other information, and its Maven dependencies:
<properties> <poi.version>3.17</poi.version> </properties> ... <dependencies> <!--操作office的JAR包 --> <!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>${poi.version}</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>${poi.version}</version> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-scratchpad --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-scratchpad</artifactId> <version>${poi.version}</version> </dependency> </dependencies>
Also recommended is a tool for processing PDF files: PDFBox, which is very good and powerful. Everyone who has used it says it is good!
File conversion tool: jodconverter, enjoy converting it!
Picture: im4java, you need to install GraphicsMagick. You can get the picture DPI, width, height and the number of pages of tiff type, etc. You can also perform other processing on the picture, such as cropping, converting formats, etc. im4java's Maven dependency:
<!-- https://mvnrepository.com/artifact/org.im4java/im4java --> <dependency> <groupId>org.im4java</groupId> <artifactId>im4java</artifactId> <version>1.4.0</version> </dependency>
The above are the useful tools I have compiled for processing files. There is a lot of information on the usage of each of them on the Internet. I hope that the programmer brothers will no longer be confused after reading it. There is a direction for development!
This article has ended here. For more other exciting content, you can pay attention to the Java Tutorial Video column of the PHP Chinese website!
The above is the detailed content of Introduction to tools used by java to process audio, video, documents, and pictures. For more information, please follow other related articles on the PHP Chinese website!