Preview generation - FFmpeg command line

Hi all,

My nextclouds are all installed and work as they should work.
Also, all are generating previews just as they should. All Pictures and videos are transcoded to smaller derivatives and can be seen in the browser.

However, I have a different and very modified ffmpeg that also uses hardware accelleration with Nvidia, Intel or AMD GPUs. So I want to change the actual transcoder command line and do not know where to find it. Does anyone know where I can find the ‘ffmpeg -i video.mp4 -o video_preview.mp4’ line? Is it in the libreoffice packages or in the nextcloud preview generator (where I was looking for it).
I just want to change this line with a few extra parameters and codecs. Is this possible?

Additionally, the preview generator transcodes to the same codec as the input codec, which is not playing in a webbrowser if the input file was h265. So I want to force it to use the h264 or h264 hardware accellerated codec instead, so the video files play in browser windows again.

Best regards,

grep -R ffmpeg /var/www/nextcloud


apps/video_converter/lib/Controller/ConversionController.php: $cmd = " ffmpeg -y -i ".escapeshellarg($file)." ".$middleArgs." ".escapeshellarg(dirname($file) . '/' . pathinfo($file)['filename'].".".$output);

1 Like

Perfect! WIll try this one :slight_smile:

I found the actual source of my problem:
The previewgenerator just makes Thumbnail previews, but not video previews itself.

Your ffmpeg line is the one from the video converter app that you actually need to convert any videos. I will have a look at it now.

But what I actually needed: Some preview video (!) that is shown when I open the Photos page on my nextcloud, or that plays a browser playable video (ie h264) when I click on a video file.
The reason for this: I have a lot of h265 videos or even some professional codec videos (also higher resolution and datarate h264 with 10bit from a Sony Camera or Apple ProRes for example) that do not play back in a browser. For these I need a preview method, meaning that the uploaded video file is automatically converted into some browser playable video and then shown on the Nextcloud.
That was also the reason why I wanted my own ffmpeg in that position since it makes use of Nvidia cards or Nvidia GPU grids to convert the professional codecs with a few hundred frames per second.

But still, your find was a solution anyways. Within the video converter app I can attach my own ffmpeg and generate a video with a variety of professional input codecs and GPU support.
I will have a look at this and might be able to use a workflow here to generate another file which acts as a preview, but being stored in parallel to the original upload.

Thanks a lot! :slight_smile:

1 Like