Skip to content

Commit f315cfc

Browse files
authored
Bump all the project/plugin deps to their latest versions. (#317)
* Updated the README.md. * Bump all the project/plugin deps to their latest versions. * Updated the use of javac-errorprone to latest. * Fix various issues detected by errorprone. * Disable error prone on Java 11 and below.
1 parent 0616541 commit f315cfc

30 files changed

+197
-129
lines changed

README.md

Lines changed: 45 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
FFmpeg Java
2-
===========
1+
# FFmpeg CLI Wrapper for Java
32

4-
by Andrew Brampton ([bramp.net](https://bramp.net)) (c) 2013-2014,2016
3+
by Andrew Brampton ([bramp.net](https://bramp.net)) (c) 2013-2024
54

65
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/bramp)
76

8-
A fluent interface to running FFmpeg from Java.
7+
A fluent interface for running FFmpeg from Java.
98

109
![Java](https://img.shields.io/badge/Java-8+-brightgreen.svg)
1110
[![Build Status](https://github.com/bramp/ffmpeg-cli-wrapper/actions/workflows/maven.yml/badge.svg)](https://github.com/bramp/ffmpeg-cli-wrapper/actions/workflows/maven.yml)
@@ -15,8 +14,7 @@ A fluent interface to running FFmpeg from Java.
1514

1615
[GitHub](https://github.com/bramp/ffmpeg-cli-wrapper) | [API docs](https://bramp.github.io/ffmpeg-cli-wrapper/)
1716

18-
Install
19-
-------
17+
## Install
2018

2119
We currently support Java 8 and above. Use Maven to install the dependency.
2220

@@ -28,12 +26,12 @@ We currently support Java 8 and above. Use Maven to install the dependency.
2826
</dependency>
2927
```
3028

31-
Usage
32-
-----
29+
## Usage
3330

3431
### Video Encoding
3532

3633
Code:
34+
3735
```java
3836
FFmpeg ffmpeg = new FFmpeg("/path/to/ffmpeg");
3937
FFprobe ffprobe = new FFprobe("/path/to/ffprobe");
@@ -73,64 +71,67 @@ executor.createTwoPassJob(builder).run();
7371
### Get Media Information
7472

7573
Code:
74+
7675
```java
7776
FFprobe ffprobe = new FFprobe("/path/to/ffprobe");
7877
FFmpegProbeResult probeResult = ffprobe.probe("input.mp4");
7978

8079
FFmpegFormat format = probeResult.getFormat();
8180
System.out.format("%nFile: '%s' ; Format: '%s' ; Duration: %.3fs",
82-
format.filename,
83-
format.format_long_name,
84-
format.duration
81+
format.filename,
82+
format.format_long_name,
83+
format.duration
8584
);
8685

8786
FFmpegStream stream = probeResult.getStreams().get(0);
8887
System.out.format("%nCodec: '%s' ; Width: %dpx ; Height: %dpx",
89-
stream.codec_long_name,
90-
stream.width,
91-
stream.height
88+
stream.codec_long_name,
89+
stream.width,
90+
stream.height
9291
);
9392
```
9493

9594
### Get progress while encoding
95+
9696
```java
9797
FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);
9898

9999
FFmpegProbeResult in = ffprobe.probe("input.flv");
100100

101101
FFmpegBuilder builder = new FFmpegBuilder()
102-
.setInput(in) // Or filename
103-
.addOutput("output.mp4")
104-
.done();
102+
.setInput(in) // Or filename
103+
.addOutput("output.mp4")
104+
.done();
105105

106106
FFmpegJob job = executor.createJob(builder, new ProgressListener() {
107107

108-
// Using the FFmpegProbeResult determine the duration of the input
109-
final double duration_ns = in.getFormat().duration * TimeUnit.SECONDS.toNanos(1);
110-
111-
@Override
112-
public void progress(Progress progress) {
113-
double percentage = progress.out_time_ns / duration_ns;
114-
115-
// Print out interesting information about the progress
116-
System.out.println(String.format(
117-
"[%.0f%%] status:%s frame:%d time:%s ms fps:%.0f speed:%.2fx",
118-
percentage * 100,
119-
progress.status,
120-
progress.frame,
121-
FFmpegUtils.toTimecode(progress.out_time_ns, TimeUnit.NANOSECONDS),
122-
progress.fps.doubleValue(),
123-
progress.speed
124-
));
125-
}
108+
// Using the FFmpegProbeResult determine the duration of the input
109+
final double duration_ns = in.getFormat().duration * TimeUnit.SECONDS.toNanos(1);
110+
111+
@Override
112+
public void progress(Progress progress) {
113+
double percentage = progress.out_time_ns / duration_ns;
114+
115+
// Print out interesting information about the progress
116+
System.out.println(String.format(
117+
"[%.0f%%] status:%s frame:%d time:%s ms fps:%.0f speed:%.2fx",
118+
percentage * 100,
119+
progress.status,
120+
progress.frame,
121+
FFmpegUtils.toTimecode(progress.out_time_ns, TimeUnit.NANOSECONDS),
122+
progress.fps.doubleValue(),
123+
progress.speed
124+
));
125+
}
126126
});
127127

128128
job.run();
129129
```
130130

131-
Building & Releasing
132-
--------------
131+
## Building & Releasing
132+
133133
If you wish to make changes, then building and releasing is simple:
134+
134135
```bash
135136
# To build
136137
mvn
@@ -148,8 +149,7 @@ git checkout ffmpeg-0.x
148149
mvn clean javadoc:aggregate scm-publish:publish-scm
149150
```
150151

151-
Bumpings Deps
152-
-----
152+
## Bumpings Deps
153153

154154
```bash
155155
# Update Maven Plugins
@@ -159,26 +159,24 @@ mvn versions:display-plugin-updates
159159
mvn versions:display-dependency-updates
160160
```
161161

162-
Install FFmpeg on Ubuntu
163-
-----------------
162+
## Install FFmpeg on Ubuntu
164163

165164
We only the support the original FFmpeg, not the libav version. Before Ubuntu 12.04, and in 15.04
166165
and later the original FFmpeg is shipped. If you have to run on a version with libav, you can install
167166
FFmpeg from a PPA, or using the static build. More information [here](http://askubuntu.com/q/373322/34845)
168167

169-
Get involved!
170-
-------------
168+
## Get involved
171169

172170
We welcome contributions. Please check the [issue tracker](https://github.com/bramp/ffmpeg-cli-wrapper/issues).
173171
If you see something you wish to work on, please either comment on the issue, or just send a pull
174172
request. Want to work on something else, then just open a issue, and we can discuss! We appreciate
175173
documentation improvements, code cleanup, or new features. Please be mindful that all work is done
176174
on a volunteer basis, thus we can be slow to reply.
177175

178-
Licence (Simplified BSD License)
179-
--------------------------------
180-
```
181-
Copyright (c) 2016-2022, Andrew Brampton
176+
## Licence (Simplified BSD License)
177+
178+
```plaintext
179+
Copyright (c) 2013-2024, Andrew Brampton
182180
All rights reserved.
183181
184182
Redistribution and use in source and binary forms, with or without

0 commit comments

Comments
 (0)