Search in sources :

Example 1 with FadeAudioVideoFilterExec

use of org.fagu.fmv.core.exec.filter.FadeAudioVideoFilterExec in project fmv by f-agu.

the class FadeAudioVideo method run.

/**
 * @see org.fagu.fmv.cli.Command#run(java.lang.String[])
 */
@Override
public void run(String[] args) {
    if (args.length != 4) {
        help();
        return;
    }
    // TEST
    Optional<Identifiable> identifiableOpt = BaseIdentifiable.findById(project, args[1]);
    if (!identifiableOpt.isPresent()) {
        println("not found: " + args[1]);
        return;
    }
    FadeType fadeType = FadeType.valueOf(args[0].toUpperCase());
    Time startTime = Time.parse(args[2]);
    Duration duration = Duration.parse(args[2]);
    Identifiable identifiable = identifiableOpt.get();
    FadeAudioVideoFilterExec filterExec = new FadeAudioVideoFilterExec(project, fadeType, startTime, duration);
    filterExec.add(identifiable);
}
Also used : Time(org.fagu.fmv.utils.time.Time) Duration(org.fagu.fmv.utils.time.Duration) FadeAudioVideoFilterExec(org.fagu.fmv.core.exec.filter.FadeAudioVideoFilterExec) FadeType(org.fagu.fmv.ffmpeg.filter.impl.FadeType) Identifiable(org.fagu.fmv.core.exec.Identifiable) BaseIdentifiable(org.fagu.fmv.core.exec.BaseIdentifiable)

Example 2 with FadeAudioVideoFilterExec

use of org.fagu.fmv.core.exec.filter.FadeAudioVideoFilterExec in project fmv by f-agu.

the class Console method startConsole.

/**
 * @param consoleReader
 * @throws IOException
 */
private void startConsole(ConsoleReader consoleReader) throws IOException {
    List<Executable> executables = project.getExecutables();
    if (!executables.isEmpty()) {
        return;
    }
    consoleReader.println("Create a default structure");
    GenericExecutable rootExec = new GenericExecutable(project);
    FadeAudioVideoFilterExec fadeOut = new FadeAudioVideoFilterExec(project, FadeType.OUT, Time.valueOf(200), Duration.valueOf(3));
    rootExec.add(fadeOut);
    FadeAudioVideoFilterExec fadeIn = new FadeAudioVideoFilterExec(project, FadeType.IN, Time.valueOf(0), Duration.valueOf(2));
    fadeOut.add(fadeIn);
    GenericFilterExec audioMerge = new GenericFilterExec(project, "amerge");
    fadeIn.add(audioMerge);
    ConcatExecutable concat = new ConcatExecutable(project);
    audioMerge.add(concat);
    project.modified();
}
Also used : GenericFilterExec(org.fagu.fmv.core.exec.filter.GenericFilterExec) ConcatExecutable(org.fagu.fmv.core.exec.executable.ConcatExecutable) FadeAudioVideoFilterExec(org.fagu.fmv.core.exec.filter.FadeAudioVideoFilterExec) ConcatExecutable(org.fagu.fmv.core.exec.executable.ConcatExecutable) Executable(org.fagu.fmv.core.exec.Executable) GenericExecutable(org.fagu.fmv.core.exec.executable.GenericExecutable) GenericExecutable(org.fagu.fmv.core.exec.executable.GenericExecutable)

Aggregations

FadeAudioVideoFilterExec (org.fagu.fmv.core.exec.filter.FadeAudioVideoFilterExec)2 BaseIdentifiable (org.fagu.fmv.core.exec.BaseIdentifiable)1 Executable (org.fagu.fmv.core.exec.Executable)1 Identifiable (org.fagu.fmv.core.exec.Identifiable)1 ConcatExecutable (org.fagu.fmv.core.exec.executable.ConcatExecutable)1 GenericExecutable (org.fagu.fmv.core.exec.executable.GenericExecutable)1 GenericFilterExec (org.fagu.fmv.core.exec.filter.GenericFilterExec)1 FadeType (org.fagu.fmv.ffmpeg.filter.impl.FadeType)1 Duration (org.fagu.fmv.utils.time.Duration)1 Time (org.fagu.fmv.utils.time.Time)1