Closed dmerrick closed 3 years ago
Hi @dmerrick. From what I can tell from the information you attached, your CGO_LDFLAGS
environment variable is not pointing to the correct directory: -LC:\libvlc-3.0.11\lib
instead of -LC:\libvlc-3.0.8.1
.
You mentioned switching between different versions of libvlc
, 3.0.11
being one of them probably. However, even for that CGO_LDFLAGS
would have to be -LC:\libvlc-3.0.11
(no \lib
).
For 3.0.8.1
set CGO_LDFLAGS=-LC:\libvlc-3.0.8.1
set CGO_CFLAGS=-IC:\libvlc-3.0.8.1\include
go build
For 3.0.11
set CGO_LDFLAGS=-LC:\libvlc-3.0.11
set CGO_CFLAGS=-IC:\libvlc-3.0.11\include
go build
Also, please make sure you are building the executable in a Windows CMD.
Thanks, you're right that I mixed up some of these details. Still having trouble though:
>set CGO_LDFLAGS=-L-LC:\libvlc-3.0.11
>set CGO_CFLAGS=-I-LC:\libvlc-3.0.11\include
> go build vlc-server.go
# github.com/adrg/libvlc-go/v3
..\..\..\..\go\pkg\mod\github.com\adrg\libvlc-go\v3@v3.0.7\av.go:4:11: fatal error: vlc/vlc.h: No such file or directory
4 | // #include <vlc/vlc.h>
| ^~~~~~~~~~~
compilation terminated.
>set CGO_LDFLAGS=-LC:\libvlc-3.0.8.1
>set CGO_CFLAGS=-IC:\libvlc-3.0.8.1\include
> go build vlc-server.go
# build passes, but .exe raises missing libvlc.dll error
Those are with golang v1.13.15 and libvlc-go v3.0.7
With golang v1.15.6, both versions of libvlc will go build
correctly but both give the missing dll error
Sorry, there was a typo in my comment for 3.0.11
:
set CGO_LDFLAGS=-LC:\libvlc-3.0.11
set CGO_CFLAGS=-IC:\libvlc-3.0.11\include
go build
So the build process succeeds for 3.0.8.1
but you still get the DLL message? That seems odd. Does it work if you copy libvlc.dll
in your build directory?
You can also try adding C:\libvlc-3.0.8.1
and/or C:\libvlc-3.0.11
to your Path
environment variable, in the same way you added the MSYS2
paths. Make sure to build the application in a new CMD instance after so that the environment variables are reloaded.
EDIT: you should not need to copy libvlc.dll
in your build directory if you do this.
Amazing! Adding the libvlc dir to my path got it to build!
Now my issue is the playback window isn't showing up. On linux my app opens a window containing a playing video, but none appears on my freshly-compiled Windows binary
Hm, what's the content of the libVLC
package you are using? Is it the one you added in your first post?
> ls C:\libvlc-3.0.8.1
hrtfs include libvlc.dll libvlc.lib libvlccore.dll libvlccore.lib locale lua plugins vlc.lib vlccore.lib
The libVLC NuGet package should contain some other directories as well, like the plugins
directory. The installation directory shoud look something like this:
Also, please make sure you don't specify the --no-video
flag when initializing the libvlc-go
package.
Oh, sorry, I see you already have the plugins
directory. I somehow missed it.
Is there anything the application outputs when you run it? Try adding the -vvv
flag when initializing libvlc-go
. Maybe that will give us a hint regarding the issue.
Sweet, we're getting closer. Here's the -vvv
:
[h264 @ 00000275e8372560] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 00000275e8372560] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 00000275e8372560] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 00000275e8372560] nal_unit_type: 5, nal_ref_idc: 3
[00000275e84639f0] main video output error: video output creation failed
[00000275e83371e0] main decoder error: failed to create video output
[00000275e85ee990] main video output error: video output creation failed
[00000275e83371e0] main decoder error: failed to create video output
[h264 @ 00000275e8372560] Format yuv420p chosen by get_format().
[h264 @ 00000275e8372560] Reinit context to 1920x1088, pix_fmt: yuv420p
[00000275e95a2ab0] main video output error: video output creation failed
[00000275e83371e0] main decoder error: failed to create video output
[h264 @ 00000275e8372560] get_buffer() failed
[h264 @ 00000275e8372560] thread_get_buffer() failed
[h264 @ 00000275e8372560] decode_slice_header error
[h264 @ 00000275e8372560] no frame!
[h264 @ 00000275e83aa860] nal_unit_type: 1, nal_ref_idc: 2
(this repeats over and over)
Nevermind, I got it! I was using --vout x11
, which obviously ain't gonna work on Windows.
Thank you for your quick help, and thanks again for maintaining this!
That's great! I'm glad you got it to work.
Couldn't've done it without you, Adrian!
If you're curious about the project, it's a 24/7 slow-tv Twitch stream with an associated chatbot.
Thank you. I'll definitely check it out! I'm actually thinking of creating a README section with projects using the package at some point. Maybe I can add an entry for your project there if that's ok.
Of course that'd be okay! I can add a link to this project in my README too, if I haven't already :)
I have followed your wiki instructions on a fresh install of Windows.
I have been switching between different versions of
libvlc
,libvlc-go
, andgo
in my various attempts to get this working.Sometimes I see:
When I got past the
go build
step and ran the executable I got a popup that says:When I get this error I see the following in the terminal:
I'm running out of things to try... any suggestions?
Thank you for maintaining this!