FFMPEG-Effects
view release on metacpan or search on metacpan
lib/FFMPEG/Effects.pm view on Meta::CPAN
$FFCommand="ffmpeg -y -qmin 1 -qmax 2 -g 0 -i $videofile -r $framerate -s $size -qmin 1 -qmax 2 -g 0 -vframes 1 $outputfile-holdframe-$framecount.png 2>&1";
$ProcData=`$FFCommand`;
if ($self->{'debug'} != 0)
{
print ("Executing: $FFCommand\n");
print ("$ProcData\n");
}
}
$FFCommand="ffmpeg -y -qmin 1 -qmax 2 -g 0 -i $outputfile-holdframe-%05d.png -r $framerate -qmin 1 -qmax 2 -g 0 -vf \"color=color=$color\@$fade:size=$size [layer1]; [in][layer1] overlay=0:0\" $outputfile-hold.mpg 2>&1";
$ProcData=`$FFCommand`;
if ($self->{'debug'} != 0)
{
print ("Executing: $FFCommand\n");
print ("$ProcData\n");
}
$FFCommand="ffmpeg -y -qmin 1 -qmax 2 -g 0 -i $videofile -r $framerate -s $size -qmin 1 -qmax 2 -g 0 -vframes $fadeinframes $outputfile-%05d.png 2>&1";
$ProcData=`$FFCommand`;
if ($self->{'debug'} != 0)
lib/FFMPEG/Effects.pm view on Meta::CPAN
{
$fade=0;
}
$fadeval=sprintf("%.2f", $fade);
print("Opacity: $fadeval\n");
$skip=( $skip + $next );
$nextval=sprintf("%.3f", $skip);
print("Next Frame at: $nextval sec.\n\n");
$FFCommand="ffmpeg -y -qmin 1 -qmax 2 -g 0 -i $outputfile-$framecount.png -r $framerate -vf \"color=color=$color\@$fade:size=$size [layer1]; [in][layer1] overlay=0:0\" -s $size -qmin 1 -qmax 2 -g 0 -vframes 1 $outputfile-$framecount.effect.png 2>&...
$ProcData=`$FFCommand`;
if ($self->{'debug'} != 0)
{
print ("Executing: $FFCommand\n");
print ("$ProcData\n");
}
}
print ("Processing Effect Into Output Video: $outputfile-fadein.mpg\n");
$FFCommand="ffmpeg -y -qmin 1 -qmax 2 -g 0 -i $outputfile-%05d.effect.png -r $framerate -qmin 1 -qmax 2 -g 0 $outputfile-effect.mpg 2>&1";
lib/FFMPEG/Effects.pm view on Meta::CPAN
if ( $frameno == $fadeoutframes)
{
$fade=($opacity / 100 );
print ("Generating Hold Frames... This Frame Repeated $holdframes Times.\n");
for ( $holdframe = 1; $holdframe <= $holdframes; $holdframe++)
{
$frameindex = $holdframe;
$framecount=sprintf("%05d", $frameindex);
$FFCommand="ffmpeg -y -qmin 1 -qmax 2 -g 0 -ss $skip -i $outputfile-tmp.mpg -r $framerate -vf \"color=color=$color\@$fade:size=$size [layer1]; [in][layer1] overlay=0:0\" -s $size -qmin 1 -qmax 2 -g 0 -vframes 1 $outputfile-holdframe-$framecount.p...
$ProcData=`$FFCommand`;
if ($self->{'debug'} != 0)
{
print ("Executing: $FFCommand\n");
print ("$ProcData\n");
}
}
next;
}
$fadeval=sprintf("%.2f", $fade);
print("Opacity: $fadeval\n");
$skip=( $skip + $next );
$nextval=sprintf("%.3f", $skip);
print("Next Frame At: $nextval\n\n");
$FFCommand="ffmpeg -y -qmin 1 -qmax 2 -g 0 -ss $skip -i $outputfile-tmp.mpg -r $framerate -vf \"color=color=$color\@$fade:size=$size [layer1]; [in][layer1] overlay=0:0\" -s $size -qmin 1 -qmax 2 -g 0 -vframes 1 $outputfile-effect-$framecount.png 2...
$ProcData=`$FFCommand`;
if ($self->{'debug'} != 0)
{
print ("Executing: $FFCommand\n");
print ("$ProcData\n");
}
}
print ("Transcoding To Output File... $outputfile-fadeout.mpg\n");
lib/FFMPEG/Effects.pm view on Meta::CPAN
system("convert -size $size xc:$color $color.png");
my $runtime = ($titleframes * $next);
$ProcData=`ffmpeg -y -loop 1 -f image2 -i $color.png -t $runtime $outputfile-titlesplash.background.mpg 2>&1 `;
if ($self->{'debug'} != 0)
{
print ("$ProcData\n");
}
$ProcData=`ffmpeg -y -i $outputfile-titlesplash.background.mpg -vf "movie=title.png [title]; [in][title] overlay=0:0" -qmin 1 -qmax 2 -g 0 -s $size titlesplash.mpg 2>&1 `;
if ($self->{'debug'} != 0)
{
print ("$ProcData\n");
}
$self->FadeIn("videofile=titlesplash.mpg", "size=$size", "framerate=$framerate", "color=$color", "opacity=$opacity", "fadeinframes=$fadeinframes", "fadeoutframes=$fadeoutframes", "holdframes=$holdframes", "titleframes=$titleframes" );
$self->FadeOut("videofile=titlesplash.mpg-fadein.mpg", "size=$size", "framerate=$framerate", "color=$color", "opacity=$opacity", "fadeinframes=$fadeinframes", "fadeoutframes=$fadeoutframes", "holdframes=$holdframes", "titleframes=$titleframes" );
( run in 1.277 second using v1.01-cache-2.11-cpan-49f99fa48dc )