iEvgeny / cctv-viewer

CCTV Viewer - viewer and mounter video streams.
GNU General Public License v3.0
135 stars 19 forks source link

How To Install Without Snaps? #93

Closed Majoraslayer closed 4 months ago

Majoraslayer commented 4 months ago

How do I install this on Fedora without resorting to the Snap store?

iEvgeny commented 4 months ago

For RPM based, only build from source.

Majoraslayer commented 4 months ago

I'm not really sure how to do that to be honest. I'm not really a software dev, but I did discover Cmake just spits out a bunch of errors when trying to run it on the downloaded and extracted source under Fedora. I take it the short answer is "learn to be a software developer, or just run the Snap package" lol. The application does work well once it's running, so thanks for your work on it!

iEvgeny commented 4 months ago

To build from source, you need to install dependencies. I can't provide a list of dependencies for Fedora, but you can find analogs based on dependencies for Ubuntu. See https://github.com/iEvgeny/cctv-viewer/blob/master/debian/control

P.S. I don't have the ability to support multiple package systems right now, so yes, if you want to use something other than Snap and PPA, you'll have to do it yourself.

Majoraslayer commented 4 months ago

After poking around for a few days trying to install all the dependencies for Cmake, I'm stuck at this error when trying to run make:

libavutil/cpu.h: No such file or directory

I'm stumped, any chance you have suggestions? I have ffmpeg installed, and that's what Google seems to indicate it's related to. I can't figure out why this error is keeping me from compiling cctv-viewer though.

iEvgeny commented 4 months ago

It looks like you still do not have some of the devel packages installed. Try installing libavutil-free-devel

Majoraslayer commented 4 months ago

I ended up building using the Docker method documented here: https://gist.github.com/ItsNotGoodName/5181f8b25b63f0715b3d4117623090f3

As best I can tell, it's just completely incompatible with Fedora outside of a Snap package, I believe due to the way ffmpeg is handled natively by Fedora itself. By default, Fedora uses ffmpeg-free because proprietary codecs=killing puppies. Installing regular ffmpeg is possible with rpmfusion, but doesn't seem to install it in a way that CCTV-Viewer is able to find the libraries it needs. Trying to execute it results in:

./cctv-viewer: error while loading shared libraries: libavformat.so.59: cannot open shared object file: No such file or directory

which seems to be related to a codec included with ffmpeg. A Google search shows that some other apps have issues with this because libavformat may be installed in different places. I can't seem to find any references mentioning where it's kept on Fedora, and I'm not sure if the instructions I've found to specify the path would even work under Fedora.

Thanks for taking the time trying to help me fumble through this though!

iEvgeny commented 4 months ago

Docker is conceptually different from Snap only in that the former is not designed to run GUI applications ;)

Majoraslayer commented 4 months ago

Docker is conceptually different from Snap only in that the former is not designed to run GUI applications ;)

True, but I wasn't trying to run the application in Docker. The linked instructions seem to work for compiling it, which seemed to solve my problem of tracking down the missing dependencies for make and cmake to do it natively.

iEvgeny commented 4 months ago

It seems that Fedora uses other include paths for ffmpeg headers. Now I'll try to fix the build scripts.

iEvgeny commented 4 months ago

I have made the necessary changes to the project code, please follow these steps:

Build tools

sudo dnf groupinstall "Development Tools" "Development Libraries"

Build dependencies

sudo dnf install git cmake libva-devel libavcodec-free-devel libavdevice-free-devel libavformat-free-devel libavutil-free-devel libswresample-free-devel libswscale-free-devel qt5-qtbase-devel qt5-qtdeclarative-devel qt5-qtmultimedia-devel qt5-linguist gtest-devel pkg-config

Runtime

sudo dnf install qt5-qtquickcontrols qt5-qtquickcontrols2

Build

git clone --recurse-submodules https://github.com/iEvgeny/cctv-viewer.git

cd cctv-viewer

cmake .

make -j$(nproc)

Run

./cctv-viewer

Majoraslayer commented 4 months ago

This worked great, thanks a TON for taking the time to address my problem and putting together instructions to build it!