horgh / videostreamer

Stream video (e.g. RTSP) to an HTML5 video element (MP4)
GNU General Public License v3.0
267 stars 60 forks source link

Can't Build on Windows, relative to acces ffmpeg library #20

Open Mirabeau2Code opened 4 years ago

Mirabeau2Code commented 4 years ago

Hello,

First, sorry for my bad english write..

I followed the install description on Linux without problems, however I have problems on Windows (10), and it is impossible for me to build the program on Win10. The main problem, seem the only problem, is related to access to the FFmpeg library.

-> i use MinGW 730_x64 (which I use without worries for other constructions with "Go", like for OpenCV) -> The "ffmpeg" library come from the "pack" developer of the official website, and its installed in a "libs" folder (!) _there is no ".pc" file in this pack, useful for "pkgconfig" So... I added the program "pkg_config" (and its dependencies) in my MinGW folder, it is taken into account during the construction. I get ".pc" files from my linux (same library version) and "modified", by hand, the paths to correspond to the "libs" folder of my windows I indicated in the variable "PKG_CONFIG_PATH" the folder of the files " .pc" (and check that they are taken into account) Without success, during the build, I always have an error to find the ffmpeg library.

So I tried to indicate the path of the libraries via the set variable CGO_CPPFLAGS ("-I") and CGO_LDFLAGS ("-L"), again without success.

I "resolve" somme error from "*.h" acces file (ffmpeg library), it's very bad method, i know ;), but at the end it was now some "linked" error i get...(sic)

My lack of knowledge "Go" and build options, prevents me from going further, however I remain convinced that I do not miss much :)

Thank you very much in advance for all "tracks" to succeed, finally, in compiling the "Go" program

horgh commented 4 years ago

Hi!

I'm not familiar with building things on Windows unfortunately, so I am not sure I can help much.

Regarding not using pkg-config: I think that should be possible. You could delete the pkg-config line from videostreamer.go and rely entirely on changing the #cgo LDFLAGS and CFLAGS lines to tell Go how to build the C parts. It sounds like that is what you tried and had some success with. You would need to specify -L and -I flags correctly to where to find the libraries and headers for ffmpeg I believe. I don't know how to determine what you would enter unfortunately!

Sorry I'm not much help. This project is pretty rough around the edges though, so it may not suit your use case anyway!