ncdownloader icon indicating copy to clipboard operation
ncdownloader copied to clipboard

ffmpeg not installed on nextcloud snap

Open ManuXD32 opened this issue 2 years ago • 11 comments

Describe the bug when opening the ncdownloader a message appears telling that ffmpeg is not installed, but it is installed.

ManuXD32 avatar Jul 26 '22 23:07 ManuXD32

Hi, could you please post your administrative logs? Log into your NextCloud as the administrator, navigate to Settings and then Logging.

Could you please tell us what operating system and version you are running NextCloud on? You can find this information by running the following command at the command line:

lsb_release -a

Next, could you please tell us what version of NextCloud, NCDownloader, and ffmpeg you are using?

  • You can find NextCloud version from the Administration Overview page under your administrator's account settings.
  • You can find the NCDownloader version by going to the Apps page under your administrator account and selecting NCDownloader.
  • You can determine your version of ffmpeg by typing:

ffmpeg -version

at the command line.

Lastly, please paste the output of the following command:

whereis ffmpeg

Once we have this information we can determine what is going on. I suspect that we will need to change the path of ffmpeg in the settings of NCDownloader.

OSINT-Musings avatar Nov 06 '22 21:11 OSINT-Musings

I have the same problem.

Logging doesn't log an error or a warning for ncdownloader. Running NC 24.0.7 and ncDownloader 1.0.2

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.5 LTS
Release:        20.04
Codename:       focal
ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
ffmpeg: /usr/bin/ffmpeg /usr/local/bin/ffmpeg /usr/share/ffmpeg /usr/share/man/man1/ffmpeg.1.gz

traeblain avatar Nov 29 '22 03:11 traeblain

Same problem here

idoodler avatar Jan 21 '23 19:01 idoodler

Found out it's because containerization of the snap. So it's not a NCDownloader problem, necessarily. I got it working by downloading the ffmpeg binary and placing it in:

/var/snap/nextcloud/common/nextcloud/data/bin

Need to do it as root: sudo su

That way it should not get overwritten when the snap is updated. That location is in the path of the snap container so should be seen then. If not, then update the settings for bin/ffmpeg.

I did this a while ago and should have updated this then when it was on my mind, I think that's all I did. For @shiningw we could keep this open, as I think this is being addressed in the latest nextcloud snap n26 as this issue affects a whole host of tools (video thumbnails, etc.). But when they do, it may be worth seeing if NCDownloader needs to add an option to locate ffmpeg when it's addressed.

traeblain avatar Jan 21 '23 20:01 traeblain

@traeblain I copied it into the directory (tho the bin directory didn't exist). I still get the same error message about ffmpeg missing.

idoodler avatar Jan 21 '23 21:01 idoodler

Make sure you got it in the right spot and that it's executable. chmod a+x ffmpeg

This is where NCDownloader looks for binaries:

https://github.com/shiningw/ncdownloader/blob/c28cbd4cac8e35abec5d0eb7a020184ecce5fa2c/lib/Tools/Helper.php#L225

Notice the last item in that list: $dataPath . "/bin" So if you have it in the right spot and it can be executed, NCDownloader should be able to see it.

traeblain avatar Jan 22 '23 05:01 traeblain

@traeblain I did exactly that.

  • changed to su with sudo su
  • cp /usr/bin/ffmpeg /var/snap/nextcloud/common/nextcloud/data/bin/ffmpeg
  • chmod a+x /usr/bin/ffmpeg /var/snap/nextcloud/common/nextcloud/data/bin/ffmpeg
  • validated that it is executable /var/snap/nextcloud/common/nextcloud/data/bin/ffmpeg -h
  • restarted nextcloud snap restart nextcloud

This results in the same error

idoodler avatar Jan 22 '23 15:01 idoodler

Ok that’s not NCDownloder not finding ffmpeg, that is yr-dlp. In the setting try this line.

‘ bin/yt-dlp --ffmpeg-location bin/ffmpeg ‘

Or where your yt-dlp is located.

On Jan 25, 2023 at 4:32 AM, <Ralph Zhou @.***)> wrote:

Same problem, even if I put ffmpeg's link under /var/snap/nextcloud/common/nextcloud/data/bin/ffmpeg, it still can't find ffmpeg. Here is log. {"reqId":"U5ANfbWJvZTpN3jgzR1I","level":3,"time":"2023-01-25T09:17:04+00:00","remoteAddr":"240e:390:492:4d97:546a:d62a:30d0:520b","user":"ralph","app":"ncdownloader","method":"POST","url":"/index.php/apps/ncdownloader/ytdl/new","message":"WARNING: You have requested merging of multiple formats but ffmpeg is not installed. The formats won't be merged\n","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","version":"25.0.2.3","data":{"app":"ncdownloader"},"id":"63d104d8cf1eb"}

— Reply to this email directly, view it on GitHub (https://github.com/shiningw/ncdownloader/issues/75#issuecomment-1403400507), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAG63VFRBYN2LZGRJDT6JX3WUD6LTANCNFSM54XUFGFQ). You are receiving this because you were mentioned.Message ID: @.***>

traeblain avatar Jan 26 '23 22:01 traeblain

@traeblain I am redoing my home server now. So I switched to docker contaienr. Of course I have the same issue now 🫣.

I tried to create a mount for ffmpeg in usr/bin. This worked (a bit), but when the download finished I get an esception that a lib can‘t be found. I guess its the lib used to concat the .mp4 with the .m4a. I am quite new to docker, so I have to learn a bit more. Just want to inform you guys not that you think I ghosted you 😅

idoodler avatar Jan 29 '23 12:01 idoodler

The same issue happened on the snap installation

Nextcloud 25.0.4 NCDownloader 1.0.2 ffmpeg version n5.1.2 Operating System: Linux 5.15.92-1-MANJARO-ARM-RPI aarch64

slavikator avatar Mar 14 '23 15:03 slavikator

do it as root

copy ffmpeg to folder /var/snap/nextcloud/current/nextcloud/extra-apps/ncdownloader/bin edit /var/snap/nextcloud/current/nextcloud/extra-apps/ncdownloader/lib/Tools/Helper.php add following in the function findBinaryPath()

$paths = ['/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/opt/bin', $dataPath . "/bin", __DIR__ . "/../../bin"];

It should works immediately. Hope it helps :)

pekkle-hksar avatar Dec 16 '23 11:12 pekkle-hksar