Coder Social home page Coder Social logo

Comments (4)

bramp avatar bramp commented on June 28, 2024

Thanks for your feedback. I debated a few different implementations of supporting the OutputBuilder. However, I think you missed the done() method to go back to the original builder, for example:

List<String> args = new FFmpegBuilder()
  .setInput("input.mp4")     // Filename, or a FFmpegProbeResult

  .addOutput("output.mp4")   // Filename for the destination
    .setFormat("mp4")        // Format is inferred from filename, or can be set
    .setVideoCodec("libx264")     // Video using x264
    .done()

  .addOutput("output.flv")   // Filename for the destination
    .setFormat("flv")        // Format is inferred from filename, or can be set
    .done()

  .build();

If I understand your proposal you would prefer something like:

List<String> args = new FFmpegBuilder()
  .setInput("input.mp4")     // Filename, or a FFmpegProbeResult

  .addOutput(new FFmpegOutputBuilder()
    .setName("output.mp4") // Filename for the destination
    .setFormat("mp4")        // Format is inferred from filename, or can be set
    .setVideoCodec("libx264")     // Video using x264
  )   

  .addOutput(new FFmpegOutputBuilder()
    .setName("output.flv")   // Filename for the destination
    .setFormat("flv")        // Format is inferred from filename, or can be set
  )

  .build();

from ffmpeg-cli-wrapper.

genrym avatar genrym commented on June 28, 2024

Sorry, yes, I missed the done functionality. If this exists, my proposal lowers in priority.

Your elaboration of my proposal is correct.
This can simplify your example to the following:

List<String> args = new FFmpegBuilder()
   .setInput("input.mp4")     // Filename, or a FFmpegProbeResult

  .addOutput(createMP4Builder(15))    // with 15 FPS 
  .addOutput(createMP4Builder(30)     // with diff FPS
  .addOutput(createFLVBuilder())      // diff format 
  .build();

from ffmpeg-cli-wrapper.

bramp avatar bramp commented on June 28, 2024

So it turns out with very minimal changes, and without breaking the API, I was able to make this work. To avoid confusion, this won't be the main way used in the examples, but it will be documented, and tested.

from ffmpeg-cli-wrapper.

genrym avatar genrym commented on June 28, 2024

Wow, thanks for the enhancement, looks great :)

from ffmpeg-cli-wrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.