App-FfmpegUtils

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

	- Add script: split-video-by-duration.


0.006   2020-09-23  Released-By: PERLANCAR; Urgency: high

        - Merge releases 0.005 and 0.004.1.


0.005   2020-09-05  Released-By: PERLANCAR; Urgency: medium

	- Add option --frame-rate (-r) dan --audio-sample-rate
	  (--sample-rate).


0.004.1 2020-09-23  Released-By: PERLANCAR; Urgency: medium; Status: cancelled

	- [INCOMPATIBLE CHANGE] Make scaling more flexible, replace
	  --downsize-to option with --scale which accepts ImageMagick-like
	  notation e.g. '720^>' to shrink shortest side to 720p.

        - UPDATE: rename release from 0.004 to 0.004.1. Cancel release

README  view on Meta::CPAN

        (No description)

    *   ffmpeg_path => *filename*

        (No description)

    *   files* => *array[filename]*

        (No description)

    *   frame_rate => *ufloat*

        Set frame rate, in fps.

    *   overwrite => *bool*

        (No description)

    *   preset => *str* (default: "veryslow")

        (No description)

    *   scale => *str* (default: "1080^>")

lib/App/FfmpegUtils.pm  view on Meta::CPAN

                no_scale   => {summary=>"Alias for --scale ''", is_flag=>1, code=>sub {$_[0]{scale} = ''}},
            },
        },
        preset => {
            schema => ['str*', in=>\@presets],
            default => 'veryslow',
            cmdline_aliases => {
                (map {($_ => {is_flag=>1, summary=>"Shortcut for --preset=$_", code=>do { my $p = $_; sub { $_[0]{preset} = $p }}})} @presets),
            },
        },
        frame_rate => {
            summary => 'Set frame rate, in fps',
            schema => 'ufloat*',
            cmdline_aliases => {r=>{}},
        },
        audio_sample_rate => {
            summary => 'Set audio sample rate, in Hz',
            schema => 'uint*',
            cmdline_aliases => {sample_rate=>{}},
        },
        overwrite => {
            schema => 'bool*',

lib/App/FfmpegUtils.pm  view on Meta::CPAN

        my $ext = $scale_suffix ? ".$scale_suffix-crf$crf.mp4" : ".crf$crf.mp4";
        $output_file =~ s/(\.\w{3,4})?\z/($1 eq ".mp4" ? "" : $1) . $ext/e;

        my $audio_is_copy = 1;
        $audio_is_copy = 0 if defined $args{audio_sample_rate};

        push @ffmpeg_args, (
            "-c:v", "libx264",
            "-crf", $crf,
            "-preset", ($args{preset} // 'veryslow'),
            (defined $args{frame_rate} ? ("-r", $args{frame_rate}) : ()),
            "-c:a", ($audio_is_copy ? "copy" : "aac"),
            (defined $args{audio_sample_rate} ? ("-ar", $args{audio_sample_rate}) : ()),
            $output_file,
        );

        if ($args{-dry_run}) {
            log_info "[DRY-RUN] Running $ffmpeg_path with args %s ...", \@ffmpeg_args;
            next;
        }

lib/App/FfmpegUtils.pm  view on Meta::CPAN

(No description)

=item * B<ffmpeg_path> => I<filename>

(No description)

=item * B<files>* => I<array[filename]>

(No description)

=item * B<frame_rate> => I<ufloat>

Set frame rate, in fps.

=item * B<overwrite> => I<bool>

(No description)

=item * B<preset> => I<str> (default: "veryslow")

(No description)

=item * B<scale> => I<str> (default: "1080^>")

script/reencode-video-with-libx264  view on Meta::CPAN

=head1 VERSION

This document describes version 0.015 of reencode-video-with-libx264 (from Perl distribution App-FfmpegUtils), released on 2025-10-29.

=head1 SYNOPSIS

B<reencode-video-with-libx264> B<L<--help|/"--help">>

B<reencode-video-with-libx264> B<L<--version|/"--version">>

B<reencode-video-with-libx264> [B<L<--audio-sample-rate|/"--audio-sample-rate=s, --sample-rate">>=I<L<uint|Sah::Schema::uint>>|B<L<--sample-rate|/"--audio-sample-rate=s, --sample-rate">>=I<L<uint|Sah::Schema::uint>>] [B<L<--config-path|/"--config-pat...



See examples in the L</EXAMPLES> section.

=head1 DESCRIPTION

This utility runs I<ffmpeg> to re-encode your video files using the libx264
codec. It is a wrapper to simplify invocation of ffmpeg. It selects the
appropriate ffmpeg options for you, allows you to specify multiple files, and

script/reencode-video-with-libx264  view on Meta::CPAN

Can also be specified as the 1st command-line argument and onwards.

Can be specified multiple times.

=item B<--files-json>=I<s>

See C<--file>.

Can also be specified as the 1st command-line argument and onwards.

=item B<--frame-rate>=I<s>, B<-r>

Set frame rate, in fps.

=item B<--medium>

Shortcut for --preset=medium.

See C<--preset>.

=item B<--no-scale>

Alias for --scale ''.

script/reencode-video-with-libx264  view on Meta::CPAN


which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.

List of available configuration parameters:

 audio_sample_rate (see --audio-sample-rate)
 crf (see --crf)
 ffmpeg_path (see --ffmpeg-path)
 files (see --file)
 format (see --format)
 frame_rate (see --frame-rate)
 log_level (see --log-level)
 naked_res (see --naked-res)
 overwrite (see --overwrite)
 preset (see --preset)
 scale (see --scale)

=head1 ENVIRONMENT

=head2 REENCODE_VIDEO_WITH_LIBX264_OPT

script/vreencode  view on Meta::CPAN

=head1 VERSION

This document describes version 0.015 of vreencode (from Perl distribution App-FfmpegUtils), released on 2025-10-29.

=head1 SYNOPSIS

B<vreencode> B<L<--help|/"--help">>

B<vreencode> B<L<--version|/"--version">>

B<vreencode> [B<L<--audio-sample-rate|/"--audio-sample-rate=s, --sample-rate">>=I<L<uint|Sah::Schema::uint>>|B<L<--sample-rate|/"--audio-sample-rate=s, --sample-rate">>=I<L<uint|Sah::Schema::uint>>] [B<L<--config-path|/"--config-path=s, -c">>=I<path>...



See examples in the L</EXAMPLES> section.

=head1 DESCRIPTION

This utility runs I<ffmpeg> to re-encode your video files using the libx264
codec. It is a wrapper to simplify invocation of ffmpeg. It selects the
appropriate ffmpeg options for you, allows you to specify multiple files, and

script/vreencode  view on Meta::CPAN

Can also be specified as the 1st command-line argument and onwards.

Can be specified multiple times.

=item B<--files-json>=I<s>

See C<--file>.

Can also be specified as the 1st command-line argument and onwards.

=item B<--frame-rate>=I<s>, B<-r>

Set frame rate, in fps.

=item B<--medium>

Shortcut for --preset=medium.

See C<--preset>.

=item B<--no-scale>

Alias for --scale ''.

script/vreencode  view on Meta::CPAN


which is equivalent to setting C<< -plugins=-DumpArgs@before_validate_args@99,-Foo@after_validate_args,arg1,val1,arg2,val2 >>.

List of available configuration parameters:

 audio_sample_rate (see --audio-sample-rate)
 crf (see --crf)
 ffmpeg_path (see --ffmpeg-path)
 files (see --file)
 format (see --format)
 frame_rate (see --frame-rate)
 log_level (see --log-level)
 naked_res (see --naked-res)
 overwrite (see --overwrite)
 preset (see --preset)
 scale (see --scale)

=head1 ENVIRONMENT

=head2 VREENCODE_OPT



( run in 0.959 second using v1.01-cache-2.11-cpan-e1769b4cff6 )