diff --git a/packages/ffmpeg-dash-base-url-escape.patch b/packages/ffmpeg-dash-base-url-escape.patch new file mode 100644 index 00000000..b403b139 --- /dev/null +++ b/packages/ffmpeg-dash-base-url-escape.patch @@ -0,0 +1,26 @@ +diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c +index 29d4680..c50afaf 100644 +--- a/libavformat/dashdec.c ++++ b/libavformat/dashdec.c +@@ -768,7 +768,9 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur + baseurl = xmlNodeGetContent(node); + root_url = (av_strcasecmp(baseurl, "")) ? baseurl : path; + if (node) { +- xmlNodeSetContent(node, root_url); ++ char* root_url_content = xmlEncodeSpecialChars(NULL, root_url); ++ xmlNodeSetContent(node, root_url_content); ++ xmlFree(root_url_content); + updated = 1; + } + +@@ -802,7 +804,9 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur + memset(p + 1, 0, strlen(p)); + } + av_strlcat(tmp_str, text + start, tmp_max_url_size); +- xmlNodeSetContent(baseurl_nodes[i], tmp_str); ++ char* tmp_str_content = xmlEncodeSpecialChars(NULL, tmp_str); ++ xmlNodeSetContent(baseurl_nodes[i], tmp_str_content); ++ xmlFree(tmp_str_content); + updated = 1; + xmlFree(text); + } diff --git a/packages/ffmpeg-fix-hls-mp4-seek.patch b/packages/ffmpeg-fix-hls-mp4-seek.patch new file mode 100644 index 00000000..3b04eccf --- /dev/null +++ b/packages/ffmpeg-fix-hls-mp4-seek.patch @@ -0,0 +1,14 @@ +diff --git a/libavformat/hls.c b/libavformat/hls.c +index 2a2fe28a540f..c625e3029116 100644 +--- a/libavformat/hls.c ++++ b/libavformat/hls.c +@@ -2506,6 +2506,9 @@ static int hls_read_seek(AVFormatContext *s, int stream_index, + /* Flush the packet queue of the subdemuxer. */ + ff_read_frame_flush(pls->ctx); + ++ /* Reset the init segment so it's re-fetched and served appropiately */ ++ pls->cur_init_section = NULL; ++ + pls->seek_timestamp = seek_timestamp; + pls->seek_flags = flags; + diff --git a/packages/ffmpeg.cmake b/packages/ffmpeg.cmake index 4363c198..2e2b7032 100644 --- a/packages/ffmpeg.cmake +++ b/packages/ffmpeg.cmake @@ -1,21 +1,14 @@ ExternalProject_Add(ffmpeg DEPENDS amf-headers - avisynth-headers nvcodec-headers bzip2 + gmp lame - lcms2 - openssl - libssh - libsrt libass - libbluray - libmodplug libpng libsoxr libbs2b - libvpx libwebp libzimg libmysofa @@ -24,96 +17,282 @@ ExternalProject_Add(ffmpeg opus speex vorbis - x264 - ${ffmpeg_x265} - xvidcore - libxml2 libvpl - libopenmpt libjxl - shaderc + libxml2 libplacebo - libzvbi - libaribcaption - aom - rav1e + shaderc dav1d - vapoursynth - uavs3d - davs2 - rubberband - libva - openal-soft + mbedtls GIT_REPOSITORY https://github.com/FFmpeg/FFmpeg.git SOURCE_DIR ${SOURCE_LOCATION} - GIT_CLONE_FLAGS "--filter=tree:0" + GIT_TAG ea3d24bbe3c58b171e55fe2151fc7ffaca3ab3d2 + PATCH_COMMAND ${EXEC} git apply ${CMAKE_CURRENT_SOURCE_DIR}/ffmpeg-*.patch UPDATE_COMMAND "" CONFIGURE_COMMAND ${EXEC} CONF=1 /configure --cross-prefix=${TARGET_ARCH}- --prefix=${MINGW_INSTALL_PREFIX} --arch=${TARGET_CPU} --target-os=mingw32 + --target-exec=wine --pkg-config-flags=--static --enable-cross-compile - --enable-runtime-cpudetect - ${ffmpeg_hardcoded_tables} - --enable-gpl + + --disable-gpl + --disable-nonfree --enable-version3 - --enable-postproc - --enable-avisynth - --enable-vapoursynth - --enable-libass - --enable-libbluray - --enable-libfreetype - --enable-libfribidi - --enable-libfontconfig - --enable-libharfbuzz - --enable-libmodplug - --enable-libopenmpt - --enable-libmp3lame - --enable-lcms2 - --enable-libopus - --enable-libsoxr - --enable-libspeex - --enable-libvorbis + --enable-static + --disable-shared + --disable-vulkan + --disable-iconv + --enable-stripping + + --disable-muxers + --disable-decoders + --disable-encoders + --disable-demuxers + --disable-parsers + --disable-protocols + --disable-filters + --disable-doc + --disable-postproc + --disable-programs + --disable-gray + --disable-swscale-alpha + + --enable-bsfs + + --enable-amf + --enable-cuda + --enable-nvdec + --enable-nvenc + --enable-cuvid + --enable-dxva2 + --enable-libmfx + --enable-d3d11va + --enable-ffnvcodec + + --disable-vaapi + --disable-vdpau + --disable-bzlib + --disable-libmfx + --disable-libuavs3d + --disable-linux-perf + --disable-videotoolbox + --disable-audiotoolbox + + --enable-small + --enable-hwaccels + --enable-optimizations + --enable-runtime-cpudetect + + --enable-mbedtls + + --enable-libjxl + --enable-libdav1d + --enable-libplacebo + + --enable-libvpl --enable-libbs2b - --enable-librubberband - --enable-libvpx --enable-libwebp - --enable-libx264 - --enable-libx265 - --enable-libaom - --enable-librav1e - --enable-libdav1d - --enable-libdavs2 - --enable-libuavs3d - --enable-libxvid --enable-libzimg - --enable-openssl --enable-libxml2 + --enable-libsoxr + --enable-libspeex --enable-libmysofa - --enable-libssh - --enable-libsrt - --enable-libvpl - --enable-libjxl - --enable-libplacebo --enable-libshaderc - --enable-libzvbi - --enable-libaribcaption - --enable-cuda-llvm - --enable-cuvid - --enable-nvdec - --enable-nvenc - --enable-amf - --enable-openal - --enable-opengl - --disable-doc - --disable-ffplay - --disable-ffprobe - --enable-vaapi - --disable-vdpau - --disable-videotoolbox - --disable-decoder=libaom_av1 + --enable-libfribidi + --enable-libfreetype + + --enable-avutil + --enable-avcodec + --enable-avfilter + --enable-avformat + --enable-avdevice + --enable-swscale + --enable-swresample + + --enable-decoder=flv + --enable-decoder=h263 + --enable-decoder=h263i + --enable-decoder=h263p + --enable-decoder=h264* + --enable-decoder=mpeg1video + --enable-decoder=mpeg2* + --enable-decoder=mpeg4* + --enable-decoder=vp6 + --enable-decoder=vp6a + --enable-decoder=vp6f + --enable-decoder=vp8* + --enable-decoder=vp9* + --enable-decoder=hevc* + --enable-decoder=av1* + --enable-decoder=libdav1d + --enable-decoder=theora + --enable-decoder=msmpeg* + --enable-decoder=mjpeg* + --enable-decoder=wmv* + + --enable-decoder=aac* + --enable-decoder=ac3 + --enable-decoder=alac + --enable-decoder=als + --enable-decoder=ape + --enable-decoder=atrac* + --enable-decoder=eac3 + --enable-decoder=flac + --enable-decoder=gsm* + --enable-decoder=mp1* + --enable-decoder=mp2* + --enable-decoder=mp3* + --enable-decoder=mpc* + --enable-decoder=opus + --enable-decoder=ra* + --enable-decoder=ralf + --enable-decoder=shorten + --enable-decoder=tak + --enable-decoder=tta + --enable-decoder=vorbis + --enable-decoder=wavpack + --enable-decoder=wma* + --enable-decoder=pcm* + --enable-decoder=dsd* + --enable-decoder=dca + + --enable-decoder=ssa + --enable-decoder=ass + --enable-decoder=dvbsub + --enable-decoder=dvdsub + --enable-decoder=srt + --enable-decoder=stl + --enable-decoder=subrip + --enable-decoder=subviewer + --enable-decoder=subviewer1 + --enable-decoder=text + --enable-decoder=vplayer + --enable-decoder=webvtt + --enable-decoder=movtext + + --enable-decoder=mjpeg + --enable-decoder=ljpeg + --enable-decoder=jpegls + --enable-decoder=jpeg2000 + --enable-decoder=png + --enable-decoder=gif + --enable-decoder=bmp + --enable-decoder=tiff + --enable-decoder=webp + --enable-decoder=jpegls + + --enable-demuxer=concat + --enable-demuxer=data + --enable-demuxer=flv + --enable-demuxer=hls + --enable-demuxer=latm + --enable-demuxer=live_flv + --enable-demuxer=loas + --enable-demuxer=m4v + --enable-demuxer=mov + --enable-demuxer=mpegps + --enable-demuxer=mpegts + --enable-demuxer=mpegvideo + --enable-demuxer=hevc + --enable-demuxer=rtsp + --enable-demuxer=mpeg4 + --enable-demuxer=mjpeg* + --enable-demuxer=avi + --enable-demuxer=av1 + --enable-demuxer=matroska + --enable-demuxer=dash + --enable-demuxer=webm_dash_manifest + + --enable-demuxer=aac + --enable-demuxer=ac3 + --enable-demuxer=aiff + --enable-demuxer=ape + --enable-demuxer=asf + --enable-demuxer=au + --enable-demuxer=avi + --enable-demuxer=flac + --enable-demuxer=flv + --enable-demuxer=matroska + --enable-demuxer=mov + --enable-demuxer=m4v + --enable-demuxer=mp3 + --enable-demuxer=mpc* + --enable-demuxer=ogg + --enable-demuxer=pcm* + --enable-demuxer=rm + --enable-demuxer=shorten + --enable-demuxer=tak + --enable-demuxer=tta + --enable-demuxer=wav + --enable-demuxer=wv + --enable-demuxer=xwma + --enable-demuxer=dsf + --enable-demuxer=truehd + --enable-demuxer=dts + --enable-demuxer=dtshd + + --enable-demuxer=ass + --enable-demuxer=srt + --enable-demuxer=stl + --enable-demuxer=webvtt + --enable-demuxer=subviewer + --enable-demuxer=subviewer1 + --enable-demuxer=vplayer + + --enable-parser=h263 + --enable-parser=h264 + --enable-parser=hevc + --enable-parser=mpeg4 + --enable-parser=mpeg4video + --enable-parser=mpegvideo + + --enable-parser=aac* + --enable-parser=ac3 + --enable-parser=cook + --enable-parser=flac + --enable-parser=gsm + --enable-parser=mpegaudio + --enable-parser=tak + --enable-parser=vorbis + --enable-parser=dca + + --enable-filter=overlay + --enable-filter=equalizer + + --enable-protocol=async + --enable-protocol=cache + --enable-protocol=crypto + --enable-protocol=data + --enable-protocol=ffrtmphttp + --enable-protocol=file + --enable-protocol=ftp + --enable-protocol=hls + --enable-protocol=http + --enable-protocol=httpproxy + --enable-protocol=https + --enable-protocol=pipe + --enable-protocol=rtmp + --enable-protocol=rtmps + --enable-protocol=rtmpt + --enable-protocol=rtmpts + --enable-protocol=rtp + --enable-protocol=subfile + --enable-protocol=tcp + --enable-protocol=tls + --enable-protocol=srt + + --enable-encoder=mjpeg + --enable-encoder=ljpeg + --enable-encoder=jpegls + --enable-encoder=jpeg2000 + --enable-encoder=png + --enable-encoder=jpegls + + --enable-network + ${ffmpeg_lto} --extra-cflags='-Wno-error=int-conversion' "--extra-libs='${ffmpeg_extra_libs}'" # -lstdc++ / -lc++ needs by libjxl and shaderc diff --git a/packages/mpv-release.cmake b/packages/mpv-release.cmake index 8ad710fb..f91c8d4c 100644 --- a/packages/mpv-release.cmake +++ b/packages/mpv-release.cmake @@ -21,22 +21,13 @@ ExternalProject_Add(mpv-release lcms2 libarchive libass - libdvdnav - libdvdread - libiconv libjpeg libpng - luajit - rubberband uchardet - openal-soft mujs - vulkan shaderc libplacebo spirv-cross - vapoursynth - libsdl2 URL ${LINK} SOURCE_DIR ${SOURCE_LOCATION} CONFIGURE_COMMAND ${EXEC} CONF=1 meson setup @@ -50,21 +41,19 @@ ExternalProject_Add(mpv-release -Doptimization=3 -Db_lto=true ${mpv_lto_mode} + -Dgpl=false + -Db_lto=true + -Db_ndebug=true -Dlibmpv=true -Dpdf-build=enabled - -Dlua=enabled + -Dlua=disabled -Djavascript=enabled - -Dsdl2=enabled - -Dlibarchive=enabled - -Dlibbluray=enabled - -Ddvdnav=enabled -Duchardet=enabled - -Drubberband=enabled -Dlcms2=enabled - -Dopenal=enabled + -Dopenal=disabled -Dspirv-cross=enabled -Dvulkan=enabled - -Dvapoursynth=enabled + -Dlibplacebo=enabled -Degl-angle=enabled BUILD_COMMAND ${EXEC} LTO_JOB=1 ninja -C INSTALL_COMMAND "" diff --git a/packages/mpv.cmake b/packages/mpv.cmake index 983719f3..56120e8c 100644 --- a/packages/mpv.cmake +++ b/packages/mpv.cmake @@ -6,22 +6,13 @@ ExternalProject_Add(mpv lcms2 libarchive libass - libdvdnav - libdvdread - libiconv libjpeg libpng - luajit - rubberband uchardet - openal-soft mujs - vulkan shaderc libplacebo spirv-cross - vapoursynth - libsdl2 GIT_REPOSITORY https://github.com/mpv-player/mpv.git SOURCE_DIR ${SOURCE_LOCATION} GIT_CLONE_FLAGS "--filter=tree:0" @@ -37,21 +28,19 @@ ExternalProject_Add(mpv -Doptimization=3 -Db_lto=true ${mpv_lto_mode} + -Dgpl=false + -Db_lto=true + -Db_ndebug=true -Dlibmpv=true -Dpdf-build=enabled - -Dlua=enabled + -Dlua=disabled -Djavascript=enabled - -Dsdl2=enabled - -Dlibarchive=enabled - -Dlibbluray=enabled - -Ddvdnav=enabled -Duchardet=enabled - -Drubberband=enabled -Dlcms2=enabled - -Dopenal=enabled + -Dopenal=disabled -Dspirv-cross=enabled -Dvulkan=enabled - -Dvapoursynth=enabled + -Dlibplacebo=enabled -Degl-angle=enabled BUILD_COMMAND ${EXEC} LTO_JOB=1 ninja -C INSTALL_COMMAND ""