Skip to content

Instantly share code, notes, and snippets.

@DevStefIt
Last active October 12, 2024 22:56
Show Gist options
  • Select an option

  • Save DevStefIt/ed0330d1fd8c8f8d2b96db6c3160cc66 to your computer and use it in GitHub Desktop.

Select an option

Save DevStefIt/ed0330d1fd8c8f8d2b96db6c3160cc66 to your computer and use it in GitHub Desktop.

Revisions

  1. DevStefIt revised this gist Oct 12, 2024. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions libx265_compile_release.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,9 @@ mkdir x265
    cd x265
    cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="../../installed/x265" -DCMAKE_BUILD_TYPE=Release -DENABLE_CLI=ON -DENABLE_SHARED=OFF -DCMAKE_CXX_FLAGS="-DWIN32 -D_WINDOWS -W4 -GR -EHsc" -DCMAKE_C_FLAGS="-DWIN32 -D_WINDOWS -W4" -DCMAKE_CXX_FLAGS_RELEASE="-MT -O2 -Ob2 -DNDEBUG" -DCMAKE_C_FLAGS_RELEASE="-MT -O2 -Ob2 -DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-MTd -Zi -Ob0 -Od -RTC1" -DCMAKE_C_FLAGS_DEBUG="-MTd -Zi -Ob0 -Od -RTC1" ../../sources/x265/source
    cmake --build . --config Release --target install
    # or, if you prefer
    # nmake
    # nmake install
    mv ../../installed/x265/lib/x265-static.lib ../../installed/x265/lib/x265.lib

    # Test script
  2. DevStefIt revised this gist Oct 12, 2024. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions libx265_compile_debug.sh
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,6 @@
    git clone https://bitbucket.org/multicoreware/x265_git
    mv x265_git x265
    # Modify "ffmpeg_build/sources/x265/source/CMakeLists.txt with the following edit
    # Line 163
    # From:
    #
    # add_definitions(/Ob2) # always inline
    #
  3. DevStefIt created this gist Oct 12, 2024.
    28 changes: 28 additions & 0 deletions libx265_compile_debug.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    # Make sure you opened the x64 Native Tools Command Prompt for VS 2022 and then opened MSYS2 shell command
    git clone https://bitbucket.org/multicoreware/x265_git
    mv x265_git x265
    # Modify "ffmpeg_build/sources/x265/source/CMakeLists.txt with the following edit
    # Line 163
    # From:
    #
    # add_definitions(/Ob2) # always inline
    #
    # To:
    # if(CMAKE_BUILD_TYPE STREQUAL "Release")
    # add_definitions(/Ob2) # always inline, only for release
    # endif()
    #
    sed -i 's| add_definitions(/Ob2) # always inline| if(CMAKE_BUILD_TYPE STREQUAL "Release")\n add_definitions(/Ob2) # always inline, only for release\n endif()|g' x265/source/CMakeLists.txt
    cd ../build
    mkdir x265
    cd x265
    cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="../../installed/x265" -DCMAKE_BUILD_TYPE=Debug -DENABLE_CLI=OFF -DENABLE_SHARED=OFF -DCMAKE_CXX_FLAGS="-DWIN32 -D_WINDOWS -W4 -GR -EHsc" -DCMAKE_C_FLAGS="-DWIN32 -D_WINDOWS -W4" -DCMAKE_CXX_FLAGS_RELEASE="-MT -O2 -Ob2 -DNDEBUG" -DCMAKE_C_FLAGS_RELEASE="-MT -O2 -Ob2 -DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-MTd -Zi -Ob0 -Od -RTC1" -DCMAKE_C_FLAGS_DEBUG="-MTd -Zi -Ob0 -Od -RTC1" -DCMAKE_EXE_LINKER_FLAGS="-DEBUG" ../../sources/x265/source
    cmake --build . --config Debug --target install
    # or, if you prefer
    # nmake
    # nmake install
    mv ../../installed/x265/lib/x265-static.lib ../../installed/x265/lib/x265.lib

    # Test script
    cd ../../installed/x265/bin
    ./x265 --crf 18 --preset slow --output output_file.mkv input_file
    12 changes: 12 additions & 0 deletions libx265_compile_release.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    git clone https://bitbucket.org/multicoreware/x265_git
    mv x265_git x265
    cd ../build
    mkdir x265
    cd x265
    cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX="../../installed/x265" -DCMAKE_BUILD_TYPE=Release -DENABLE_CLI=ON -DENABLE_SHARED=OFF -DCMAKE_CXX_FLAGS="-DWIN32 -D_WINDOWS -W4 -GR -EHsc" -DCMAKE_C_FLAGS="-DWIN32 -D_WINDOWS -W4" -DCMAKE_CXX_FLAGS_RELEASE="-MT -O2 -Ob2 -DNDEBUG" -DCMAKE_C_FLAGS_RELEASE="-MT -O2 -Ob2 -DNDEBUG" -DCMAKE_CXX_FLAGS_DEBUG="-MTd -Zi -Ob0 -Od -RTC1" -DCMAKE_C_FLAGS_DEBUG="-MTd -Zi -Ob0 -Od -RTC1" ../../sources/x265/source
    cmake --build . --config Release --target install
    mv ../../installed/x265/lib/x265-static.lib ../../installed/x265/lib/x265.lib

    # Test script
    cd ../../installed/x265/bin
    ./x265 --crf 18 --preset slow --output output_file.mkv input_file