Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Preview of MP4 Videos failing to generate with ffmpeg/avconf #984

Open
1 of 4 tasks
br4yd opened this issue Jan 3, 2024 · 31 comments
Open
1 of 4 tasks

[Bug]: Preview of MP4 Videos failing to generate with ffmpeg/avconf #984

br4yd opened this issue Jan 3, 2024 · 31 comments
Labels
needs triage To be triaged

Comments

@br4yd
Copy link

br4yd commented Jan 3, 2024

Hello, the following issue is a bug I already reported to nextcloud/server. Upon their request I'll also open an issue here because it is either a nextcloud/server bug or pulsejet/memories bug. See the related comment here.

For the original issue at nextcloud/server please see here.


Bug description

Hello,
when trying to watch a video uploaded by any of my Android devices (Samsung Galaxy S21 FE, Google Pixel 2 XL or Google Pixel 8 Pro (running GrapheneOS)) I'm unable to watch the video. In the overview of Memories and Photos or event the files app I get a preview image. However when clicking on it, I only get sound from the playback but no video. Just a black screen. In addition videos uploaded from an iPhone are playable without any issues.

When doing so I also get an error message in the top right corner telling me to check the protocol because the preview failed. Doing so gives me the following error:

Movie preview generation failed Output: ffmpeg version 6.0.1 Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.1 (Alpine 12.2.1_git20220924-r10) 20220924 configuration: --prefix=/usr --disable-librtmp --disable-lzma --disable-static --disable-stripping --enable-avfilter --enable-gnutls --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopenmpt --enable-libopus --enable-libplacebo --enable-libpulse --enable-librist --enable-libsoxr --enable-libsrt --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-lto --enable-pic --enable-postproc --enable-pthreads --enable-shared --enable-vaapi --enable-vdpau --enable-vulkan --optflags=-O3 --enable-libjxl --enable-libsvtav1 --enable-libvpl libavutil 58. 2.100 / 58. 2.100 libavcodec 60. 3.100 / 60. 3.100 libavformat 60. 3.100 / 60. 3.100 libavdevice 60. 1.100 / 60. 1.100 libavfilter 9. 3.100 / 9. 3.100 libswscale 7. 1.100 / 7. 1.100 libswresample 5. 0.100 / 5. 0.100 libpostproc 57. 1.100 / 57. 1.100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f75a2446680] moov atom not found /tmp/oc_tmp_lcmODH: Invalid data found when processing input

This issue makes it impossible for me to use my Nextcloud for my photo and video backup because it's not really usable if I can't watch the videos I've backed up. I hope there's some fix for that.

I also found some related issues that can maybe help to trace this issue.

  • There is Preview of MP4 Videos failing to generate with ffmpeg/avconf if larger than 5MB nextcloud/server#1475 which was created in 2016 and closed without any real solution for endusers and hasn't been reopened since then. Someone asked about reopening the issue back in 2021 because of no fix but it is still closed. This indicates for me that this bug happens in some cases since at least 2016 and is not fixed since then (?).
  • I found another issue in another repo Movie preview generation failed nextcloud/previewgenerator#319 but in this persons case it seems like the file was corrupt. I'm not sure if it really was corrupt in this person's case or if it was the way his videos were stored by Android. As OP wrote in the previous issue "If the moov atom is at the beginning of a video, the preview generation works. If the the moov atom is at end of the video, the generation fails." there seem to just be some Android phones that put the moov atom at the end of the video (I'm not an expert in this topic and don't know what it is. I'm just trying to pinpoint the issue to get it to work)
  • There's also an unresolved conversation about this or a related issue with the moov atom that can't be found in the Community Forums at https://help.nextcloud.com/t/thumbnails-video-preview-not-working-for-videos-longer-than-1-second/107295. This one is open and unresolved since 2021.

In nextcloud/server#1475 there was also some solution as it seems to change something up in some PHP file but due to AIO running inside Docker I don't want to fiddle around and change any of the files of Nextcloud inside the Docker installation. My goal is not to break anything and it wouldn't be a reasonable approach for me as an enduser to change something inside the code (as it seems) to try to fix this just on my end.

Steps to reproduce

  1. Set up Nextcloud AIO on Debian 12 using Object Storage as primary storage
  2. Install Memories app and add Memories Community App to AIO
  3. Enable hardware encoding, preview generation etc. in the settings of the Memories app (everything should be green for you)
  4. Try to open and play a MP4 video with that moov atom at the end of a video that is larger than 5 MB (which reasonable is not large for an MP4 file nowadays. A 4K60 video is much larger if it's just a few seconds long)
  5. See error message and check protocols to see above mentioned error

Expected behavior

Video should just play as normal

Installation method

Official All-in-One appliance

Nextcloud Server version

28

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Apache (supported)

Database engine version

PostgreSQL

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "appsallowlist": [],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "***REMOVED SENSITIVE VALUE***",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "***REMOVED SENSITIVE VALUE***"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "28.0.1.1",
        "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "updatedirectory": "\/nc-updater",
        "loglevel": "2",
        "app_install_overwrite": [
            "nextcloud-aio",
            "news",
            "integration_homeassistant",
            "checksum",
            "riotchat",
            "memories",
            "facerecognition"
        ],
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "log_rotate_size": "10485760",
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": "2048",
        "preview_max_y": "2048",
        "jpeg_quality": "60",
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\Krita",
            "0": "OC\\Preview\\Imaginary"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": "30",
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "http:\/\/nextcloud-aio-imaginary:9000",
        "objectstore": {
            "class": "\\OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "bucket": "***REMOVED SENSITIVE VALUE***",
                "autocreate": true,
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***",
                "hostname": "s3.nl-ams.scw.cloud",
                "port": 443,
                "use_ssl": true,
                "region": "nl-ams",
                "sse_c_key": "***REMOVED SENSITIVE VALUE***"
            }
        },
        "default_language": "de",
        "default_locale": "de",
        "default_phone_region": "DE",
        "default_timezone": "Europe\/Berlin",
        "mail_smtpauth": 1,
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "defaultapp": "",
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-musl",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.vod.disable": false,
        "memories.vod.external": true,
        "memories.vod.connect": "nextcloud-aio-memories:47788",
        "memories.vod.vaapi": true,
        "memories.vod.nvenc": true
    }
}

List of activated Apps

Enabled:
  - activity: 2.20.0
  - admin_audit: 1.18.0
  - app_api: 1.4.4
  - assistant: 1.0.3
  - bruteforcesettings: 2.8.0
  - calendar: 4.6.1
  - camerarawpreviews: 0.8.4
  - circles: 28.0.0-dev
  - cloud_federation_api: 1.11.0
  - collectives: 2.9.2
  - comments: 1.18.0
  - contacts: 5.5.0
  - contactsinteraction: 1.9.0
  - dashboard: 7.8.0
  - dav: 1.29.1
  - federatedfilesharing: 1.18.0
  - federation: 1.18.0
  - files: 2.0.0
  - files_antivirus: 5.4.0
  - files_external: 1.20.0
  - files_fulltextsearch: 28.0.0
  - files_pdfviewer: 2.9.0
  - files_reminders: 1.1.0
  - files_sharing: 1.20.0
  - files_trashbin: 1.18.0
  - files_versions: 1.21.0
  - firstrunwizard: 2.17.0
  - forms: 4.0.0
  - fulltextsearch: 28.0.0
  - fulltextsearch_elasticsearch: 28.0.0
  - gpxpod: 5.0.14
  - groupfolders: 16.0.1
  - impersonate: 1.15.0
  - logreader: 2.13.0
  - lookup_server_connector: 1.16.0
  - mail: 3.5.0
  - memories: 6.1.5
  - nextcloud-aio: 0.4.0
  - nextcloud_announcements: 1.17.0
  - notes: 4.9.2
  - notifications: 2.16.0
  - notify_push: 0.6.6
  - oauth2: 1.16.3
  - password_policy: 1.18.0
  - photos: 2.4.0
  - previewgenerator: 5.4.0
  - privacy: 1.12.0
  - provisioning_api: 1.18.0
  - recognize: 6.0.1
  - recommendations: 2.0.0
  - related_resources: 1.3.0
  - richdocuments: 8.3.0
  - riotchat: 0.16.5
  - serverinfo: 1.18.0
  - settings: 1.10.1
  - sharebymail: 1.18.0
  - side_menu: 3.11.2
  - spreed: 18.0.1
  - support: 1.11.0
  - survey_client: 1.16.0
  - suspicious_login: 6.0.0
  - systemtags: 1.18.0
  - tasks: 0.15.0
  - text: 3.9.1
  - theming: 2.3.0
  - twofactor_backupcodes: 1.17.0
  - twofactor_totp: 10.0.0-beta.2
  - user_status: 1.8.1
  - viewer: 2.2.0
  - weather_status: 1.8.0
  - workflowengine: 2.10.0
Disabled:
  - encryption: 2.16.0
  - files_rightclick: 0.15.1 (installed 1.6.0)
  - user_ldap: 1.19.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

Mentioned above in my description

Additional info

NONE

@br4yd br4yd added the needs triage To be triaged label Jan 3, 2024
@pulsejet
Copy link
Owner

pulsejet commented Jan 3, 2024

I'm very confused. The title says you're missing the preview but you say you can see the preview but not the video?

Also what codec is this? This happens with HEVC mostly

@br4yd
Copy link
Author

br4yd commented Jan 3, 2024

I'm very confused. The title says you're missing the preview but you say you can see the preview but not the video?

Also what codec is this? This happens with HEVC mostly

Hey, sorry for the confusion. The preview image in the overview inside Memories is working for the videos. What's not working is playback. When trying to play back the video files the sound is working and it shows the generated preview image as a still image. However the video itself is not playing.

After a few seconds it shows the error that the transcoding failed.
image
But this only happens for MP4 files that are larger than 5MB and have the moov atom at the end of the file. Some Android phones seem to create files like that. I.e. my Pixel 8 Pro with GrapheneOS does. Playing back other video files (even MP4 files) where the moov atom is not at the end (or where it's at the end but smaller than 5 MB) the playback and the transcoding works fine. As seen in the linked threads and issues this seems to be an issue that is existing for a longer time in some cases under certain circumstances, but it doesn't seem like someone was really able to figure out the exact source and be able to fix it since then.

To answer your other question, here's the output of mediainfo of a file where this happens:

General
Complete name                            : PXL_20231231_230705548.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/mp41)
File size                                : 31.1 MiB
Duration                                 : 6 s 143 ms
Overall bit rate                         : 42.5 Mb/s
Frame rate                               : 23.928 FPS
Encoded date                             : 2023-12-31 23:07:13 UTC
Tagged date                              : 2023-12-31 23:07:13 UTC
xyz                                      : ***REDACTED***
com.android.manufacturer                 : Google
com.android.model                        : Pixel 8 Pro

Video
ID                                       : 3
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main@L5.1@Main
Codec ID                                 : hvc1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 6 s 143 ms
Bit rate                                 : 42.2 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 23.928 FPS
Minimum frame rate                       : 23.616 FPS
Maximum frame rate                       : 24.220 FPS
Real frame rate                          : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Bits/(Pixel*Frame)                       : 0.213
Stream size                              : 30.9 MiB (99%)
Title                                    : VideoHandle
Language                                 : English
Encoded date                             : 2023-12-31 23:07:13 UTC
Tagged date                              : 2023-12-31 23:07:13 UTC
Color range                              : Full
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709
Codec configuration box                  : hvcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 6 s 121 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                              : 143 KiB (0%)
Title                                    : SoundHandle
Language                                 : English
Encoded date                             : 2023-12-31 23:07:13 UTC
Tagged date                              : 2023-12-31 23:07:13 UTC

Other
Type                                     : meta
Duration                                 : 6 s 143 ms
Bit rate mode                            : Variable

@pulsejet
Copy link
Owner

pulsejet commented Jan 5, 2024

What's in your go-vod logs?

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

Where do I find those in case of using Nextcloud AIO and the Memories community container? Looked into the nextcloud-aio-memories container but I only see the binary file there at first glance

@szaimen
Copy link
Contributor

szaimen commented Jan 5, 2024

Maybe sudo docker logs nextcloud-aio-memories ?

@szaimen
Copy link
Contributor

szaimen commented Jan 5, 2024

@pulsejet does the container print the logs to stdout?

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

Maybe sudo docker logs nextcloud-aio-memories ?

It only logs the following:

Fetched https://portal.braydmedia.de/index.php/apps/memories/static/go-vod?arch=x86_64 successfully!
2024/01/05 04:05:26 &{Version:0.2.4 Configured:false VersionMonitor:true Bind::47788 FFmpeg:/usr/local/bin/ffmpeg FFprobe:/usr/local/bin/ffprobe TempDir:/tmp/go-vod ChunkSize:3 LookBehind:3 GoalBufferMin:1 GoalBufferMax:4 StreamIdleTime:60 ManagerIdleTime:60 QF:0 VAAPI:false VAAPILowPower:false NVENC:false NVENCTemporalAQ:false NVENCScale: UseTranspose:false UseGopSize:false}
2024/01/05 04:05:26 Starting go-vod 0.2.4 on :47788

Nothing else

@pulsejet
Copy link
Owner

pulsejet commented Jan 5, 2024

Is your transcoding configured right? What does the Memories admin panel say? (you need to set the connect address to point to the external container, and turn on the external transcoder)

does the container print the logs to stdout?

Yeah, as soon as you play a video.

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

Is your transcoding configured right? What does the Memories admin panel say? (you need to set the connect address to point to the external container, and turn on the external transcoder)

does the container print the logs to stdout?

Yeah, as soon as you play a video.

It seems like it is. See screenshot below for reference:
image

@pulsejet
Copy link
Owner

pulsejet commented Jan 5, 2024

Try checking both the Nextcloud and the go-vod logs when you play a video. Nothing shows up anywhere?

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

Nope neither in the nextcloud-aio-nextcloud container nor in the nextcloud-aio-memories container and also not in the nextcloud protocolls itself in the admin interface. The only thing that happens is that I hear the sound without the video and after a few seconds I get the Transcoding failed message of which I added the screenshot in this issue few comments above.

@pulsejet
Copy link
Owner

pulsejet commented Jan 5, 2024

Okay then your Nextcloud isn't talking to the transcoder at all. No idea what's going on here.

@pulsejet
Copy link
Owner

pulsejet commented Jan 5, 2024

This would explain the black screen as well; browsers can't play HEVC (which your file is), so it just plays the audio. Memories would normally transcode the video with go-vod but that's not working either.

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

Hm but how is the Nextcloud then saying it found the file etc.?
The Nextcloud container is also able to ping it from the CLI.
image

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

I do have some errors in the protocols that could be realted? It seems to me like the Android app is asking the server for previews and the server tries to generate and fails. Not sure if it is really related but those are the only logs or errors I get at any point. I get them around the clock though while everything in the Nextcloud itself is working as expected (besides the video playback).
clipboard

@szaimen
Copy link
Contributor

szaimen commented Jan 5, 2024

I the video located on external storage or primary object storage?

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

I the video located on external storage or primary object storage?

Primary object storage. Only using external storage for a folder that connects to my NAS and retrieves my Paperless-NGX archived files. So in general no video files are stored in external storage. Only in the object storage that is set as primary storage.

@szaimen
Copy link
Contributor

szaimen commented Jan 5, 2024

Primary object storage.

Interesting! I didnt know that this is possible with AIO...

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

Primary object storage.

Interesting! I didnt know that this is possible with AIO...

Sure. Just set everything up as a clean install, didn't store any files and then created a bash shell for the nextcloud-aio-nextcloud container. Then in there you can edit the config.php with vi and add your configuration stuff for the Obect Storage as a primary storage. And then on the other hand you just have to save it, get out and restart everything. Done.

Basically it's this part:

"objectstore": {
            "class": "\\OC\\Files\\ObjectStore\\S3",
            "arguments": {
                "bucket": "***REMOVED SENSITIVE VALUE***",
                "autocreate": true,
                "key": "***REMOVED SENSITIVE VALUE***",
                "secret": "***REMOVED SENSITIVE VALUE***",
                "hostname": "s3.nl-ams.scw.cloud",
                "port": 443,
                "use_ssl": true,
                "region": "nl-ams",
                "sse_c_key": "***REMOVED SENSITIVE VALUE***"
            }
        },

@szaimen
Copy link
Contributor

szaimen commented Jan 5, 2024

Just as a note: I would disrecommend to actually do this with AIO since it basically kills AIOs backup solution as your data is not backed up in that case because it doesnt exist locally anymore. @br4yd Please read carefully through the discussion in nextcloud/all-in-one#1807

Also this is the reason why the memories container cannot transcode the video because it is not existing on your disk. Correct @pulsejet?

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

Just as a note: I would disrecommend to actually do this with AIO since it basically kills AIOs backup solution as your data is not backed up in that case because it doesnt exist locally anymore. @br4yd Please read carefully through the discussion in nextcloud/all-in-one#1807

Also this is the reason why the memories container cannot transcode the video because it is not existing on your disk. Correct @pulsejet?

Hm files are too much for local storage though because in this case I'd need larger disks which would add up to an amount to expensive to run / host. That's why I am using Object Storage.

However when I restore from a backup it should still retrieve everything as it will just reconnect to the Object Storage. The only issue I see is that if my backup is created at 4am and I upload a file at 5am that is uploaded to the object storage, When I then restore the backup the file still exists in Object Storage but isn't there for the Nextcloud because the database on the local system doesn't know about the file. The file therefore stays "in limbo" on the object storage and will never be deleted or accessed again. If uploaded from the Nextcloud again it's just there as a duplicate in the Object Storage.

But other than that I don't see any issue restoring from the backup or do I oversee something here?

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

Addition: the answer in the thread you links says:

which brings the advantage that the built-in backup solution works, or you use this: https://github.com/nextcloud/all-in-one/tree/main/manual-install

Following that link it basically says installing AIO in docker-compose. So using AIO in docker compose and using Object Storage as Primary Storage is supported as far as I understand. This is the case for my setup. I run everything inside Portainer so basically with Docker Compose.

@szaimen
Copy link
Contributor

szaimen commented Jan 5, 2024

But other than that I don't see any issue restoring from the backup or do I oversee something here?

Yes, see nextcloud/all-in-one#1807 (reply in thread)

Also when restoring, you would usually need to restore the db and the files at the same time since otherwise the db and your files get out of sync which is one of the worst case scenarios that could happen when you use primary storage as scanning is not possible or at least very limited afaik.

@br4yd
Copy link
Author

br4yd commented Jan 5, 2024

Meh in this case I guess I have to reinstall the whole server because backups should at least work without loosing any files in case of a drive failure or whatever...
Will do that tomorrow using the default datadir method. However won't this method cause large costs for download traffic from the bucket? Like wouldn't it need to fetch every single file once a day when doing the backup?

@br4yd
Copy link
Author

br4yd commented Jan 6, 2024

I reinstalled now and mounted the object storage via s3fs. I also enabled caching of s3fs and mounted the folder to use it as the datadir for Nextcloud AIO.
Nextcloud doesn't show any errors in the protocol but the performance is very bad. Even compared to before when I had the object storage set up via the config.php. The performance is so bad right now that it takes about 10 seconds+ to open any folder and that it fails completely to play any video.

Will try to imrpove this somehow tomorrow to be able to test if the transcoding issue is gone. Not sure how to make the performance better though.

@br4yd
Copy link
Author

br4yd commented Jan 7, 2024

Ok for the moment I now got rid of object storage and moved the files with rclone to the exact place the object storage was mounted. So for the Nextcloud AIO container the datadir did not change. The performance is now much better. Will probably have to use GlusterFS in the future.

However video playback is still not working. It doesn't throw an error in the user interface anymore but it logs errors in the nextcloud-aio-memories container as well as in the protocol.

nextcloud-aio-memories

Are you sure the host is reachable and running Memories v6+?
Retrying in 10 seconds...
Fetched https://portal.braydmedia.de/index.php/apps/memories/static/go-vod?arch=x86_64 successfully!
2024/01/07 14:37:35 &{Version:0.2.4 Configured:false VersionMonitor:true Bind::47788 FFmpeg:/usr/local/bin/ffmpeg FFprobe:/usr/local/bin/ffprobe TempDir:/tmp/go-vod ChunkSize:3 LookBehind:3 GoalBufferMin:1 GoalBufferMax:4 StreamIdleTime:60 ManagerIdleTime:60 QF:0 VAAPI:false VAAPILowPower:false NVENC:false NVENCTemporalAQ:false NVENCScale: UseTranspose:false UseGopSize:false}
2024/01/07 14:37:35 Starting go-vod 0.2.4 on :47788
2024/01/07 14:38:38 &{Version:0.2.4 Configured:true VersionMonitor:true Bind::47788 FFmpeg:/usr/local/bin/ffmpeg FFprobe:/usr/local/bin/ffprobe TempDir:/tmp/go-vod ChunkSize:3 LookBehind:3 GoalBufferMin:1 GoalBufferMax:4 StreamIdleTime:60 ManagerIdleTime:60 QF:24 VAAPI:true VAAPILowPower:false NVENC:true NVENCTemporalAQ:false NVENCScale:cuda UseTranspose:false UseGopSize:false}
2024/01/07 14:38:38 11j08khb7ll0: new manager for /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240101_020928790.mp4
2024/01/07 14:38:39 11j08khb7ll0-480p: stopping stream
2024/01/07 14:38:39 11j08khb7ll0-480p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240101_020928790.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=854:h=854" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/11j08khb7ll0-3330139188/480p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:38:39 ffmpeg-error: [AVHWDeviceContext @ 0x560232a01c00] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:38:39 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:38:39 ffmpeg-error: [hevc @ 0x560232a0c240] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:38:39 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:38:39 11j08khb7ll0-480p: ffmpeg exited with status: 1
2024/01/07 14:38:40 11j08khb7ll0-720p: stopping stream
2024/01/07 14:38:40 11j08khb7ll0-720p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240101_020928790.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=1280:h=1280" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/11j08khb7ll0-3330139188/720p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:38:40 ffmpeg-error: [AVHWDeviceContext @ 0x55e572cb8c00] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:38:40 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:38:40 ffmpeg-error: [hevc @ 0x55e572cc3240] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:38:40 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:38:40 11j08khb7ll0-720p: ffmpeg exited with status: 1
2024/01/07 14:38:40 11j08khb7ll0-1080p: stopping stream
2024/01/07 14:38:40 11j08khb7ll0-1080p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240101_020928790.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=1920:h=1920" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/11j08khb7ll0-3330139188/1080p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:38:40 ffmpeg-error: [AVHWDeviceContext @ 0x56447c8d3c00] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:38:40 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:38:40 ffmpeg-error: [hevc @ 0x56447c8de240] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:38:40 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:38:40 11j08khb7ll0-1080p: ffmpeg exited with status: 1
2024/01/07 14:38:40 11j08khb7ll0-1440p: stopping stream
2024/01/07 14:38:40 11j08khb7ll0-1440p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240101_020928790.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=2560:h=2560" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/11j08khb7ll0-3330139188/1440p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:38:40 ffmpeg-error: [AVHWDeviceContext @ 0x558531e39c00] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:38:40 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:38:40 ffmpeg-error: [hevc @ 0x558531e44240] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:38:40 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:38:40 11j08khb7ll0-1440p: ffmpeg exited with status: 1
2024/01/07 14:38:41 11j08khb7ll0-max: stopping stream
2024/01/07 14:38:41 11j08khb7ll0-max: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240101_020928790.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/11j08khb7ll0-3330139188/max-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:38:41 ffmpeg-error: [AVHWDeviceContext @ 0x564f3497dc00] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:38:41 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:38:41 ffmpeg-error: [hevc @ 0x564f34988240] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:38:41 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:38:41 11j08khb7ll0-max: ffmpeg exited with status: 1
2024/01/07 14:39:38 11j08khb7ll0-1440p: stopping stream
2024/01/07 14:39:38 11j08khb7ll0-1080p: stopping stream
2024/01/07 14:39:38 11j08khb7ll0-480p: stopping stream
2024/01/07 14:39:38 11j08khb7ll0-max: stopping stream
2024/01/07 14:39:48 11j08khb7ll0-720p: stopping stream
2024/01/07 14:40:07 sd7op31d4t00: new manager for /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240103_232732456.mp4
2024/01/07 14:40:08 sd7op31d4t00-480p: stopping stream
2024/01/07 14:40:08 sd7op31d4t00-480p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240103_232732456.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=854:h=854" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/sd7op31d4t00-1417832919/480p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:40:08 ffmpeg-error: [AVHWDeviceContext @ 0x55b832ff5fc0] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:40:08 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:40:08 ffmpeg-error: [hevc @ 0x55b832ff1bc0] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:40:08 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:40:08 sd7op31d4t00-480p: ffmpeg exited with status: 1
2024/01/07 14:40:08 sd7op31d4t00-720p: stopping stream
2024/01/07 14:40:08 sd7op31d4t00-720p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240103_232732456.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=1280:h=1280" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/sd7op31d4t00-1417832919/720p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:40:08 ffmpeg-error: [AVHWDeviceContext @ 0x55969d13cfc0] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:40:08 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:40:08 ffmpeg-error: [hevc @ 0x55969d138bc0] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:40:08 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:40:08 sd7op31d4t00-720p: ffmpeg exited with status: 1
2024/01/07 14:40:09 sd7op31d4t00-1080p: stopping stream
2024/01/07 14:40:09 sd7op31d4t00-1080p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240103_232732456.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=1920:h=1920" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/sd7op31d4t00-1417832919/1080p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:40:09 ffmpeg-error: [AVHWDeviceContext @ 0x55e0e0401fc0] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:40:09 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:40:09 ffmpeg-error: [hevc @ 0x55e0e03fdbc0] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:40:09 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:40:09 sd7op31d4t00-1080p: ffmpeg exited with status: 1
2024/01/07 14:40:09 sd7op31d4t00-1440p: stopping stream
2024/01/07 14:40:09 sd7op31d4t00-1440p: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240103_232732456.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12:w=2560:h=2560" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/sd7op31d4t00-1417832919/1440p-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:40:09 ffmpeg-error: [AVHWDeviceContext @ 0x55e309d96fc0] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:40:09 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:40:09 ffmpeg-error: [hevc @ 0x55e309d92bc0] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:40:09 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:40:09 sd7op31d4t00-1440p: ffmpeg exited with status: 1
2024/01/07 14:40:10 sd7op31d4t00-max: stopping stream
2024/01/07 14:40:10 sd7op31d4t00-max: /usr/local/bin/ffmpeg -loglevel warning -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /mnt/ncdata/byronfroehlich/files/Photos/2024/01/PXL_20240103_232732456.mp4 -copyts -fflags +genpts -vf "format=nv12|vaapi,hwupload,scale_vaapi=force_original_aspect_ratio=decrease:format=nv12" -map "0:v:0" "-c:v" h264_vaapi -global_quality 24 -map "0:a:0?" "-c:a" aac -ac 1 -start_number 0 -avoid_negative_ts disabled -f hls -hls_flags split_by_time -hls_time 3 -hls_segment_type mpegts -hls_segment_filename /tmp/go-vod/sd7op31d4t00-1417832919/max-%06d.ts -force_key_frames "expr:gte(t,n_forced*3)" -
2024/01/07 14:40:10 ffmpeg-error: [AVHWDeviceContext @ 0x562ea4723540] No VA display found for device /dev/dri/renderD128.
2024/01/07 14:40:10 ffmpeg-error: Device creation failed: -22.
2024/01/07 14:40:10 ffmpeg-error: [hevc @ 0x562ea472fbc0] No device available for decoder: device type vaapi needed for codec hevc.
2024/01/07 14:40:10 ffmpeg-error: Device setup failed for decoder on input stream #0:2 : Invalid argument
2024/01/07 14:40:10 sd7op31d4t00-max: ffmpeg exited with status: 1
2024/01/07 14:40:48 11j08khb7ll0: destroying manager
2024/01/07 14:40:48 11j08khb7ll0-max: stopping stream
2024/01/07 14:40:48 11j08khb7ll0-1440p: stopping stream
2024/01/07 14:40:48 11j08khb7ll0-720p: stopping stream
2024/01/07 14:40:48 11j08khb7ll0-1080p: stopping stream
2024/01/07 14:40:48 11j08khb7ll0-480p: stopping stream
2024/01/07 14:41:07 sd7op31d4t00-480p: stopping stream
2024/01/07 14:41:07 sd7op31d4t00-1440p: stopping stream
2024/01/07 14:41:07 sd7op31d4t00-max: stopping stream
2024/01/07 14:41:17 sd7op31d4t00-720p: stopping stream
2024/01/07 14:41:27 sd7op31d4t00-1080p: stopping stream
2024/01/07 14:42:27 sd7op31d4t00: destroying manager
2024/01/07 14:42:27 sd7op31d4t00-480p: stopping stream
2024/01/07 14:42:27 sd7op31d4t00-1440p: stopping stream
2024/01/07 14:42:27 sd7op31d4t00-max: stopping stream
2024/01/07 14:42:27 sd7op31d4t00-1080p: stopping stream
2024/01/07 14:42:27 sd7op31d4t00-720p: stopping stream

Nextcloud protocols

Transcode failed: Transcoder returned 408

Any ideas what's causing this now? VA-API is enabled in Memories settings.
Screenshot of the Memories settings page showing that VA-API is enabled

@szaimen
Copy link
Contributor

szaimen commented Jan 7, 2024

@br4yd
Copy link
Author

br4yd commented Jan 7, 2024

Did you see https://github.com/nextcloud/all-in-one?tab=readme-ov-file#how-to-enable-hardware-transcoding-for-nextcloud?

Hmm yes. NEXTCLOUD_ENABLE_DRI_DEVICE=true is set for the mastercontainer. /dev/dri is present on host and nextcloud-aio-memories is added as a community container.

Then also the go-vod stuff is active and can be found from the nextcloud-aio-memories container
image
As well as the following settings being turned on:
image

Maybe I'm missing something but at least I don't see why it's still not working and giving me the Transcode failed: Transcoder returned 408 error in the protocols.

@szaimen
Copy link
Contributor

szaimen commented Jan 7, 2024

I guess @pulsejet needs to help debuggin from here...

@br4yd
Copy link
Author

br4yd commented May 27, 2024

Hello, did you have any chance of looking at this issue in the meantime @pulsejet ?

@pulsejet
Copy link
Owner

From the error, this seems like a ffmpeg/driver issue. Likely not related to permissions unless you're running the go-vod container as non-root. Maybe the drivers bundled in the image don't support the hardware you're running? A way to test would be to check if you can manually run ffmpeg inside/outside the container and use HWA transcoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage To be triaged
Projects
None yet
Development

No branches or pull requests

3 participants