/usr/lib/x86_64-linux-gnu/lives/plugins/effects/rendered/gen_clip_from_image is in lives-plugins 2.4.8-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | #!/usr/bin/perl
#######################################################################
# LiVES gen_clip_from_image plugin, version 1.7
# RFX version 1.8
# autogenerated from script by Salsaman|
# rendered plugins should accept:
# <plugin_name> version (return <plugin_name> version <version>)
# <plugin_name> get_define
# <plugin_name> get_capabilities
# <plugin_name> get_description (e.g. "Edge detect|Edge detecting|1|1|")
# <plugin_name> clear (clean up any plugin generated temp files)
# and optionally any of:
# <plugin_name> get_parameters
# <plugin_name> get_param_window
# <plugin_name> get_onchange
# <plugin_name> onchange_<when> (for any triggers, e.g. onchange_init)
#
# they must accept:
# <plugin_name> process <parameters>
# You should not skip any frames, if a frame is not changed you must do:
# `cp $in $out`
#
# for *non-Perl* plugins, LiVES will call:
# <plugin_name> process "<dir>" <in_ext> <out_ext> <start> <end>
# <width> <height> <parameters>
# first you should chdir to <dir>
# then you should create all output frames %8d$out_ext in numerical
# from start to end inclusive,
# each time calling sig_progress (see smogrify) - writes current frame number to
# <dir>/.status
# and checking for pause
#
# Any errors should be transmitted as in sig_error -
# write "error|msg1|msg2|msg3|" to <dir>/.status
# msgn must not contain "\n", but can be omitted
# output frames should be named %8d$out_ext in the same directory
# after processing, you should leave no gaps in out frames, you should not resize
# or change the palette from RGB24 (LiVES will check and autocorrect this soon)
# Also you must implement your own: &sig_error and &sig_progress
#######################################################################
use POSIX;
my $command=$ARGV[0];
if ($command eq "get_capabilities") {
# capabilities is a bitmap field
# 0x0001 == slow (hint to GUI)
# 0x0002 == may resize (all frames to x )
# 0x0004 == block mode generator
# 0x8000 == reserved
print "32768\n";
exit 0;
}
if ($command eq "version") {
print "gen_clip_from_image version 1 : builder version 2.4.8\n";
exit 0;
}
if ($command eq "get_define") {
print "|1.7\n";
exit 0;
}
if ($command eq "get_description") {
#format here is "Menu entry|Action description|min_frames|number_of_in_channels|"
# min_frames==-1 indicates a special "no processing" effect. This allows more
#general parameter windows which are not really effects (e.g. frame_calculator)
print "Generate clip from image|Generating clip from image|1|0|\n";
exit 0;
}
if ($command eq "get_parameters") {
# "name|label|type|other fields..."
# eg. print "radius|_radius|num0|1|1|100|";
# types can be numx,colRGB24,bool,string or string_list
print "width|_Width|num0|640|1|10000|\n";
print "height|_Height|num0|480|1|10000|\n";
print "nframes|_Number of frames|num0|100|1|100000|\n";
print "imgfile|_Image File|string||80|\n";
print "fps|_Frames per second|num3|25.000|1.000|200.000|\n";
print "nsize|Use _Natural image size|bool|0|\n";
exit 0;
}
if ($command eq "get_param_window") {
print "layout|p0|p1||\n";
print "layout|p5||\n";
print "layout|p2|p4||\n";
print "special|fileread|3||\n";
exit 0;
}
if ($command eq "get_onchange") {
print "init|\n";
exit 0;
}
#######################################################
if ($command eq "process") {
# in case of error, you should do:
# &sig_error("msg1","msg2","msg3","msg4"); [ msg's are optional, but must not
# contain newlines (\n) ]
##### check requirements first #######
if (&location("convert") eq "") {
&sig_error("You must install 'convert' before you can use this effect.");
exit 1;
}
###### handle parameters #############
# autogenerated from get_parameters
unless (defined($ARGV[1])) {
$p0=640;
}
else {
$p0=$ARGV[1];
}
unless (defined($ARGV[2])) {
$p1=480;
}
else {
$p1=$ARGV[2];
}
unless (defined($ARGV[3])) {
$p2=100;
}
else {
$p2=$ARGV[3];
}
unless (defined($ARGV[4])) {
$p3="";
}
else {
$p3=$ARGV[4];
}
unless (defined($ARGV[5])) {
$p4=25.000;
}
else {
$p4=$ARGV[5];
}
unless (defined($ARGV[6])) {
$p5=0;
}
else {
$p5=$ARGV[6];
}
$!=0;
if ($p0>=0) {
$p0=int(POSIX::strtod($p0)*1+.5)/1;
} else {
$p0=int(POSIX::strtod($p0)*1-.5)/1;
}
if ($p0<1) {
&sig_error("width must be >= 1");
exit 1;
}
if ($p0>10000) {
&sig_error("width must be <= 10000");
exit 1;
}
$!=0;
if ($p1>=0) {
$p1=int(POSIX::strtod($p1)*1+.5)/1;
} else {
$p1=int(POSIX::strtod($p1)*1-.5)/1;
}
if ($p1<1) {
&sig_error("height must be >= 1");
exit 1;
}
if ($p1>10000) {
&sig_error("height must be <= 10000");
exit 1;
}
$!=0;
if ($p2>=0) {
$p2=int(POSIX::strtod($p2)*1+.5)/1;
} else {
$p2=int(POSIX::strtod($p2)*1-.5)/1;
}
if ($p2<1) {
&sig_error("nframes must be >= 1");
exit 1;
}
if ($p2>100000) {
&sig_error("nframes must be <= 100000");
exit 1;
}
$!=0;
if ($p4>=0) {
$p4=int(POSIX::strtod($p4)*1000.+.5)/1000.;
} else {
$p4=int(POSIX::strtod($p4)*1000.-.5)/1000.;
}
if ($p4<1.000) {
&sig_error("fps must be >= 1.000");
exit 1;
}
if ($p4>200.000) {
&sig_error("fps must be <= 200.000");
exit 1;
}
$p5=~(~$p5);
$end=0;
if ($img_ext eq ".png") {
$img_prefix="PNG32:";
} else {
$img_prefix="";
}
if ($out_ext eq ".png") {
$out_prefix="PNG32:";
} else {
$out_prefix="";
}
$end=$p2;
if ($p5) {
$imresact="none";
&get_image_size($p3);
$nwidth=$hsize;$nheight=$vsize;
} else {
$nwidth=$p0;
$nheight=$p1;
}
$fps=$p4;
if ($start==0) {$start = 1;}
################# loop through frames #################
if ($img_ext eq ".png") {
$img_prefix="PNG32:";
} else {
$img_prefix="";
}
if ($out_ext eq ".png") {
$out_prefix="PNG32:";
} else {
$out_prefix="";
}
for ($frame=$start;$frame<=$end;$frame++) {
# sig progress will update the progress bar from $start->$end
$name=&mkname($frame);
$out="$name$out_ext";
##################### the all-important bit #######################
if ($p5) {
`$convert_command "$p3" $out_prefix$out`;
} else {
`$convert_command "$p3" -resize $p0!x$p1! $out_prefix$out`;
}
###################################################################
$opfailed=0;
if (! -f $out) {
print STDERR "Warning: effect plugin gen_clip_from_image skipped frame $frame !\n";
print STDERR "Retrying\n";
$frame--;
$opfailed=1;
}
unless ($opfailed) {
&sig_progress($frame,$nwidth,$nheight,$fps,$end);
}
}
return 1;
}
########## Post loop code ############
if ($command eq "clear") {
$start=$ARGV[1];
$end=$ARGV[2];
$img_ext=$ARGV[3];
exit 0;
}
########## Triggers ############
if ($command eq "onchange_init") {
$p0=@ARGV[1];
$p0_min=@ARGV[2];
$p0_max=@ARGV[3];
$p1=@ARGV[4];
$p1_min=@ARGV[5];
$p1_max=@ARGV[6];
$p2=@ARGV[7];
$p2_min=@ARGV[8];
$p2_max=@ARGV[9];
$p3=@ARGV[10];
$p4=@ARGV[11];
$p4_min=@ARGV[12];
$p4_max=@ARGV[13];
$p5=@ARGV[14];
$width=@ARGV[15];
$height=@ARGV[16];
$start=@ARGV[17];
$end=@ARGV[18];
$last=@ARGV[19];
$length=$end-$start+1;
if ($width>0) {$p0=$width}; if ($height>0) {$p1=$height};
$p3=~ s/\"/\\\"/g;
print "$p0 $p0_min $p0_max $p1 $p1_min $p1_max $p2 $p2_min $p2_max \"$p3\" $p4 $p4_min $p4_max $p5 ";
exit 0;
}
|