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

Cannot enable video support #114

Closed
onlycparra opened this issue Dec 27, 2019 · 14 comments
Closed

Cannot enable video support #114

onlycparra opened this issue Dec 27, 2019 · 14 comments

Comments

@onlycparra
Copy link

Describe the bug
I cannot see or play videos. I open the IP of the server, login, and see the message:

 Server error
Video support error, switching off..
Details: "Error: Error accessing ffmpeg, cant find executable: Error: ffmpeg was killed with signal SIGSEGV" 

I go to the pigallery2 web settings, try to disable/enable the video support, but get the same error.

In the terminal of the server I see:

<timestamp>[WARN] Handled error:
ErrorDTO {
  code: 13,
  message: 'Settings error: Error: Error accessing ffmpeg, cant find executable: Error: ffmpeg was killed with signal SIGSEGV',
  details: Error: Error accessing ffmpeg, cant find executable: Error: ffmpeg was killed with signal SIGSEGV
      at /home/pi/pigallery2/backend/model/diagnostics/ConfigDiagnostics.js:84:43
      at /home/pi/pigallery2/node_modules/fluent-ffmpeg/lib/capabilities.js:360:16
      at handleExit (/home/pi/pigallery2/node_modules/fluent-ffmpeg/lib/processor.js:170:11)
      at Socket.<anonymous> (/home/pi/pigallery2/node_modules/fluent-ffmpeg/lib/processor.js:197:11)
      at Socket.emit (events.js:215:7)
      at Pipe.<anonymous> (net.js:659:12)
}

Extra info
I can execute ffmpeg and ffprobe in the terminal of the server.
During npm install, I noticed the following lines, but I cannot spot an arm variant (maybe it pass too fast):

extract:@ffprobe-installer/win32-x64
extract:@ffprobe-installer/win32-ia32
extract:@ffmpeg-installer/win32-x64
extract:@ffmpeg-installer/win32-ia32

and at the end of npm install I see:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/darwin-x64@4.1.0 (node_modules/@ffmpeg-installer/darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/darwin-x64@4.1.0: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/linux-ia32@4.1.0 (node_modules/@ffmpeg-installer/linux-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/linux-ia32@4.1.0: wanted {"os":"linux","arch":"ia32"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/linux-x64@4.1.0 (node_modules/@ffmpeg-installer/linux-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/linux-x64@4.1.0: wanted {"os":"linux","arch":"x64"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/win32-ia32@4.1.0 (node_modules/@ffmpeg-installer/win32-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/win32-ia32@4.1.0: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffmpeg-installer/win32-x64@4.1.0 (node_modules/@ffmpeg-installer/win32-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffmpeg-installer/win32-x64@4.1.0: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffprobe-installer/darwin-x64@4.1.0 (node_modules/@ffprobe-installer/darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffprobe-installer/darwin-x64@4.1.0: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffprobe-installer/linux-ia32@4.1.0 (node_modules/@ffprobe-installer/linux-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffprobe-installer/linux-ia32@4.1.0: wanted {"os":"linux","arch":"ia32"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffprobe-installer/linux-x64@4.1.0 (node_modules/@ffprobe-installer/linux-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffprobe-installer/linux-x64@4.1.0: wanted {"os":"linux","arch":"x64"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffprobe-installer/win32-ia32@4.1.0 (node_modules/@ffprobe-installer/win32-ia32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffprobe-installer/win32-ia32@4.1.0: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"arm"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @ffprobe-installer/win32-x64@4.1.0 (node_modules/@ffprobe-installer/win32-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @ffprobe-installer/win32-x64@4.1.0: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"arm"})

Environment:

  • HW: Raspberry Pi 3 B+
  • OS: clean installation of "Raspbian Buster with desktop", release 2019-09-26. Updated to the date of the post.
  • Browser: locally with Chromium, and from another PC of the network with Firefox.

Used app version:

  • from release v1.70, following the installation instructions of the repository.

Thanks.

@bpatrik
Copy link
Owner

bpatrik commented Dec 27, 2019

Hi,

On start, pigallery2 checks ffmpeg and ffprobe availability. It can run ffmpeg if it was able to install it with npm install or if it available from terminal.
(On my rpi, I installed it with normal apt-get install ffmpeg as npm install was not able to install it)
Are you sure that the user that runs pigallery can execute ffmepg and ffprobe from the terminal?

If you disable video support from settings, the app wont show videos but this error will go away.

Also lately the recommended usage is through docker. It has preinstalled ffmpeg.
Here is a guide for that: https://github.com/bpatrik/pigallery2/tree/master/docker
It also sets up nginx with https.
There is no release with the new docker support. But I'll focus on bugfixing until v1.8 is out.
I'm also using docker on my RPI.

@onlycparra
Copy link
Author

onlycparra commented Dec 27, 2019 via email

@bpatrik
Copy link
Owner

bpatrik commented Dec 27, 2019

Hi,

I'm not sure what is the issue here then :/

Also the new feature in v1.8 will that it can downscale/transcode videos (using jobs in 'advanced' settings mode). I found that on my rapsberry pi 3 B (no plus) I had issues serving the videos as they had 10+mbps bitrate. Raspberry (and my home internet) was not able to serve that speed so it was struggling a lot. Transcoding the videos to 4mbps at 720p it works now fine.

I started using docker on my rpi a few weeks ago and it seems that it runs relatively fast. (Sure there is some overhead, but not really noticable. Also pigallery is really fast)
And with docker-compose, upgrading to newer version takes only this:

docker-compose down
docker-compose pull
docker compose up -d

Apart from docker (and docker-compose), you don't have to install anything else to your system. no node, no npm, no ffmpeg, etc.

@jabr1884
Copy link

bpatrik, awesome job with pigallery2!

I've been fighting the same video issue for a few days now and it's the last hurdle for me, but I may need to start over using the docker method. I actually have to run pigallery as sudo instead of pi user even though I changed from port 80. Figured I'd post to let onlycparra know he or she isn't alone and to subscribe in case the problem is discovered.

Looking forward to version 1.8!

Jason

@onlycparra
Copy link
Author

onlycparra commented Dec 29, 2019 via email

@bpatrik
Copy link
Owner

bpatrik commented Dec 29, 2019

I'm happy that I could help @onlycparra.

Unfortunately only these formats are supported in browser: mp4, webm, ogv, ogg.
Even if your videos are in these formats, it is recommended to convert them for smooth playback. Even youtube does it with their fancy servers and high upload bandthwith.

@jabr1884
At first start most likely there will be file access issues and port 80 issue.
You can solve the file access issue dirty by chmod -R 777 . (it is not recommended but solves the issue). And run the app even on the first run on different port with this: npm start -- --Server-port=8080
But I'm going to support the docker way as the 'official and recommended' way to run pigallery2.

@jabr1884
Copy link

Hi bpatrik,

Thanks for the tips. I started over with the Docker method, but I had trouble using nginx so I'm using the docker-compose.yml file that skips nginx. I'll tackle that next, but I'm not sure if the following is a bug or if I'm doing something wrong.

I want to use a folder on an external hard drive to hold the images. I was able to do that with the old install by simply changing the images folder path in the gui of pigallery2. When I try to do the same with this docker method the settings save without error but the image folder path in the gui still reads "/app/data/images". If I change the /home/pi/docker-compose.yml file manually the change saves but running docker still fails to point to the mounted drive location (GUI still reads "/app/data/images"). Am I changing the wrong file?

@onlycparra
Copy link
Author

onlycparra commented Dec 31, 2019 via email

@bpatrik
Copy link
Owner

bpatrik commented Dec 31, 2019

@jabr1884

That you see /app/data/images on the ui is normal.
This is what is happening:
docker is like a lightweight virtual machine, it only sees what is inside.
Inside is the /app/data/images/, thats why this is on the UI.
Customizing the volumes (read more here) in the docker-comose.yml binds that /app/data/images/ to your host (real) machine.
Here is how important part of my docker-compose.yml looks like:

...
    volumes:
      - "./pigallery2/config:/app/data/config" 
      - "db-data:/app/data/db" 
      - "/mnt/hdd/images:/app/data/images" 
      - "/mnt/hdd/tmp:/app/data/tmp"
..

This is where the 'bindings' happen.
I'm mounting an external hard drive to /mnt/hdd

@jabr1884
Copy link

Hi bpatrik,

Thanks, I was changing the wrong path... Now I feel silly.

A donation is on the way. Thanks again for your awesome work and responsiveness!

Jason

@bpatrik
Copy link
Owner

bpatrik commented Jan 1, 2020

I'm happy that it works.

p.s.: there is no donation available for this project. I'm just doing it for fun :)

@jabr1884
Copy link

jabr1884 commented Jan 1, 2020

I'm happy to report that I'm fully operational with the Docker setup using nginx and https, and that video is working. Thanks again for your help!

The issue I had with nginx initially is that it would start on boot and then again with docker-compose. I had to use the following to prevent nginx from starting on boot: sudo update-rc.d -f nginx disable

@bpatrik
Copy link
Owner

bpatrik commented Jan 1, 2020

I'm happy to hear.

You can also use nginx 'natively' (might be even better as there is no docker overhead on it).
You can also you the nginx config file that I provided for start, you might need to rewrite the http//pigallery2:80 part in it.

I'm experimenting with the docker-compose/default setup for a few weeks by now on a rpi3 and currently seems to work properly and fast enough. So dockerised nginx seems to be good enough.

@bpatrik
Copy link
Owner

bpatrik commented Sep 13, 2020

closing due to inactivity

@bpatrik bpatrik closed this as completed Sep 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants