diff --git a/contrib/build_all_uwp.bat b/contrib/build_all_uwp.bat
index 5fd9bfe630be14205bae5b458b192239410288d3..5716cf6390bb25de798d0494f189456ce834af2c 100644
--- a/contrib/build_all_uwp.bat
+++ b/contrib/build_all_uwp.bat
@@ -55,6 +55,8 @@ build\portaudio\MSVC\portaudio-UWP\portaudio-UWP.vcxproj, ^
 build\yaml-cpp\MSVC\yaml-cpp.vcxproj, ^
 )
 
+rem * build libx264 *
+call :build build\x264\SMP\libx264.vcxproj
 rem * build ffmpeg *
 cd build\FFmpegInterop
 SET LIB="%VSINSTALLDIR%VC\lib\store\amd64;%VSINSTALLDIR%VC\atlmfc\lib\amd64;%UniversalCRTSdkDir%lib\%UCRTVersion%\ucrt\x64;;%UniversalCRTSdkDir%lib\%UCRTVersion%\um\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\lib\um\x64;;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Lib\um\x64"
@@ -64,7 +66,7 @@ set MSYS2_BIN="C:\msys64\usr\bin\bash.exe"
 call BuildFFmpeg.bat win10 x64
 cd ..\..
 
-rem * build openssl UWP*
+rem * build openssl UWP *
 cd build\restbed\dependency\openssl
 call perl Configure no-asm no-hw no-dso VC-WINUNIVERSAL
 call ms\do_winuniversal
diff --git a/contrib/src/fetch_all_uwp.bat b/contrib/src/fetch_all_uwp.bat
index 5d76ffe07e23437666a76822e16ec09994c94006..8d8b44a210e27f3a3e0b0e39faa171e69d7961b0 100644
--- a/contrib/src/fetch_all_uwp.bat
+++ b/contrib/src/fetch_all_uwp.bat
@@ -21,6 +21,7 @@ pthreads, ^
 restbed, ^
 samplerate, ^
 upnp, ^
+x264, ^
 yaml-cpp, ^
 zlib ^
 )
diff --git a/contrib/src/ffmpeg/ffmpeg-uwp.patch b/contrib/src/ffmpeg/ffmpeg-uwp.patch
index f68b57ed8ff6173e0d5324526fcf9c223e7fdc34..8f668616ee4a1d472dce4858c6aaa89f6f0b94a4 100644
--- a/contrib/src/ffmpeg/ffmpeg-uwp.patch
+++ b/contrib/src/ffmpeg/ffmpeg-uwp.patch
@@ -84,5 +84,30 @@
              if (st->first_dts == AV_NOPTS_VALUE &&
                  !(ic->iformat->flags & AVFMT_NOTIMESTAMPS) &&
 -- 
+--- a/FFmpegConfig.sh
++++ b/FFmpegConfig.sh
+@@ -33,6 +33,7 @@ if [ "$1" == "Win10" ]; then
+         cd Output/Windows10/x64
+         ../../../configure \
+         --toolchain=msvc \
++        --enable-gpl \
+         --disable-programs \
+         --disable-d3d11va \
+         --disable-dxva2 \
+@@ -40,8 +41,12 @@ if [ "$1" == "Win10" ]; then
+         --enable-shared \
+         --enable-cross-compile \
+         --target-os=win32 \
+-        --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" \
+-        --extra-ldflags="-APPCONTAINER WindowsApp.lib" \
++        --enable-encoder=libx264 \
++        --enable-decoder=h264 \
++        --enable-parser=h264 \
++        --enable-libx264 \
++        --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -I../../../../../x264/SMP/output/Release/include" \
++        --extra-ldflags="-APPCONTAINER WindowsApp.lib -LIBPATH:../../../../../x264/SMP/output/Release/lib/x64" \
+         --prefix=../../../Build/Windows10/x64
+         make -j install
+         popd
 2.8.1.windows.1
 
diff --git a/contrib/src/x264/fetch_and_patch.bat b/contrib/src/x264/fetch_and_patch.bat
new file mode 100644
index 0000000000000000000000000000000000000000..2d2d5142e5aa57421e8bd433e03acfe507044f18
--- /dev/null
+++ b/contrib/src/x264/fetch_and_patch.bat
@@ -0,0 +1,22 @@
+set BUILD=%SRC%..\build
+
+set X264_VERSION=78c7e3dbb6f832f8775d81acedb3793e414b4dd3
+set X264_URL=https://github.com/ShiftMediaProject/x264/archive/%X264_VERSION%.tar.gz
+
+mkdir %BUILD%
+
+if %USE_CACHE%==1 (
+    copy %CACHE_DIR%\%X264_VERSION%.tar.gz %cd%
+) else (
+    wget %X264_URL%
+)
+
+7z -y x %X264_VERSION%.tar.gz && 7z -y x %X264_VERSION%.tar -o%BUILD%
+del %X264_VERSION%.tar && del %X264_VERSION%.tar.gz && del %BUILD%\pax_global_header
+rename %BUILD%\x264-%X264_VERSION% x264
+
+cd %BUILD%\x264
+
+git apply --reject --whitespace=fix %SRC%\x264\x264-uwp.patch
+
+cd %SRC%
\ No newline at end of file
diff --git a/contrib/src/x264/x264-uwp.patch b/contrib/src/x264/x264-uwp.patch
new file mode 100644
index 0000000000000000000000000000000000000000..5d41f81e7a2dc5925ff5fb81dd86bb50a00af288
--- /dev/null
+++ b/contrib/src/x264/x264-uwp.patch
@@ -0,0 +1,52 @@
+--- a/SMP/config.h
++++ b/SMP/config.h
+@@ -21,7 +21,7 @@
+ #define ftell _ftelli64
+ #define HAVE_GPL 1
+ #define HAVE_INTERLACED 1
+-#define HAVE_OPENCL 1
++#define HAVE_OPENCL 0
+ #define HAVE_MALLOC_H 0
+ #define HAVE_ALTIVEC 0
+ #define HAVE_ALTIVEC_H 0
+@@ -42,4 +42,4 @@
+ #else
+ #   define HAVE_X86_INLINE_ASM 0
+ #endif
+-#define HAVE_WINRT 0
+\ No newline at end of file
++#define HAVE_WINRT 1
+\ No newline at end of file
+--- a/SMP/libx264.vcxproj
++++ b/SMP/libx264.vcxproj
+@@ -45,6 +45,7 @@
+   <PropertyGroup Label="Globals">
+     <ProjectGuid>{20179127-853B-4FE9-B7C0-9E817E6A3A72}</ProjectGuid>
+     <RootNamespace>libx264</RootNamespace>
++    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+   </PropertyGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+@@ -205,7 +206,7 @@
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+     <IntDir>$(SolutionDir)obj\$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+     <TargetName>libx264</TargetName>
+-    <OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
++    <OutDir>$(ProjectDir)output\$(Configuration)\</OutDir>
+     <CustomBuildAfterTargets>Clean</CustomBuildAfterTargets>
+   </PropertyGroup>
+   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseLTO|x64'">
+@@ -1007,7 +1008,9 @@ del /f /q $(OutDir)\licenses\x264.txt
+     <ClCompile Include="..\common\macroblock.c" />
+     <ClCompile Include="..\common\mc.c" />
+     <ClCompile Include="..\common\mvpred.c" />
+-    <ClCompile Include="..\common\opencl.c" />
++    <ClCompile Include="..\common\opencl.c">
++      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
++    </ClCompile>
+     <ClCompile Include="..\common\osdep.c" />
+     <ClCompile Include="..\common\pixel.c" />
+     <ClCompile Include="..\common\predict.c" />
+-- 
+2.8.1.windows.1
+