.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "SReview::Video::ProfileFactory 3pm" .TH SReview::Video::ProfileFactory 3pm "2018-05-17" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" SReview::Video::ProfileFactory \- Create an output profile from an input video. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use SReview::Video; \& use SReview::Videopipe; \& use SReview::Video::ProfileFactory; \& \& package SReview::Video::Profile::myprofile; \& use Moose; \& extends SReview::Video::Profile::webm; \& \& has \*(Aq+audio_samplerate\*(Aq => ( \& builder => \*(Aq_probe_my_audiorate\*(Aq, \& ); \& \& has \*(Aq+audio_codec\*(Aq => ( \& default => \*(Aqvorbis\*(Aq, \& ); \& \& sub _probe_exten { \& return \*(Aqmy.webm\*(Aq, \& } \& \& sub _probe_my_audiorate { \& my $self = shift; \& return $self\->reference\->audio_samplerate / 2; \& } \& \& no Moose; \& \& package main; \& \& my $input = SReview::Video\->new(url => "foo.mp4"); \& my $profile = SReview::Video::ProfileFactory\->create("myprofile", $input); \& my $output = SReview::Video\->new(url => "foo." . $profile\->exten, reference => $profile); \& SReview::Videopipe\->new(inputs => [$input], output => $output)\->run(); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`SReview::Video::Profile::Base\*(C'\fR is a subclass of SReview::Video, but with a number of the probing methods overridden so that they return values that are not in line with the reference of the given video. .PP The \f(CW\*(C`SReview::Video::ProfileFactory\*(C'\fR's \f(CW\*(C`create\*(C'\fR method is a simple helper to: .IP "\(bu" 4 ensure that the relevant \f(CW\*(C`SReview::Video::Profile::\f(CIprofile\f(CW\*(C'\fR module has been loaded .IP "\(bu" 4 create an \f(CW\*(C`SReview::Video\*(C'\fR subclass of the right type, with reference set to the passed input \f(CW\*(C`SReview::Video\*(C'\fR object. .SH "CREATING NEW PROFILES" .IX Header "CREATING NEW PROFILES" It is possible to create a new profile by extending an existing one. The \&\f(CW\*(C`myprofile\*(C'\fR profile in the above example shows how to do so. Any property that is known by SReview::Video can be overridden in the manner given. .PP To create a profile that just changes a minor detail of an existing profile, extend that profile and change the detail which you want to change. To create a new profile from scratch, extend the \f(CW\*(C`Base\*(C'\fR profile (see below). .SH "PRE-EXISTING PROFILES" .IX Header "PRE-EXISTING PROFILES" The following profiles are defined by \f(CW\*(C`SReview::Video::ProfileFactory\*(C'\fR: .SS "Base" .IX Subsection "Base" This profile serves as a base class for the other profiles. It should not be used directly. .PP It adds the extension, and defaults the pixel format to yuv420p. .SS "vp9" .IX Subsection "vp9" Produces a video in WebM/VP9 format, using the quality/bitrate settings recommended by Google on , and with \s-1OPUS\s0 audio. Produces files with the \f(CW\*(C`vp9.webm\*(C'\fR extension. .PP Audio settings are hardcoded to 48KHz sampling rate, 128k bits per second. .SS "vp8" .IX Subsection "vp8" Produces a video in WebM/VP8 format. Since no similar recommendations for \s-1VP8\s0 exist as do for \s-1VP9,\s0 no explicit quality or bitrate settings are configured in this profile. The libvpx video codec is selected, and the libvorbis one for audio. .PP The audio bitrate is explicitly left to ffmpeg defaults; the extension is set to \f(CW\*(C`vp8.webm\*(C'\fR .SS "webm" .IX Subsection "webm" This profile subclasses from the \f(CW\*(C`vp9\*(C'\fR profile, and only changes the extension to plain \f(CW\*(C`webm\*(C'\fR instead of \f(CW\*(C`vp9.webm\*(C'\fR. .PP Additionally, if a future version of WebM is ever defined, then when SReview gains support for that version of WebM, this class will become a subclass of that class instead. .SS "vp8_lq" .IX Subsection "vp8_lq" This profile subclasses from the \f(CW\*(C`vp8\*(C'\fR profile. The extension is set to \&\f(CW\*(C`lq.webm\*(C'\fR. In addition to the changes made by the \f(CW\*(C`vp8\*(C'\fR profile, this profile also rescales the video to a fraction of the original; that is, the height and width of the video are both divided by 8. .SH "SEE ALSO" .IX Header "SEE ALSO" SReview::Video