some css tweaks and other minor improvements/fixes
This commit is contained in:
@@ -188,6 +188,38 @@ public function tesThumb() {
|
||||
}
|
||||
}
|
||||
|
||||
public function blurryThumb() {
|
||||
set_time_limit(9899999999999999);
|
||||
$dat = $this->file;
|
||||
#$in = public_path() . "/b"; // webm-input
|
||||
$in = "/home/sirx/web/devw0bm/w0bm.com/public/b";
|
||||
$out = public_path() . "/thumbs/blurred"; //thumb-output
|
||||
$tmpdir = str_replace("public", "app/Http/Controllers/tmp", public_path());
|
||||
|
||||
$name = explode(".", $dat);
|
||||
array_pop($name);
|
||||
$name = join(".", $name);
|
||||
|
||||
#$ffmpegthumbnailer = round(shell_exec("ffmpegthumbnailer -i {$in}/{$dat} -a -o {$out}/{$name}_test.png"));
|
||||
//$ffmpeg = round(shell_exec("ffmpeg -i {$in}/{$dat} -vf select='eq(pict_type,PICT_TYPE_I)' -vf scale=128:128 {$out}/{$name}_ffmpeg.png"));
|
||||
$length = round(shell_exec("ffprobe -i {$in}/{$dat} -show_format -v quiet | sed -n 's/duration=//p'"));
|
||||
$half = $length / 20;
|
||||
$ffmpeg = exec("ffmpegthumbnailer -i {$in}/{$dat} -o {$out}/{$name}_testblur.png", $output, $return);
|
||||
if ($return != 0) {
|
||||
// error
|
||||
@unlink("{$out}/{$name}_testblur.png");
|
||||
exec("ffmpeg -i {$in}/{$dat} -vf select='eq(pict_type,PICT_TYPE_I)' -vf scale=128:128:force_original_aspect_ratio=increase,crop=128:128 {$out}/{$name}.png");
|
||||
exec("convert {$out}/{$name}.png -blur 0x8 {$out}/{$name}_blurred.png");
|
||||
@unlink("{$out}/{$name}.png");
|
||||
}else{
|
||||
// success
|
||||
@unlink("{$out}/{$name}_testblur.png");
|
||||
exec("ffmpeg -i {$in}/{$dat} -vf select='eq(pict_type,PICT_TYPE_I)' -vf scale=128:128:force_original_aspect_ratio=increase,crop=128:128 -ss {$half} {$out}/{$name}.png");
|
||||
exec("convert {$out}/{$name}.png -blur 0x8 {$out}/{$name}_blurred.png");
|
||||
@unlink("{$out}/{$name}.png");
|
||||
}
|
||||
}
|
||||
|
||||
public function createThumbnailStatic() {
|
||||
$dat = $this->file;
|
||||
$in = public_path() . "/b"; // webm-input
|
||||
|
Reference in New Issue
Block a user