[Solved ]Problems with Video preview in admin UI

Hello
I have Pimcore 6.6.1 installed on Ubuntu Server with Apache.
FFmpeg and php 7.2 are installed
When I upload a mp4 file and try to preview it in the admin UI it does not load.
Do I need a php extension for fffmpeg ?
Is there another way I can get the videos to work ?
Do you need more information?

<VirtualHost *:80>
ServerName URL.de

    RewriteEngine on
    RewriteRule "^/(.*)" "https://URL.de/$1" [R=301,L]

<VirtualHost *:443>

    ServerName URL.de

    # turn off mod_deflate for PHP requests, ... this is necessary because of a bug in mod_fastcgi
    SetEnvIfNoCase Request_URI "\.(php)$" no-gzip dont-vary

    DocumentRoot /var/www/heicumedia/web

    AddHandler php7.2-fcgi .php
    Action php7.2-fcgi /php7.2-fcgi
    Alias /php7.2-fcgi /usr/lib/cgi-bin/php7.2-fcgi

   FastCgiExternalServer /usr/lib/cgi-bin/php7.2-fcgi -socket /var/run/php7.2-fpm.sock -pass-header Authorization
    <Directory /usr/lib/cgi-bin>
            Options ExecCGI FollowSymLinks
            SetHandler fastcgi-script
            Require all granted
    </Directory>

    <Directory /var/www/heicumedia/web>
            Options +FollowSymLinks
            AllowOverride All
            Require all granted
    </Directory>

    RewriteEngine On

    SSLEngine on
    SSLCertificateFile /etc/apache2/cert/heicumedia.pem
    SSLCertificateChainFile /etc/apache2/cert/chain.pem
    SSLCertificateKeyFile /etc/apache2/cert/heicumedia.key

    # THE FOLLOWING NEEDS TO BE THE VERY LAST REWRITE RULE IN THIS VHOST
    # this is needed to pass the auth header correctly - fastcgi environment
    RewriteRule ".*" "-" [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

Generating video previews takes time! Are you sure it’s not just very slow to generate?

I waited 20 - 30 minutes and nothing happened.
I only saw, preview is beeing created . Please wait …
is there something that could help generate the videos faster ?

Did you used this command to install ffmpeg

sudo apt-get install ffmpeg

Then check whether that module has been added successfully or not.

php -m

Initial I also faced the same then after installing this error gone.

Yes, there is a cli command to generate previews. You should also make sure to have the maintenance cron running!

I use a 4.X version of ffmpeg via snap and I think snap does not install the php module

The cronjob is running every 5 min

Just check system requirement check in pimcore


I did and I can’t see anything wrong

No idea then. Try with another system by installing a fresh new pimcore.

What happens if you execute bin/console pimcore:thumbnails:video -vvv?

14:29:05 INFO      [php] User Deprecated: Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.
[
  "exception" => ErrorException {
    #message: "User Deprecated: Calling the "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead."
    #code: 0
    #file: "/var/www/heicumedia/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php"
    #line: 58
    #severity: E_USER_DEPRECATED
    trace: {
      /var/www/heicumedia/vendor/symfony/symfony/src/Symfony/Component/EventDispatcher/EventDispatcher.php:58 { â¦}
      /var/www/heicumedia/vendor/pimcore/pimcore/models/Element/Service.php:975 { â¦}
      /var/www/heicumedia/vendor/pimcore/pimcore/models/Element/Service.php:1013 { â¦}
      /var/www/heicumedia/vendor/pimcore/pimcore/models/Element/Service.php:1026 { â¦}
      /var/www/heicumedia/vendor/pimcore/pimcore/models/Asset/Service.php:286 { â¦}
      /var/www/heicumedia/vendor/pimcore/pimcore/models/Asset.php:654 { â¦}
      /var/www/heicumedia/vendor/pimcore/pimcore/models/Asset.php:501 { â¦}
      /var/www/heicumedia/vendor/pimcore/pimcore/models/Asset/Video/Thumbnail/Processor.php:173 { â¦}
      /var/www/heicumedia/vendor/pimcore/pimcore/models/Asset/Video.php:140 { â¦}
      /var/www/heicumedia/vendor/pimcore/pimcore/bundles/CoreBundle/Command/ThumbnailsVideoCommand.php:102 { â¦}
      /var/www/heicumedia/vendor/symfony/symfony/src/Symfony/Component/Console/Command/Command.php:255 { â¦}
      /var/www/heicumedia/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:1019 { â¦}
      /var/www/heicumedia/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:97 { â¦}
      /var/www/heicumedia/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:271 { â¦}
      /var/www/heicumedia/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:83 { â¦}
      /var/www/heicumedia/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:147 { â¦}
      /var/www/heicumedia/bin/console:36 {
        ⺠$application = new \Pimcore\Console\Application($kernel);
        ⺠$application->run();
        âº
      }
    }
  }
]

kann es sein das es an dem User deprecated liegt ?

Ich hab festgestellt das es in pimcore 6.4.2 funktioniert
das was ich, wo es den fehler gibt neutze ist 6.6.1

Es kann sein, ich habe in der Tat unter Pimcore 6.6. noch keine Videos verwendet. Probiere das mal auf https://demo.pimcore.fun/admin/login?perspective= aus, wenn es da auch nicht geht, dann musst du ein Issue im github öffnen :slight_smile:

I tested a 100 mb video on the pimcore demo Server and I got the same mistake.
We now use the 6.4 version of pimcore where the videos work

Would you mind to open a report? So it can get fixed? https://github.com/pimcore/pimcore/issues/new

@r4a5a88 please see https://github.com/pimcore/pimcore/pull/6511

Hi,
I’ve updated the core version to:
Pimcore Platform (v6.6.5|abc6b383e8099070873369c0df3f8b7ff5b4d18e)

Sadly I can’t confirm that the reported issue was resolved with https://github.com/pimcore/pimcore/pull/6511.

This is also the case for Pimcore demo instance.

Thanks.

@tugboat-group sorry, it works on demo.


please try again by creating new folder and uploading a video as might be old directory still missing permissions.

Thank you dvesh3 for your reply.
Sadly after the update I can’t upload videos to an asset folder with the following errors:

DirectoryIterator::__construct(/home/data/websites/dam.bmf.tugboatgroup.com/pimcore6.6.5/web/var/tmp/image-thumbnails/ttt): failed to open dir: No such file or directory

{"success":false,"message":"DirectoryIterator::__construct(\/home\/data\/websites\/dam.bmf.tugboatgroup.com\/pimcore6.6.5\/web\/var\/tmp\/image-thumbnails\/ttt): failed to open dir: No such file or directory"}

To be sure that it is not a permission related issue I’ve reinstalled Pimcore again on my server.
Pimcore Platform (v6.6.5|abc6b383e8099070873369c0df3f8b7ff5b4d18e)

Unfortunately the error persists after the fresh install.
When I upload images or pdf documents I don’t experience this issue.

Is this a known issue? does it relates to the video preview update?

Appreciate your input on that.

Thanks again.

After a second look I can now assume that this is not only a local issue but a Pimcore bug.
On the Pimcore demo site this issue will persist.
https://demo.pimcore.fun/admin/?_dc=1591814721&perspective=DAM

Steps to reproduce

  • Create a folder under the “Home” root folder
  • Upload any video file

DirectoryIterator::__construct(/home/pimcoredemo/www/web/var/tmp/image-thumbnails/1): failed to open dir: No such file or directory

{“success”:false,“message”:“DirectoryIterator::__construct(/home/pimcoredemo/www/web/var/tmp/image-thumbnails/1): failed to open dir: No such file or directory”}