Automate-Animate-FFmpeg

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


- input\_images($m)
- input\_pattern($m)
- input\_patterns($m)
- input\_file\_with\_images($m)

On success, the resultant animation will be
written to the output file
(specified using [output\_filename($m)](https://metacpan.org/pod/output_filename%28%24m%29) before the call.

Return value:

- 0 on failure, 1 on success.

## `input_images($m)`

    my $ret = $aaFF->input_images($m);

It sets or gets the list (as an ARRAYref) of all input images currently in the list
of images to create the animation. The optional input parameter, `$m`,
is an ARRAYref of input images (their fullpath that is) to create
the animation.

Return value:

- the list, as an ARRAYref, of the image filenames currently
set to create the animation.

## `input_pattern($m)`

    $aaFF->input_pattern($m) or die "failed";

Initiates a search via [File::Find::Rule](https://metacpan.org/pod/File%3A%3AFind%3A%3ARule) for the
input image files to create the animation using
the pattern `$m->[0]` with starting search dir being `$m->[1]`,
which is optional -- default being `Cwd::cwd` (current working dir).
So, `$m` is an array ref of one or two items. The first is the search
pattern and the optional second is the search path, defaulting to the current
working dir.

The pattern (`$m->[0]`) can be a shell wildcard, e.g. `*.png`,
or a regex specified as `regex(/REGEX-HERE/modifiers)`, for example
`regex(/\.(mp3|ogg)$/i)` Both shell wildcards and regular expressions
must comply with what [File::Find::Rule](https://metacpan.org/pod/File%3A%3AFind%3A%3ARule) expects, see \[https://metacpan.org/pod/File::Find::Rule#Matching-Rules\].

The results of the search will be added to the list of input images
in the order of appearance.

Multiple calls to `input_pattern()` will load
input images in the order they are found.

`input_pattern()` can be combined with `input_patterns()`
and `input_images()`. The input images list will increase
in the order they are called.

**Caveat**: the regex is parsed, compiled and passed on to [File::Find::Rule](https://metacpan.org/pod/File%3A%3AFind%3A%3ARule).
Escaping of special characters (e.g. the backslash) may be required.

**Caveat**: the order of the matched input images is entirely up
to [File::Find::Rule](https://metacpan.org/pod/File%3A%3AFind%3A%3ARule). There may be unexpected results
when filenames contain unicode characters. Consider
these orderings for example:

- `blue.png, κίτρινο.png, red.png`,
- `blue.png, γάμμα.png, κίτρινο.png, red.png`,
- `blue.png, κίτρινο.png, γαμμα.png red.png`,

Return value:

- 0 on failure, 1 on success.

## `input_patterns($m)`

    $aaFF->input_patterns($m) or die "failed";

Argument `$m` is an array of arrays each composed of one or two items.
The first argument, which is mandatory, is the search pattern.
The optional second argument is the directory to start the search.
For each item of `@$m` it calls [input\_pattern($m)](https://metacpan.org/pod/input_pattern%28%24m%29).

`input_patterns()` can be combined with `input_pattern()`
and `input_images()`. The input images list will increase
in the order they are called.

Return value:

- 0 on failure, 1 on success.

## `output_filename($m)`

    my $ret = $aaFF->output_filename($m);

It sets or gets the output filename of the animation.

When setting an output filename, make sure you
specify its extension and it does make sense to FFmpeg (e.g. mp4).

Return value:

- the current output filename.

## `input_file_with_images($m)`

    $aaFF->input_file_with_images($m) or die "failed";

Reads file `$m` which must contain filenames, one filename
per line, and adds the up to the list of input images to create the
animation.

Return value:

- 0 on failure, 1 on success.

## `num_input_images()`

    my $N = $aaFF->num_input_images();

Return value:

- on success, it returns the number of input images currently
in the list to create the animation. On failure, or when there



( run in 0.634 second using v1.01-cache-2.11-cpan-39bf76dae61 )