Advertisement
pintcat

do-x265 v1.1 - build script for the x265 video encoder

Dec 22nd, 2022 (edited)
734
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.83 KB | Software | 0 0
  1. #!/bin/sh
  2.  
  3. INSTALL_PATH=~/ubin
  4. WORK_PATH=/media/ramdisk
  5. URL=https://bitbucket.org/multicoreware/x265_git.git
  6. CORES=$(($(grep -m 1 "cpu cores" /proc/cpuinfo | awk '{print $4}')+1))
  7.  
  8. printf "\n\033[0;32mFetching source...\033[0m\n"
  9. git clone $URL $WORK_PATH/x265
  10. printf "\n\033[0;32mBuilding x265 binary...\033[0m\n"
  11. cd $WORK_PATH/x265/build/linux
  12. cmake -D CMAKE_FIND_LIBRARY_SUFFIXES=".a" -D ENABLE_SHARED=OFF -D CMAKE_EXE_LINKER_FLAGS="-static" -G "Unix Makefiles" ../../source/
  13. if make -j$CORES; then
  14.     printf "\n\033[0;32mCompressing & moving x265 binary to "$INSTALL_PATH"...\033[0m\n"
  15.     rm -f $INSTALL_PATH/x265
  16.     upx --lzma -9 -o $INSTALL_PATH/x265 x265
  17.     printf "\n\033[0;32mDone. Cleaning up.\033[0m\n"
  18.     cd $WORK_PATH
  19.     rm -rf x265
  20. else
  21.     printf "\n\033[0;31mAborted - compiling error.\033[0m\n"
  22.     exit 1
  23. fi
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement