pixop / video-compare

Split screen video comparison tool using FFmpeg and SDL2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to compile on OpenSUSE Tumbleweed

singularity098 opened this issue · comments

commented

I am unable to compile this program on OpenSUSE Tumbleweed... no matter what I do to try and satisfy dependencies I am getting errors:

In file included from format_converter.cpp:1:
format_converter.h:3:10: fatal error: libavformat/avformat.h: No such file or directory
    3 | #include "libavformat/avformat.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from video_compare.h:9,
                 from main.cpp:9:
format_converter.h:4:10: fatal error: libswscale/swscale.h: No such file or directory
    4 | #include "libswscale/swscale.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from video_compare.h:9,
                 from video_compare.cpp:1:
format_converter.h:4:10: fatal error: libswscale/swscale.h: No such file or directory
    4 | #include "libswscale/swscale.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
g++ -g3 -Ofast -std=c++14 -D__STDC_CONSTANT_MACROS -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations -Wdisabled-optimization -Wctor-dtor-privacy -Woverloaded-virtual -Wno-unused -Wno-missing-field-initializers -I/usr/local/include/   -c -o demuxer.o demuxer.cpp
In file included from demuxer.cpp:1:
demuxer.h:4:10: fatal error: libavformat/avformat.h: No such file or directory
    4 | #include <libavformat/avformat.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: demuxer.o] Error 1

It also does not launch in Wine if I try the Windows version.

Any chance that the releases could be generated in either AppImage or Flatpak format? That would be amazing and I really love the idea of this program. I wish that I could use it!

Hey @singularity098,

Did you install the required FFmpeg development libraries before running make?

commented

Thanks for responding. I think that I installed everything that I could.... but I am a little unclear on the libsdl2-dev libsdl2-ttf-dev packages and it seems we maybe don't have those in OpenSUSE.

$ sudo zypper search *libavformat*dev*  *libavcodec*dev*  *libavfilter*dev*  *libavutil*dev*  *libswscale*dev* *libsdl2*dev* *libsdl2-ttf*dev*
Loading repository data...
Reading installed packages...

S  | Name                       | Summary                                                             | Type
---+----------------------------+---------------------------------------------------------------------+--------
   | ffmpeg-2-libavcodec-devel  | Development files for FFmpeg's codec library                        | package
   | ffmpeg-2-libavfilter-devel | Development files for FFmpeg's audio/video filter library           | package
   | ffmpeg-2-libavformat-devel | Development files for FFmpeg's stream format library                | package
   | ffmpeg-2-libavutil-devel   | Development files for FFmpeg's utility library                      | package
   | ffmpeg-2-libswscale-devel  | Development files for FFmpeg's image scaling and colorspace library | package
   | ffmpeg-3-libavcodec-devel  | Development files for FFmpeg's codec library                        | package
   | ffmpeg-3-libavfilter-devel | Development files for FFmpeg's audio/video filter library           | package
   | ffmpeg-3-libavformat-devel | Development files for FFmpeg's stream format library                | package
   | ffmpeg-3-libavutil-devel   | Development files for FFmpeg's utility library                      | package
   | ffmpeg-3-libswscale-devel  | Development files for FFmpeg's image scaling and colorspace library | package
   | ffmpeg-4-libavcodec-devel  | Development files for FFmpeg's codec library                        | package
   | ffmpeg-4-libavfilter-devel | Development files for FFmpeg's audio/video filter library           | package
   | ffmpeg-4-libavformat-devel | Development files for FFmpeg's stream format library                | package
   | ffmpeg-4-libavutil-devel   | Development files for FFmpeg's utility library                      | package
   | ffmpeg-4-libswscale-devel  | Development files for FFmpeg's image scaling and colorspace library | package
   | ffmpeg-5-libavcodec-devel  | Development files for FFmpeg's codec library                        | package
   | ffmpeg-5-libavfilter-devel | Development files for FFmpeg's audio/video filter library           | package
   | ffmpeg-5-libavformat-devel | Development files for FFmpeg's stream format library                | package
   | ffmpeg-5-libavutil-devel   | Development files for FFmpeg's utility library                      | package
   | ffmpeg-5-libswscale-devel  | Development files for FFmpeg's image scaling and colorspace library | package
i  | ffmpeg-6-libavcodec-devel  | Development files for FFmpeg's codec library                        | package
i+ | ffmpeg-6-libavfilter-devel | Development files for FFmpeg's audio/video filter library           | package
i+ | ffmpeg-6-libavformat-devel | Development files for FFmpeg's stream format library                | package
i  | ffmpeg-6-libavutil-devel   | Development files for FFmpeg's utility library                      | package
i  | ffmpeg-6-libswscale-devel  | Development files for FFmpeg's image scaling and colorspace library | package

$ sudo zypper search *sdl2*
Loading repository data...
Reading installed packages...

S | Name                  | Summary                                            | Type
--+-----------------------+----------------------------------------------------+--------
  | audaspace-plugin-sdl2 | SDL2 plugin for audaspace                          | package
  | mlterm-sdl2           | Multilingual Terminal Emulator using SDL rendering | package

Thanks!

OK, I did some digging. According to https://opensuse.pkgs.org/15.5/packman-x86_64/ffmpeg-6-libavformat-devel-6.1.1-150500.5.pm.1.x86_64.rpm.html, FFmpeg header files are installed with a ffmpeg/ prefix on your system which explains why compilation fails.

Try adding -I/usr/include/ffmpeg to the CXXFLAGS declaration at the top of makefile, like this:

CXXFLAGS = -I/usr/include/ffmpeg -g3 -Ofast -std=c++14 -D__STDC_CONSTANT_MACROS \
		   -Wall -Wextra -Wno-deprecated -Wno-deprecated-declarations \
		   -Wdisabled-optimization -Wctor-dtor-privacy \
		   -Woverloaded-virtual -Wno-unused -Wno-missing-field-initializers

With regards to SDL2: You might need to install libSDL2-2_0-0, libSDL2-devel and libSDL2_ttf-devel.

Then run make again.

commented

I am away from my computer for the weekend but I'll try it out as soon as a can and report back. Thanks for looking into it!

commented

It works! This is brilliant, thank you!