Need help for compiling libvlc for the vlc-winrt project

​VLC for Windows Store​ specific questions

This includes WinRT, Windows RT, Windows Phone, Windows Mobile and Xbox 1
zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 05 Sep 2017 19:18

Hi,
I tried to recompile libvlc for the vlc-winrt project. I know there're some prebuilt ones, and I've been using them. But I need some deeper understand about the libvlc (something about buffering, it seems that the vlc for uwp suffers from delay accumulation.), so I need to recompile it from source. I can successfully compiles the 2.2.X source with the instruction from https://wiki.videolan.org/Win32Compile/, but when I try to use the newly compiled libs and plugins in the vlc-winrt project, there're lots of error about missing types (like stream_t).


I tried to compile the vlc 3.0.0, but I got link error:
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_Z35_txnal_cow_string_C1_for_exceptionsPvPKcS_+0x2c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_RU1'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_Z35_txnal_cow_string_C1_for_exceptionsPvPKcS_+0x39): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `transaction clone for operator new[](unsigned long long)'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_Z35_txnal_cow_string_C1_for_exceptionsPvPKcS_+0x5d): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_memcpyRtWn'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_Z23_txnal_cow_string_c_strPKv+0x1): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_RU8'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_Z23_txnal_sso_string_c_strPKv+0x1): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_RU8'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_Z20_txnal_cow_string_D1Pv+0x5): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_RU8'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_Z20_txnal_cow_string_D1Pv+0x1e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_addUserCommitAction'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_ZGTtNSt11logic_errorC1EPKc+0x2e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_memcpyRnWt'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_ZGTtNSt11logic_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x2e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_memcpyRnWt'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_ZGTtNSt11logic_errorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x36): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `_ITM_RU8'
/usr/lib/gcc/x86_64-w64-mingw32/6.2-win32/libstdc++.a(cow-stdexcept.o):(.text$_ZGTtNSt11logic_errorD0Ev+0x1a): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Makefile:13120: recipe for target 'libdshow_plugin.la' failed
Makefile:25274: recipe for target 'all-recursive' failed
Makefile:10533: recipe for target 'all' failed
Makefile:1520: recipe for target 'all-recursive' failed
Makefile:1405: recipe for target 'all' failed
make: *** [all] Error 2

Any idea about how I should compile libvlc for vlc-winrt use?

mfkl
Developer
Developer
Posts: 751
Joined: 13 Jun 2017 10:41

Re: Need help for compiling libvlc for the vlc-winrt project

Postby mfkl » 06 Sep 2017 03:25

Hi zkuang,

This is what I do:

git clone https://code.videolan.org/videolan/vlc-winrt branch master
git clone https://github.com/robUx4/vlc-msvc.git branch vs15_only
git clone https://code.videolan.org/robUx4/vlc.git branch latest wp/* branch (wp/20170829-1 currently)

put vlc directory in the vlc-msvc directory
put vlc-msvc directory in the vlc-winrt directory

install msys2 and call

Code: Select all

./build.sh Universal64 Debug
from vlc-msvc directory
update with pacman any mingw plugin needed (like bison or git)

Code: Select all

pacman -S git subversion automake autoconf libtool m4 make gettext pkg-config findutils yasm patch
this could be useful as well https://github.com/Alexpux/mingW-packages
You might need to try compiling several times if you have multi process errors (ex: "multiple CL.EXE write to the same .PDB file")

once compilation is finished (will take a while), dlls should be at ../libvlc/Universal/vlc-amd64/Debug
start VS and try building the solution.
If some plugins dlls are not found, comment out references after making sure they are not absolutely needed for VLC to function properly.

Let me know if that works for you.
https://mfkl.github.io

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 06 Sep 2017 04:00

Hi mfkl,
Thanks for the reply, I'll give it try.
You mentioned msys2, so all these are done on windows?

mfkl
Developer
Developer
Posts: 751
Joined: 13 Jun 2017 10:41

Re: Need help for compiling libvlc for the vlc-winrt project

Postby mfkl » 06 Sep 2017 04:07

Yes.
https://mfkl.github.io

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 06 Sep 2017 04:45

Tried that, but I got the following error when ./build.sh Universal64 Debug
(cd cmake; ./configure --prefix=/home/zkuang/vlc-winrt/vlc-msvc/vlc/extras/tools/build --no-qt-gui --parallel=1 && make && make install)
---------------------------------------------
CMake 3.4.3, Copyright 2000-2015 Kitware, Inc.
---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C compiler on this system.
Please specify one using environment variable CC.
See cmake_bootstrap.log for compilers attempted.

---------------------------------------------
Log of errors: /home/zkuang/vlc-winrt/vlc-msvc/vlc/extras/tools/cmake/Bootstrap.cmk/cmake_bootstrap.log

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 06 Sep 2017 04:54

I think I need to install the mingw compilers, but which ones? I got some from pacman, and also some from your link https://github.com/Alexpux/mingW-packages, seems there're so much choice.

mfkl
Developer
Developer
Posts: 751
Joined: 13 Jun 2017 10:41

Re: Need help for compiling libvlc for the vlc-winrt project

Postby mfkl » 06 Sep 2017 05:03

Right, we'll need to fix this.
In the meantime use branch wp/20170724-1 for this repo https://code.videolan.org/robUx4/vlc.git
https://mfkl.github.io

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 06 Sep 2017 05:44

I saw something like:
protoc too old
Error: JAVA_HOME is not defined correctly.
We cannot execute java
ant not found
widl not found
To-be-built packages: protoc ant widl

Do we need to use java?

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 06 Sep 2017 08:08

I got these errors:

C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c: warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(72): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(73): error C2059: syntax error: '{'
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(73): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(74): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(75): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(76): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(77): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(78): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(79): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(80): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(81): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(82): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(83): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(84): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(85): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(86): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(87): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(88): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(89): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(90): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(91): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(92): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(93): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(94): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(95): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(96): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(97): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(98): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(99): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(100): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(101): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(102): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(103): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(104): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(105): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(106): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(107): error C2059: syntax error: ','
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(108): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(116): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(124): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(129): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(137): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(138): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(139): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(142): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(146): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(159): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(164): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(166): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(167): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(168): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(179): error C2001: newline in constant
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\text\strings.c(918): fatal error C1004: unexpected end-of-file found
objects.c
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\misc\objects.c(63): warning C4477: 'printf' : format string '%u' requires an argument of type 'unsigned int', but variadic argument 4 has type 'LONG64'
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\misc\objects.c(63): note: consider using '%llu' in the format string
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\misc\objects.c(63): note: consider using '%Iu' in the format string
C:\msys64\home\zkuang\vlc-winrt\vlc-msvc\vlc\src\misc\objects.c(63): note: consider using '%I64u' in the format string
make[3]: *** [Makefile:2567:text/strings.lo] error 1


looks like some unicode issue, how can I solve this?

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 06 Sep 2017 09:15

I save the file in unicode code page 1200, then this passed, though with a lot of warnings.

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 06 Sep 2017 09:50

The build process has passed, but some plugins used by the vlc-winrt project are missing.
libi420_rgb_sse2_plugin.dll
libi420_yuy2_sse2_plugin.dll
libzvbi_plugin.dll
libpostproc_plugin.dll
libi420_yuy2_mmx_plugin.dll
libmad_plugin.dll
libi420_rgb_mmx_plugin.dll

So what am i missing?

mfkl
Developer
Developer
Posts: 751
Joined: 13 Jun 2017 10:41

Re: Need help for compiling libvlc for the vlc-winrt project

Postby mfkl » 06 Sep 2017 10:07

The build process has passed
Congrats
If some plugins dlls are not found, comment out references after making sure they are not absolutely needed for VLC to function properly.
You may comment those references.
https://mfkl.github.io

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 06 Sep 2017 10:31

But how do I do that? where're those references?

mfkl
Developer
Developer
Posts: 751
Joined: 13 Jun 2017 10:41

Re: Need help for compiling libvlc for the vlc-winrt project

Postby mfkl » 06 Sep 2017 10:47

VLC.Universal.csproj file.
https://mfkl.github.io

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 06 Sep 2017 11:10

thanks mfkl, realy nice of you

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 13 Sep 2017 08:48

I can get it working for amd64 system. but the build process failed for x86 system.
saying that different definition of GetFileAttributesW from winstorecompat.h and fileapi.h from sdk.

Which one should I use? And why don't I get this error on Universal64 but in Universal86?

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 13 Sep 2017 15:39

I check the build system a little bit. Looks like the -D_WIN32_WINNT=0xA00 doesn't work on x86 system....Strange

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 14 Sep 2017 01:29

It's a configure error while compiling conftest.c, the error says C compiler cannot create executables..

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 16 Sep 2017 03:27

looks like I can fix this by adding a WINAPI modifier to declaration GetFileAttributesW in winstorecompat.h

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 19 Sep 2017 04:23

The libarchive_plugin.dll fails to generate because of unresolved symbol _BcryptDeriveKeyPBKDF2. I dupmbin the bcrypt.lib, and I see the symbol is actually there. And if I move away the bcrypt.lib, it says can not open file bcrypt.lib, so the library is actually linked during build, but I'm not sure why the symbol is missing.

And if I skip compiling the libarchive_plugin, the compilation passed and the app can be built. But opening a network stream get the app crashed....

I've tried lots of modification, I still can't get it work on hololens, anyone can help?

robUx4
Developer
Developer
Posts: 255
Joined: 31 Jan 2005 13:50
VLC version: master
Operating System: Windows
Contact:

Re: Need help for compiling libvlc for the vlc-winrt project

Postby robUx4 » 19 Sep 2017 10:44

IMO you should concentrate on the 64 bits build. I rarely use the 32 bits one. And for releases we use the buildbot ones that are compiled using mingw, not MSVC.

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 19 Sep 2017 11:33

hi robUX4,

Do you have some references about how to compile libvlc with mingw for uwp use?

robUx4
Developer
Developer
Posts: 255
Joined: 31 Jan 2005 13:50
VLC version: master
Operating System: Windows
Contact:

Re: Need help for compiling libvlc for the vlc-winrt project

Postby robUx4 » 19 Sep 2017 11:59

Not really but looking at the buildbot might help:
https://jenkins.videolan.org/job/vlc-wi ... -i686/617/

BTW if you have some issues with the prebuilt binaries it may be a bug in VLC. So you should have the same issue on the desktop that we can look at. It's very unlikely that the winrt version has timing bugs specific to that platform.

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 19 Sep 2017 12:09

I checked the code, looks like we have a long buffer upper limit (INPUT_PTS_DELAY_MAX), every time something make the package delayed, the old ones are not dropped, so the video delay accumulates.

zkuang
Blank Cone
Blank Cone
Posts: 27
Joined: 05 Sep 2017 19:06

Re: Need help for compiling libvlc for the vlc-winrt project

Postby zkuang » 19 Sep 2017 12:13

Looks like it's built in docker container, do you have some info about the docker image and the container setups?


Return to “​VLC for Windows Store​”

Who is online

Users browsing this forum: No registered users and 3 guests