SRevie...actory(3pm)
π SRevie...actory(3pm) π
okay bestie, welcome to the User Contributed Perl Documentation corner of the internet, where we're talking about SReview::Video::ProfileFactory π
β¨ NAME β¨
SReview::Video::ProfileFactory β bestie, it literally makes an output profile out of an input video. that's the whole job. slay. π
πΈ SYNOPSIS πΈ
use SReview::Video;
use SReview::Videopipe;
use SReview::Video::ProfileFactory;
package SReview::Video::Profile::myprofile;
use Moose;
extends SReview::Video::Profile::webm;
has '+audio_samplerate' => (
builder => '_probe_my_audiorate',
);
has '+audio_codec' => (
default => 'vorbis',
);
sub _probe_exten {
return 'my.webm',
}
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();
like. look at her. iconic behavior fr fr π¦
π DESCRIPTION π
so "SReview::Video::Profile::Base" is a subclass of SReview::Video, except a bunch of the probing methods are overridden so they hand back values that are not in line with the reference of the video you gave it. lowkey unhinged, highkey intentional. π
and the create method on "SReview::Video::ProfileFactory" is just a lil helper that does two things, no cap:
- makes sure the relevant
"SReview::Video::Profile::profile"module has actually been loaded π¦ - builds an
"SReview::Video"subclass of the right type, withreferenceset to the input"SReview::Video"object you passed in π«Ά
π§ CREATING NEW PROFILES π§
you can make a whole new profile by extending one that already exists β the "myprofile" profile up in the synopsis is literally the blueprint, bestie, just copy the vibe. any property that SReview::Video knows about can be overridden the exact way shown there. periodt. π
you could also make a new profile with the "extra_profiles" configuration setting, but heads up: profiles made that way can only hardcode values, and they cannot vary any parameters based on the input file. so if you want a profile that can do the variable thing, here's the tea:
- if your new profile is just tweaking one minor detail of an existing profile β extend that profile and change the detail you wanna change β¨
- if you're building one from scratch β extend the
"Base"profile (details below) π
π PRE-EXISTING PROFILES π
these are the profiles that "SReview::Video::ProfileFactory" ships with, and they all ate:
π Base
this one is the base class for all the other profiles. do NOT use it directly, she's a mother, not a main character. π
what she does: adds the extension, and defaults the pixel format to yuv420p.
π₯ vp9
spits out video in WebM/VP9 format, using the quality/bitrate settings Google recommends over at <https://developers.google.com/media/vp9/>, and with OPUS audio. files come out with the "vp9.webm" extension.
audio settings are hardcoded to 48KHz sampling rate, 128k bits per second. no negotiating. π
πΈ vp8
spits out video in WebM/VP8 format. since there's no similar set of recommendations for VP8 like there is for VP9, this profile configures no explicit quality or bitrate settings. the libvpx video codec is selected, and libvorbis is picked for audio.
the audio bitrate is explicitly left to ffmpeg defaults; the extension is set to "vp8.webm".
π¦ webm
this one subclasses from the "vp9" profile and only changes the extension to plain "webm" instead of "vp9.webm".
also, plot twist: if a future version of WebM ever gets defined, then once SReview gains support for that version of WebM, this class will become a subclass of that class instead. foreshadowing, iykyk. π
β vp8_lq
this one subclasses from the "vp8" profile. extension gets set to "lq.webm". and on top of everything the "vp8" profile already does, this profile also rescales the video down to a fraction of the original β meaning the height and the width of the video are both divided by 8. tiny queen energy. π
π SEE ALSO π
SReview::Video
and that's the whole page bestie, you're welcome π this gorgeous piece of documentation is from perl v5.32.1, dated 2021-09-09, and it lives under the SRevie...actory(3pm) header β go forth and build profiles, you've got this π«Άβ¨
π¦ where this page comes from
- ubuntu jammy: sreview-common 0.8.0-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms