nextcloud / nextcloud/previewgenerator

Peview Generator refueses to make thumbnails for videos from Samsung (any android version) phones

Open
#546 11 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
520
Forks
55
PR merge metrics
No merged PRs in 30d

Description

How to use GitHub
  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce
  1. Record any video with Samsung
  2. Upload it to Nextcloud
  3. No profit - go to Memories app and not get any thumbnail for uploaded video. Of course this video can be played without any problem in Nextcloud, it’s just a problem with thumbnail.
Expected behaviour

Preview Generator should generate thumbnail for requested file

Actual behaviour
sudo -u www-data php occ preview:generate /directory/filename.mp4 -vvv

In Generator.php line 366:

  [OCP\Files\NotFoundException]
  No provider successfully handled the preview generation


Exception trace:
  at /var/www/nextcloud/lib/private/Preview/Generator.php:366
 OC\Preview\Generator->generateProviderPreview() at /var/www/nextcloud/lib/private/Preview/Generator.php:313
 OC\Preview\Generator->getMaxPreview() at /var/www/nextcloud/lib/private/Preview/Generator.php:117
 OC\Preview\Generator->generatePreviews() at /var/www/nextcloud/lib/private/PreviewManager.php:182
 OC\PreviewManager->generatePreviews() at /var/www/nextcloud/core/Command/Preview/Generate.php:92
 OC\Core\Command\Preview\Generate->execute() at /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at /var/www/nextcloud/3rdparty/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at /var/www/nextcloud/lib/private/Console/Application.php:187
 OC\Console\Application->run() at /var/www/nextcloud/console.php:87
 require_once() at /var/www/nextcloud/occ:33

preview:generate [-s|--size SIZE] [-c|--crop] [-m|--mode MODE] [--] <file>
Server configuration

Web server: Apache 2.4.58

Database: MariaDB

PHP version: 8.3

Nextcloud version: 31.0.5

List of activated apps
Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_external: 1.23.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - ldap_write_support: 1.13.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - memories: 7.5.2
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - previewgenerator: 5.8.0
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - survey_client: 3.0.0
  - suspicious_login: 9.0.1
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - theming_customcss: 1.18.0
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_ldap: 1.22.0
  - viewer: 4.0.0
  - webhook_listeners: 1.2.0
  - workflow_media_converter: 1.13.5
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - contactsinteraction: 1.12.0 (installed 1.9.0)
  - encryption: 2.19.0
  - files_rightclick: 0.15.1 (installed 0.15.1)
  - files_scripts: 4.1.0 (installed 4.0.3)
  - sharebymail: 1.21.0 (installed 1.18.0)
  - support: 3.0.0 (installed 1.11.0)
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_status: 1.11.0 (installed 1.8.1)
  - video_converter: 1.0.6 (installed 1.0.6)
  - weather_status: 1.11.0 (installed 1.8.0)
  - workflow_script: 2.0.0 (installed 2.0.0)
Nextcloud configuration
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nc.p12.com.pl",
            "192.168.1.112"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.5.1",
        "overwrite.cli.url": "https:\/\/192.168.1.112",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "theme": "",
        "loglevel": 2,
        "twofactor_enforced": "false",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [],
        "defaultapp": "memories,files,dashboard",
        "memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\Movie",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\Image",
            "OC\\Preview\\HEIC"
        ],
        "preview_max_memory": 5120,
        "skeletondirectory": "",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.video_default_quality": "-1",
        "preview_max_filesize_image": 10240,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "app_install_overwrite": [
            "video_converter",
            "files_rightclick"
        ],
        "maintenance_window_start": 23,
        "memories.db.triggers.fcu": true,
        "preview_max_x": 4096,
        "preview_max_y": 4096
    }
}
Browser

Browser name: Brave

Browser version: 1.78.102

Operating system: Ubuntu 24.04.2

Additionally, information about files that worked/ didn't work with Preview Generator

File that worked:


General
Format :	MPEG-4
Format profile :	Base Media / Version 2
Codec ID :	mp42 (isom/mp42)
File size :	18.0 MiB
Duration :	7 s 280 ms
Overall bit rate :	20.7 Mb/s
Frame rate :	30.051 FPS
Encoded date :	2025-06-09 21:22:56 UTC
Tagged date :	2025-06-09 21:22:56 UTC
Writing operating system :	Google Android 15
Writing hardware :	motorola edge 50 ultra
Video
ID :	1
Format :	AVC
Format/Info :	Advanced Video Codec
Format profile :	High@L4.1
Format settings :	CABAC / 1 Ref Frames
Format settings, CABAC :	Yes
Format settings, Reference frames :	1 frame
Format settings, GOP :	M=1, N=30
Codec ID :	avc1
Codec ID/Info :	Advanced Video Coding
Duration :	7 s 188 ms
Bit rate :	20.3 Mb/s
Width :	1 920 pixels
Height :	1 080 pixels
Display aspect ratio :	16:9
Frame rate mode :	Variable
Frame rate :	30.051 FPS
Minimum frame rate :	27.916 FPS
Maximum frame rate :	32.491 FPS
Standard :	PAL
Color space :	YUV
Chroma subsampling :	4:2:0
Bit depth :	8 bits
Scan type :	Progressive
Bits/(Pixel*Frame) :	0.325
Stream size :	17.4 MiB (97%)
Title :	VideoHandle
Language :	English
Encoded date :	2025-06-09 21:22:56 UTC
Tagged date :	2025-06-09 21:22:56 UTC
Color range :	Full
colour_range_Original :	Limited
Color primaries :	BT.601 PAL
colour_primaries_Original :	BT.709
Transfer characteristics :	BT.709
Matrix coefficients :	BT.601
matrix_coefficients_Original :	BT.709
mdhd_Duration :	7188
Codec configuration box :	avcC
Audio
ID :	2
Format :	AAC LC
Format/Info :	Advanced Audio Codec Low Complexity
Codec ID :	mp4a-40-2
Duration :	7 s 280 ms
Source duration :	7 s 211 ms
Bit rate mode :	Constant
Nominal bit rate :	256 kb/s
Channel(s) :	2 channels
Channel layout :	L R
Sampling rate :	48.0 kHz
Frame rate :	46.875 FPS (1024 SPF)
Compression mode :	Lossy
Source stream size :	225 KiB (1%)
Title :	SoundHandle
Language :	English
Encoded date :	2025-06-09 21:22:56 UTC
Tagged date :	2025-06-09 21:22:56 UTC
mdhd_Duration :	7280

General
Format :	MPEG-4
Format profile :	Base Media / Version 2
Codec ID :	mp42 (isom/mp42)
File size :	71.7 MiB
Duration :	34 s 802 ms
Overall bit rate mode :	Variable
Overall bit rate :	17.3 Mb/s
Frame rate :	30.000 FPS
Encoded date :	2018-04-22 10:47:09 UTC
Tagged date :	2018-04-22 10:47:09 UTC
Writing operating system :	Google Android 7.0
Video
ID :	1
Format :	AVC
Format/Info :	Advanced Video Codec
Format profile :	Constrained Baseline@L4
Format settings :	1 Ref Frames
Format settings, CABAC :	No
Format settings, Reference frames :	1 frame
Format settings, GOP :	M=1, N=31
Format settings, Slice count :	2 slices per frame
Codec ID :	avc1
Codec ID/Info :	Advanced Video Coding
Duration :	34 s 802 ms
Source duration :	34 s 817 ms
Bit rate mode :	Variable
Bit rate :	17.0 Mb/s
Width :	1 920 pixels
Height :	1 080 pixels
Display aspect ratio :	16:9
Frame rate mode :	Variable
Frame rate :	30.000 FPS
Minimum frame rate :	21.062 FPS
Maximum frame rate :	39.982 FPS
Color space :	YUV
Chroma subsampling :	4:2:0
Bit depth :	8 bits
Scan type :	Progressive
Bits/(Pixel*Frame) :	0.273
Stream size :	70.6 MiB (98%)
Source stream size :	70.6 MiB (98%)
Title :	VideoHandle
Language :	English
Encoded date :	2018-04-22 10:47:09 UTC
Tagged date :	2018-04-22 10:47:09 UTC
Color range :	Limited
Color primaries :	BT.709
Transfer characteristics :	BT.709
Matrix coefficients :	BT.709
mdhd_Duration :	34802
Codec configuration box :	avcC
Audio
ID :	2
Format :	AAC LC
Format/Info :	Advanced Audio Codec Low Complexity
Codec ID :	mp4a-40-2
Duration :	34 s 731 ms
Bit rate mode :	Constant
Bit rate :	192 kb/s
Channel(s) :	2 channels
Channel layout :	L R
Sampling rate :	48.0 kHz
Frame rate :	46.875 FPS (1024 SPF)
Compression mode :	Lossy
Stream size :	814 KiB (1%)
Title :	SoundHandle
Language :	English
Encoded date :	2018-04-22 10:47:09 UTC
Tagged date :	2018-04-22 10:47:09 UTC
mdhd_Duration :	34731

Files that didn't work:


General
Format :	MPEG-4
Format profile :	Base Media / Version 2
Codec ID :	mp42 (isom/mp42)
File size :	88.8 MiB
Duration :	1 min 0 s
Overall bit rate :	12.2 Mb/s
Frame rate :	29.891 FPS
Encoded date :	2025-06-07 18:16:24 UTC
Tagged date :	2025-06-07 18:16:24 UTC
Recorded location :	
Writing operating system :	Google Android 15
Writing hardware :	Samsung Galaxy S25 (SM-S931B)
com.android.video.temporal_layers_count :	Unknown kind of value!
com.samsung.android.utc_offset :	+0200
Video
ID :	1
Format :	HEVC
Format/Info :	High Efficiency Video Coding
Format profile :	Main 10@L4@Main
Codec ID :	hvc1
Codec ID/Info :	High Efficiency Video Coding
Duration :	1 min 0 s
Source duration :	1 min 0 s
Bit rate :	12.0 Mb/s
Width :	1 920 pixels
Height :	1 080 pixels
Display aspect ratio :	16:9
Rotation :	180°
Frame rate mode :	Variable
Frame rate :	29.891 FPS
Minimum frame rate :	15.005 FPS
Maximum frame rate :	33.645 FPS
Real frame rate :	30.000 FPS
Color space :	YUV
Chroma subsampling :	4:2:0
Bit depth :	10 bits
Bits/(Pixel*Frame) :	0.193
Stream size :	86.9 MiB (98%)
Source stream size :	86.9 MiB (98%)
Title :	VideoHandle
Language :	English
Encoded date :	2025-06-07 18:16:24 UTC
Tagged date :	2025-06-07 18:16:24 UTC
Color range :	Limited
Color primaries :	BT.2020
Transfer characteristics :	HLG
Matrix coefficients :	BT.2020 non-constant
mdhd_Duration :	60989
Codec configuration box :	hvcC
Audio
ID :	2
Format :	AAC LC
Format/Info :	Advanced Audio Codec Low Complexity
Codec ID :	mp4a-40-2
Duration :	1 min 0 s
Bit rate mode :	Constant
Bit rate :	256 kb/s
Channel(s) :	2 channels
Channel layout :	L R
Sampling rate :	48.0 kHz
Frame rate :	46.875 FPS (1024 SPF)
Compression mode :	Lossy
Stream size :	1.86 MiB (2%)
Title :	SoundHandle
Language :	English
Encoded date :	2025-06-07 18:16:24 UTC
Tagged date :	2025-06-07 18:16:24 UTC

General
Format :	MPEG-4
Format profile :	Base Media / Version 2
Codec ID :	mp42 (isom/mp42)
File size :	29.4 MiB
Duration :	20 s 45 ms
Overall bit rate :	12.3 Mb/s
Frame rate :	29.970 FPS
Encoded date :	2025-06-09 20:48:58 UTC
Tagged date :	2025-06-09 20:48:58 UTC
Writing operating system :	Google Android 15
Writing hardware :	Samsung Galaxy S25 (SM-S931B)
com.samsung.android.utc_offset :	+0200
Video
ID :	1
Format :	AVC
Format/Info :	Advanced Video Codec
Format profile :	High@L3.1
Format settings :	CABAC / 1 Ref Frames
Format settings, CABAC :	Yes
Format settings, Reference frames :	1 frame
Format settings, GOP :	M=1, N=30
Codec ID :	avc1
Codec ID/Info :	Advanced Video Coding
Duration :	20 s 45 ms
Bit rate :	12.0 Mb/s
Width :	1 280 pixels
Height :	720 pixels
Display aspect ratio :	16:9
Frame rate mode :	Variable
Frame rate :	29.970 (29970/1000) FPS
Minimum frame rate :	19.235 FPS
Maximum frame rate :	30.020 FPS
Real frame rate :	30.000 FPS
Standard :	PAL
Color space :	YUV
Chroma subsampling :	4:2:0
Bit depth :	8 bits
Scan type :	Progressive
Bits/(Pixel*Frame) :	0.436
Stream size :	28.8 MiB (98%)
Title :	VideoHandle
Language :	English
Encoded date :	2025-06-09 20:48:58 UTC
Tagged date :	2025-06-09 20:48:58 UTC
Color range :	Limited
Color primaries :	BT.709
Transfer characteristics :	BT.709
Matrix coefficients :	BT.709
mdhd_Duration :	20045
Codec configuration box :	avcC
Audio
ID :	2
Format :	AAC LC
Format/Info :	Advanced Audio Codec Low Complexity
Codec ID :	mp4a-40-2
Duration :	20 s 32 ms
Bit rate mode :	Constant
Bit rate :	256 kb/s
Channel(s) :	2 channels
Channel layout :	L R
Sampling rate :	48.0 kHz
Frame rate :	46.875 FPS (1024 SPF)
Compression mode :	Lossy
Stream size :	626 KiB (2%)
Title :	SoundHandle
Language :	English
Encoded date :	2025-06-09 20:48:58 UTC
Tagged date :	2025-06-09 20:48:58 UTC
General
Format :	MPEG-4
Format profile :	Base Media / Version 2
Codec ID :	mp42 (isom/mp42)
File size :	40.5 MiB
Duration :	19 s 662 ms
Overall bit rate :	17.3 Mb/s
Frame rate :	30.000 FPS
Encoded date :	2023-06-21 19:18:51 UTC
Tagged date :	2023-06-21 19:18:51 UTC
Writing operating system :	Google Android 13
Writing hardware :	Samsung SM-G990B2
Video
ID :	1
Format :	AVC
Format/Info :	Advanced Video Codec
Format profile :	High@L4
Format settings :	CABAC / 1 Ref Frames
Format settings, CABAC :	Yes
Format settings, Reference frames :	1 frame
Format settings, GOP :	M=1, N=30
Codec ID :	avc1
Codec ID/Info :	Advanced Video Coding
Duration :	19 s 662 ms
Bit rate :	17.0 Mb/s
Width :	1 920 pixels
Height :	1 080 pixels
Display aspect ratio :	16:9
Rotation :	90°
Frame rate mode :	Variable
Frame rate :	30.000 FPS
Minimum frame rate :	29.278 FPS
Maximum frame rate :	30.822 FPS
Real frame rate :	30.000 FPS
Standard :	PAL
Color space :	YUV
Chroma subsampling :	4:2:0
Bit depth :	8 bits
Scan type :	Progressive
Bits/(Pixel*Frame) :	0.273
Stream size :	39.8 MiB (98%)
Title :	VideoHandle
Language :	English
Encoded date :	2023-06-21 19:18:51 UTC
Tagged date :	2023-06-21 19:18:51 UTC
Color range :	Limited
Color primaries :	BT.709
Transfer characteristics :	BT.709
Matrix coefficients :	BT.709
Codec configuration box :	avcC
Audio
ID :	2
Format :	AAC LC
Format/Info :	Advanced Audio Codec Low Complexity
Codec ID :	mp4a-40-2
Duration :	19 s 632 ms
Source duration :	19 s 605 ms
Bit rate mode :	Constant
Bit rate :	256 kb/s
Channel(s) :	2 channels
Channel layout :	L R
Sampling rate :	48.0 kHz
Frame rate :	46.875 FPS (1024 SPF)
Compression mode :	Lossy
Stream size :	613 KiB (1%)
Source stream size :	613 KiB (1%)
Title :	SoundHandle
Language :	English
Encoded date :	2023-06-21 19:18:51 UTC
Tagged date :	2023-06-21 19:18:51 UTC
mdhd_Duration :	19632

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the preview:generate command and the lib/private/Preview/Generator.php stack trace, then inspect the enabled OC\Preview\Movie provider. Reproduce the failure with the Samsung HEVC video described in the issue and compare it with the working files. Done means a thumbnail is generated for the affected Samsung video.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.