Comments (5)
Or you can do something like this : https://github.com/davinkevin/Podcast-Server/blob/master/Backend/src/main/java/lan/dk/podcastserver/service/FfmpegService.java
try { Files.deleteIfExists(target); // Creation of string containing all input file ordered String filesStrings = Lists.newArrayList(files) .stream() .map(f -> f.getFileName().toString()) .map(p -> "file '" + p + "'") .collect(joining(System.getProperty("line.separator"))); // Saving this in a temp file listOfFiles = Files.createTempFile(target.getParent(), "ffmpeg-list-", ".txt"); Files.write(listOfFiles, filesStrings.getBytes()); // Used this txt file as input FFmpegBuilder builder = new FFmpegBuilder() .setInput(listOfFiles.toAbsolutePath().toString()) .setFormat(FORMAT_CONCAT) .addOutput(target.toAbsolutePath().toString()) .setAudioCodec(CODEC_COPY) .setVideoCodec(CODEC_COPY) .done(); fFmpegExecutor.createJob(builder).run(); } catch (IOException e) { log.error("Error during Ffmpeg concat", e); } finally { Path finalListOfFiles = listOfFiles; if (nonNull(listOfFiles)) Try.of(() -> Files.deleteIfExists(finalListOfFiles)); }
What is CODEC_COPY?
from ffmpeg-cli-wrapper.
Currently this is not possible.
You can do the following:
List<String> args = new FFmpegBuilder()
.addInput("input1")
.addInput("input2")
.addOutput("output.mp4")
.done()
.build();
But that won't do what I think you are asking. I'm going to say without additional changes, we can't concat videos together.
I'll turn this into a feature request.
from ffmpeg-cli-wrapper.
Or you can do something like this : https://github.com/davinkevin/Podcast-Server/blob/master/Backend/src/main/java/lan/dk/podcastserver/service/FfmpegService.java
try {
Files.deleteIfExists(target);
// Creation of string containing all input file ordered
String filesStrings = Lists.newArrayList(files)
.stream()
.map(f -> f.getFileName().toString())
.map(p -> "file '" + p + "'")
.collect(joining(System.getProperty("line.separator")));
// Saving this in a temp file
listOfFiles = Files.createTempFile(target.getParent(), "ffmpeg-list-", ".txt");
Files.write(listOfFiles, filesStrings.getBytes());
// Used this txt file as input
FFmpegBuilder builder = new FFmpegBuilder()
.setInput(listOfFiles.toAbsolutePath().toString())
.setFormat(FORMAT_CONCAT)
.addOutput(target.toAbsolutePath().toString())
.setAudioCodec(CODEC_COPY)
.setVideoCodec(CODEC_COPY)
.done();
fFmpegExecutor.createJob(builder).run();
} catch (IOException e) {
log.error("Error during Ffmpeg concat", e);
} finally {
Path finalListOfFiles = listOfFiles;
if (nonNull(listOfFiles)) Try.of(() -> Files.deleteIfExists(finalListOfFiles));
}
from ffmpeg-cli-wrapper.
Oh awesome example. So it is possible using the concat format and copy codec.
Closing this as it is possible.
from ffmpeg-cli-wrapper.
This conflicts with ".overrideOutputFiles(true)"!
from ffmpeg-cli-wrapper.
Related Issues (20)
- Is there a way to remove audio using ffmpeg-cli-wrapper? HOT 2
- Passlog files not deleted when custom pass directory is set
- Get console output of FFMPEG.run command | volume detect HOT 1
- CVE-2023-39018: Assumed code injection vulnerability of `net.bramp.ffmpeg.FFmpeg.<constructor>` HOT 12
- This is an issue created by mistake.
- Release a new version HOT 2
- How to perform screen recorder using this library?
- FFmpegChapter id needs to be a long HOT 4
- FFmpegJob running. how to do force stop job? HOT 1
- Re-attaching to the progress TCP port HOT 1
- How To Use FFmpegBuilder Create The Thumb Image
- invalid time 'N/A' when use progress listener HOT 6
- Add missing Attachment codec types
- Replace animal sniffer with javac parameters
- Plan for moving to newer java versions + modernising library HOT 20
- Add FFmpegInputBuilder to support per input options HOT 1
- Publish a 0.9 version HOT 11
- Generating an incorrect command with a parameter "-f" HOT 2
- Why does `.addExtraArgs` call have to be added after `.addOutput` call? HOT 1
- Can I output to memory as byte array or buffer directly without creating a file?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ffmpeg-cli-wrapper.