Make it so that the second mark where ffmpeg extracts the tumbnail is an configurable option.
A lot of video files have the same intro or just start black for 5sec so the tumbnails are useless this way.
Hello,
you are posting to the development forum. This is intended to be used if you wanted to start developing yourself. So, is this what you are after? What is your question exactly?
Chris
Yeah sorry maybe wrong place it is a little bit a feature request but also for some extra information.
I tried changing the seconds value from 5 to 30 in lib/private/Preview/Movie.php
$result = $this->generateThumbNail($maxX, $maxY, $absPath, 5);
And regenerating al the previews but I don’t see any changes.
I don’t have any experience with web development so I don’t really know if I need to recompile the code.
Install is directly on ubuntu server with apache
Some help is always welcom but i do not gave enoug experience to make tis a configurable parameter in config.php which would be a nice feature.
If I want to make a feature request to make the preview generation timestamp in a video a configurable parameter should I make a new post somewhere else on the forum and then this one gets closed or should this post be moved.
Greetings wannes
Add start time for video previews · Issue #50008 · nextcloud/server · GitHub Look what I found. Since the problem affects me, I look at your implementation and add an app settings that can be used to change it. I would almost find it better if you could just determine the middle or 10% or in the section the most change of the video. If you feel like it, we can do a PR.
Just tested it, apache2 restart and it works.
That would be my idea pseudo code, since ten seconds are usually enough and only a few MB are loaded for performance reasons.
select='gt(scene,0.5) This allows you to automatically select preview. Examples:
That would actually be perfect if you want to create a small gif preview.
$config = \OC::$server->getConfig();
$offsets = explode(',', $config->getAppValue('preview', 'movie_seconds', '5,1,0'));
foreach ($offsets as $second) {
$second = (int)trim($second);
$result = $this->generateThumbNail($maxX, $maxY, $absPath, $second);
if ($result !== null) {
break;
}
}
There is still a quick problem to avoid.
# Backup
sudo cp /var/www/nextcloud/lib/private/Preview/Movie.php{,.bak}
# 5 in 10
sudo sed -i '0,/generateThumbNail(\$maxX, \$maxY, \$absPath, 5)/s/5)/10)/' /var/www/nextcloud/lib/private/Preview/Movie.php
# 1 in 5
sudo sed -i '0,/generateThumbNail(\$maxX, \$maxY, \$absPath, 1)/s/1)/5)/' /var/www/nextcloud/lib/private/Preview/Movie.php
service apache2 restart