Skip to content

Instantly share code, notes, and snippets.

@nicksan2c
Forked from mmstick/transcode-install.sh
Created October 24, 2017 08:30
Show Gist options
  • Select an option

  • Save nicksan2c/061abd27a393f2d5b91d64f621d89f43 to your computer and use it in GitHub Desktop.

Select an option

Save nicksan2c/061abd27a393f2d5b91d64f621d89f43 to your computer and use it in GitHub Desktop.

Revisions

  1. @mmstick mmstick renamed this gist Jun 11, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @mmstick mmstick renamed this gist Jun 11, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update.sh → transcode-update.sh
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ function update-x265() {
    cd "${sourcedir}x265/build/linux"
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    package-deb "x265-10bit" "1.6" "x265"
    package-deb "x265-10bit" "$(git rev-list --count HEAD)" "x265"
    }

    function update-ffmpeg() {
  3. @mmstick mmstick revised this gist Jun 11, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ function update-x265() {
    function update-ffmpeg() {
    cd "${sourcedir}ffmpeg"; git pull
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-libbluray --enable-libcdio --enable-libfreetype --enable-libfribidi --enable-libsmbclient --enable-version3 --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    packageDeb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    package-deb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    }


  4. @mmstick mmstick revised this gist Jun 11, 2015. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -81,7 +81,7 @@ function build-x265() {
    sudo apt-fast autoremove libx265{-43,-dev} -y # Conflicts with ffmpeg
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    package-deb "x265-10bit" "1.6" "x265"
    package-deb "x265-10bit" "$(git rev-list --count HEAD)" "x265"
    }

    ## Builds the latest version of ffmpeg with libass-git and x265-10bit-git support.
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ function update-x265() {
    package-deb "x265-10bit" "1.6" "x265"
    }

    function buildFfmpeg() {
    function update-ffmpeg() {
    cd "${sourcedir}ffmpeg"; git pull
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-libbluray --enable-libcdio --enable-libfreetype --enable-libfribidi --enable-libsmbclient --enable-version3 --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    packageDeb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
  5. @mmstick mmstick revised this gist May 29, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@ mkdir "$sourcedir"
    export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'

    ## Installs the build tools and VDPAU drivers for mesa
    function install-dependencies() {
    # Install build tools and Mesa VDPAU support.
    sudo apt-fast install -y cmake yasm autoconf build-essential mesa-vdpau-drivers \
    libvdpau-va-gl1

    @@ -37,7 +37,7 @@ function install-dependencies() {
    ## Bomi Development Libraries
    sudo apt-fast install qt5-default qttools5-dev-tools qtquick1-5-dev \
    lib{qt5svg5,qt5x11extras5,systemd,glib2.0}-dev \
    lib{xv,bz2}-dev qtdeclarative5-dev -y
    libbz2-dev qtdeclarative5-dev -y

    # Bomi Dependencies
    sudo apt-fast install qtdeclarative5-controls-plugin -y
  6. @mmstick mmstick revised this gist May 29, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -45,7 +45,7 @@ function install-dependencies() {

    ## Compiles the source code, packages it into a deb and cleans up compiled files
    ## from the source tree.
    function package-debb() {
    function package-deb() {
    make -j9
    sudo checkinstall --pkgname "$1" --pkgversion "$2" --provides "$3" -y
    make distclean; make clean
  7. @mmstick mmstick revised this gist May 29, 2015. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -72,7 +72,7 @@ function download-bomi() {
    function build-libass() {
    cd "${sourcedir}/libass"
    ./autogen.sh; ./configure prefix=/usr
    package-debb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    }

    ## Bulds the latest version of x265 compiled with 10-bit encode support.
    @@ -81,14 +81,14 @@ function build-x265() {
    sudo apt-fast autoremove libx265{-43,-dev} -y # Conflicts with ffmpeg
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    package-debb "x265-10bit" "1.6" "x265"
    package-deb "x265-10bit" "1.6" "x265"
    }

    ## Builds the latest version of ffmpeg with libass-git and x265-10bit-git support.
    function build-ffmpeg() {
    cd ${sourcedir}ffmpeg
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-libbluray --enable-libcdio --enable-libfreetype --enable-libfribidi --enable-libsmbclient --enable-version3 --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    package-debb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    package-deb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    }

    ## Builds the latest git of Bomi using the version of ffmpeg that we compiled earlier,
    @@ -98,7 +98,7 @@ function build-bomi() {
    ./download-libchardet
    ./build-libchardet
    ./configure --prefix=/usr/local
    package-debb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    package-deb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    }

    function main() {
  8. @mmstick mmstick revised this gist May 29, 2015. 2 changed files with 31 additions and 70 deletions.
    79 changes: 30 additions & 49 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'

    ## Installs the build tools and VDPAU drivers for mesa
    function installDependencies() {
    function install-dependencies() {
    sudo apt-fast install -y cmake yasm autoconf build-essential mesa-vdpau-drivers \
    libvdpau-va-gl1

    @@ -24,108 +24,89 @@ function installDependencies() {
    libzvbi-common libzvbi0

    # Development Libraries
    sudo apt-fast install -y lib{pulse,asound2,jack}-dev \ # Audio
    lib{x264,vpx,theora,opus,vorbis,fdk-aac,x11}-dev \ # Video
    lib{freetype6,fribidi,fontconfig1,harfbuzz,enca}-dev \ # Subtitles
    lib{dvdread,dvdnav,bluray,cdio,cdio-cdda,cdio-paranoia}-dev \ # Media
    lib{va,vdpau}-dev # Hardware Accel
    sudo apt-fast install -y lib{pulse,asound2,jack}-dev \
    lib{x264,vpx,theora,opus,vorbis,fdk-aac}-dev \
    lib{freetype6,fribidi,fontconfig1,harfbuzz,enca}-dev \
    lib{dvdread,dvdnav,bluray,cdio,cdio-cdda,cdio-paranoia,smbclient}-dev \
    lib{va,vdpau}-dev

    # X11 Libs
    sudo apt-fast install lib{x11,xcb-icccm4,xcb-screensaver0,xcb-randr0}-dev \
    lib{xcb-xtest0,xv,xrandr,xfixes,x11-xcb}-dev -y

    ## Bomi Development Libraries
    sudo apt-fast install qt5-default qttools5-dev-tools qtquick1-5-dev \
    lib{qt5svg5,qt5x11extras5,systemd,smbclient,glib2.0}-dev \
    lib{xv,bz2,xcb-icccm4,xcb-screensaver0,xcb-randr0,xcb-xtest0}-dev \
    qtdeclarative5-dev -y
    lib{qt5svg5,qt5x11extras5,systemd,glib2.0}-dev \
    lib{xv,bz2}-dev qtdeclarative5-dev -y

    # Bomi Dependencies
    sudo apt-fast install qtdeclarative5-controls-plugin -y
    }

    ## Compiles the source code, packages it into a deb and cleans up compiled files
    ## from the source tree.
    function packageDeb() {
    function package-debb() {
    make -j9
    sudo checkinstall --pkgname "$1" --pkgversion "$2" --provides "$3" -y
    make distclean; make clean
    }

    ## Functions for downloading the latest git of each respective project.
    function downloadX265() {
    function download-x265() {
    git clone https://github.com/videolan/x265
    }

    function downloadFfmpeg() {
    function download-ffmpeg() {
    git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
    }

    function downloadLibass() {
    function download-libass() {
    git clone https://github.com/libass/libass/
    }

    function downloadBomi() {
    function download-bomi() {
    git clone https://github.com/xylosper/bomi
    }

    ## Builds the latest version of the libass subtitle library, which is needed by bomi.
    function buildLibass() {
    function build-libass() {
    cd "${sourcedir}/libass"
    ./autogen.sh; ./configure prefix=/usr
    packageDeb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    package-debb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    }

    ## Bulds the latest version of x265 compiled with 10-bit encode support.
    ## If another package relies upon the stock libx265-43 package, that package might break.
    ## If there is breakage, I'll work for a solution in the immediate future.
    function buildX265() {
    function build-x265() {
    cd "${sourcedir}x265/build/linux"
    sudo apt-fast autoremove libx265{-43,-dev} -y # Conflicts with ffmpeg
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    packageDeb "x265-10bit" "1.6" "x265"
    package-debb "x265-10bit" "1.6" "x265"
    }

    ## Builds the latest version of ffmpeg with libass-git and x265-10bit-git support.
    function buildFfmpeg() {
    function build-ffmpeg() {
    cd ${sourcedir}ffmpeg
    ./configure --prefix=/usr \
    --enable-gpl \
    --enable-nonfree \
    --enable-libass \
    --enable-libfreetype \
    --enable-libopus \
    --enable-libvorbis \
    --enable-libfdk-aac \
    --enable-libx265 \
    --enable-libx264 \
    --enable-libvpx \
    --enable-libtheora \
    --enable-libbluray \
    --enable-libcdio \
    --enable-libfreetype \
    --enable-libfribidi \
    --enable-libsmbclient \
    --enable-version3 \
    --enable-x11grab \
    --extra-cflags="-march=native -O3" \
    --extra-cxxflags="-march=native -O3"
    packageDeb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-libbluray --enable-libcdio --enable-libfreetype --enable-libfribidi --enable-libsmbclient --enable-version3 --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    package-debb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    }

    ## Builds the latest git of Bomi using the version of ffmpeg that we compiled earlier,
    ## and with all features enabled. Please report missing features.
    function buildBomi() {
    function build-bomi() {
    cd "${sourcedir}bomi"
    ./download-libchardet
    ./build-libchardet
    ./configure --prefix=/usr/local
    packageDeb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    package-debb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    }

    function main() {
    cd "$sourcedir"
    installDependencies
    downloadX265; downloadFfmpeg; downloadLibass
    buildLibass; buildX265; buildFfmpeg
    downloadBomi; buildBomi ## Optional
    install-dependencies
    download-265; download-ffmpeg; download-libass
    build-libass; build-x265; build-ffmpeg
    download-bomi; build-bomi ## Optional
    }

    main
    22 changes: 1 addition & 21 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -26,27 +26,7 @@ function update-x265() {

    function buildFfmpeg() {
    cd "${sourcedir}ffmpeg"; git pull
    ./configure --prefix=/usr \
    --enable-gpl \
    --enable-nonfree \
    --enable-libass \
    --enable-libfreetype \
    --enable-libopus \
    --enable-libvorbis \
    --enable-libfdk-aac \
    --enable-libx265 \
    --enable-libx264 \
    --enable-libvpx \
    --enable-libtheora \
    --enable-libbluray \
    --enable-libcdio \
    --enable-libfreetype \
    --enable-libfribidi \
    --enable-libsmbclient \
    --enable-version3 \
    --enable-x11grab \
    --extra-cflags="-march=native -O3" \
    --extra-cxxflags="-march=native -O3"
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-libbluray --enable-libcdio --enable-libfreetype --enable-libfribidi --enable-libsmbclient --enable-version3 --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    packageDeb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    }

  9. @mmstick mmstick revised this gist May 28, 2015. 2 changed files with 2 additions and 8 deletions.
    9 changes: 1 addition & 8 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -116,17 +116,10 @@ function buildBomi() {
    cd "${sourcedir}bomi"
    ./download-libchardet
    ./build-libchardet
    ./configure --prefix=/usr/local
    packageDeb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    }

    function buildMPV() {
    cd "${sourcedir}mpv"
    ./bootstrap.py
    ./waf configure
    ./waf build

    }

    function main() {
    cd "$sourcedir"
    installDependencies
    1 change: 1 addition & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -54,6 +54,7 @@ function buildFfmpeg() {
    function update-bomi() {
    cd "${sourcedir}bomi"; git pull
    ./download-libchardet; ./build-libchardet
    ./configure --prefix=/usr/local
    package-deb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    }

  10. @mmstick mmstick revised this gist May 28, 2015. 2 changed files with 12 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -98,6 +98,12 @@ function buildFfmpeg() {
    --enable-libx264 \
    --enable-libvpx \
    --enable-libtheora \
    --enable-libbluray \
    --enable-libcdio \
    --enable-libfreetype \
    --enable-libfribidi \
    --enable-libsmbclient \
    --enable-version3 \
    --enable-x11grab \
    --extra-cflags="-march=native -O3" \
    --extra-cxxflags="-march=native -O3"
    6 changes: 6 additions & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -38,6 +38,12 @@ function buildFfmpeg() {
    --enable-libx264 \
    --enable-libvpx \
    --enable-libtheora \
    --enable-libbluray \
    --enable-libcdio \
    --enable-libfreetype \
    --enable-libfribidi \
    --enable-libsmbclient \
    --enable-version3 \
    --enable-x11grab \
    --extra-cflags="-march=native -O3" \
    --extra-cxxflags="-march=native -O3"
  11. @mmstick mmstick revised this gist May 28, 2015. 1 changed file with 26 additions and 16 deletions.
    42 changes: 26 additions & 16 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    #!/bin/bash
    mkdir ~/.local/src
    sourcedir="$HOME/.local/src/"
    mkdir $sourcedir
    export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'

    @@ -10,34 +11,43 @@ function package-deb() {
    }

    function update-libass() {
    cd ~/.local/src/libass; git pull
    cd "${sourcedir}libass"; git pull
    ./autogen.sh; ./configure prefix=/usr
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    }

    function update-x265() {
    cd ~/.local/src/x265; git pull
    cd ~/.local/src/x265/build/linux
    cd "${sourcedir}x265"; git pull
    cd "${sourcedir}x265/build/linux"
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    package-deb "x265-10bit" "1.6" "x265"
    }

    function update-ffmpeg() {
    cd ~/.local/src/ffmpeg; git pull
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    package-deb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    function buildFfmpeg() {
    cd "${sourcedir}ffmpeg"; git pull
    ./configure --prefix=/usr \
    --enable-gpl \
    --enable-nonfree \
    --enable-libass \
    --enable-libfreetype \
    --enable-libopus \
    --enable-libvorbis \
    --enable-libfdk-aac \
    --enable-libx265 \
    --enable-libx264 \
    --enable-libvpx \
    --enable-libtheora \
    --enable-x11grab \
    --extra-cflags="-march=native -O3" \
    --extra-cxxflags="-march=native -O3"
    packageDeb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    }


    function update-bomi() {
    cd ~/.local/src/bomi; git pull
    ./download-libchardet
    ./build-libchardet
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,libasound2,jack}-dev \
    lib{dvdread,dvdnav,bluray,glib2.0,libva,vdpau,xcb-icccm4,xcb-screensaver0}-dev \
    lib{xcb-randr0,xcb-xtest0,systemd,cdio,cdio-cdda,cdio-paranoia,smbclient}-dev \
    lib{qt5svg5,qt5x11extras5,xv,bz2}-dev qt-quick1-5-dev qtdeclarative5-dev \
    qtdeclarative5-controls-plugin
    cd "${sourcedir}bomi"; git pull
    ./download-libchardet; ./build-libchardet
    package-deb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    }

  12. @mmstick mmstick revised this gist May 28, 2015. 1 changed file with 71 additions and 26 deletions.
    97 changes: 71 additions & 26 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    sourcedir="~/.local/src/"
    sourcedir="$HOME/.local/src/"
    mkdir "$sourcedir"
    export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    @@ -8,6 +8,36 @@ export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    function installDependencies() {
    sudo apt-fast install -y cmake yasm autoconf build-essential mesa-vdpau-drivers \
    libvdpau-va-gl1

    # Remove Conflicts
    sudo apt-get autoremove libass{5,-dev} libx265{-43,-dev} -y

    # These packages are removed for some reason when removing libass from Ubuntu.
    sudo apt-fast install -y freepats gstreamer1.0-plugins-bad-faad \
    gstreamer1.0-plugins-bad-videoparsers libcdaudio1 libdca0 \
    libdirac-encoder0 libdirectfb-1.2-9 libfluidsynth1 libgme0 \
    libgstreamer-plugins-bad0.10-0 libgstreamer-plugins-bad1.0-0 libkate1 libmimic0 \
    libmms0 libmpg123-0 libofa0 libopencv-calib3d2.4 libopencv-contrib2.4 \
    libopencv-features2d2.4 libopencv-flann2.4 libopencv-legacy2.4 \
    libopencv-ml2.4 libopencv-objdetect2.4 libopencv-video2.4 libslv2-9 \
    libsoundtouch0 libspandsp2 libsrtp0 libwildmidi-config libwildmidi1 libzbar0 \
    libzvbi-common libzvbi0

    # Development Libraries
    sudo apt-fast install -y lib{pulse,asound2,jack}-dev \ # Audio
    lib{x264,vpx,theora,opus,vorbis,fdk-aac,x11}-dev \ # Video
    lib{freetype6,fribidi,fontconfig1,harfbuzz,enca}-dev \ # Subtitles
    lib{dvdread,dvdnav,bluray,cdio,cdio-cdda,cdio-paranoia}-dev \ # Media
    lib{va,vdpau}-dev # Hardware Accel

    ## Bomi Development Libraries
    sudo apt-fast install qt5-default qttools5-dev-tools qtquick1-5-dev \
    lib{qt5svg5,qt5x11extras5,systemd,smbclient,glib2.0}-dev \
    lib{xv,bz2,xcb-icccm4,xcb-screensaver0,xcb-randr0,xcb-xtest0}-dev \
    qtdeclarative5-dev -y

    # Bomi Dependencies
    sudo apt-fast install qtdeclarative5-controls-plugin -y
    }

    ## Compiles the source code, packages it into a deb and cleans up compiled files
    @@ -19,28 +49,27 @@ function packageDeb() {
    }

    ## Functions for downloading the latest git of each respective project.
    function downloadX265() { git clone https://github.com/videolan/x265 }
    function downloadFfmpeg() { git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg }
    function downloadLibass() { git clone https://github.com/libass/libass/ }
    function downloadBomi() { git clone https://github.com/xylosper/bomi }
    function downloadX265() {
    git clone https://github.com/videolan/x265
    }

    function downloadFfmpeg() {
    git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
    }

    function downloadLibass() {
    git clone https://github.com/libass/libass/
    }

    function downloadBomi() {
    git clone https://github.com/xylosper/bomi
    }

    ## Builds the latest version of the libass subtitle library, which is needed by bomi.
    function buildLibass() {
    sudo apt-get autoremove libass{5,-dev}
    sudo apt-fast install lib{freetype6,fribidi,fontconfig1}-dev
    cd "${sourcedir}/libass"
    ./autogen.sh; ./configure prefix=/usr
    packageDeb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    # These packages are removed for some reason when removing libass from Ubuntu.
    sudo apt-fast install -y freepats gstreamer1.0-plugins-bad-faad \
    gstreamer1.0-plugins-bad-videoparsers libcdaudio1 libdca0 \
    libdirac-encoder0 libdirectfb-1.2-9 libfluidsynth1 libgme0 \
    libgstreamer-plugins-bad0.10-0 libgstreamer-plugins-bad1.0-0 libkate1 libmimic0 \
    libmms0 libmpg123-0 libofa0 libopencv-calib3d2.4 libopencv-contrib2.4 \
    libopencv-features2d2.4 libopencv-flann2.4 libopencv-legacy2.4 \
    libopencv-ml2.4 libopencv-objdetect2.4 libopencv-video2.4 libslv2-9 \
    libsoundtouch0 libspandsp2 libsrtp0 libwildmidi-config libwildmidi1 libzbar0 \
    libzvbi-common libzvbi0
    }

    ## Bulds the latest version of x265 compiled with 10-bit encode support.
    @@ -56,26 +85,42 @@ function buildX265() {

    ## Builds the latest version of ffmpeg with libass-git and x265-10bit-git support.
    function buildFfmpeg() {
    cd "${sourcedir}/ffmpeg"
    sudo apt-fast install -y libx264-dev libvpx-dev libtheora-dev libopus-dev libvorbis-dev libfdk-aac-dev libx11-dev libharfbuzz-dev libenca-dev
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    cd ${sourcedir}ffmpeg
    ./configure --prefix=/usr \
    --enable-gpl \
    --enable-nonfree \
    --enable-libass \
    --enable-libfreetype \
    --enable-libopus \
    --enable-libvorbis \
    --enable-libfdk-aac \
    --enable-libx265 \
    --enable-libx264 \
    --enable-libvpx \
    --enable-libtheora \
    --enable-x11grab \
    --extra-cflags="-march=native -O3" \
    --extra-cxxflags="-march=native -O3"
    packageDeb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    }

    ## Builds the latest git of Bomi using the version of ffmpeg that we compiled earlier,
    ## and with all features enabled. Please report missing features.
    function buildBomi() {
    cd "${sourcedir}/bomi"
    cd "${sourcedir}bomi"
    ./download-libchardet
    ./build-libchardet
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,asound2,jack}-dev \
    lib{dvdread,dvdnav,bluray,glib2.0,va,vdpau,xcb-icccm4,xcb-screensaver0}-dev \
    lib{xcb-randr0,xcb-xtest0,systemd,cdio,cdio-cdda,cdio-paranoia,smbclient}-dev \
    lib{qt5svg5,qt5x11extras5,xv,bz2}-dev qtquick1-5-dev qtdeclarative5-dev \
    qtdeclarative5-controls-plugin -y
    packageDeb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    }

    function buildMPV() {
    cd "${sourcedir}mpv"
    ./bootstrap.py
    ./waf configure
    ./waf build

    }

    function main() {
    cd "$sourcedir"
    installDependencies
  13. @mmstick mmstick revised this gist May 28, 2015. 1 changed file with 21 additions and 13 deletions.
    34 changes: 21 additions & 13 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -1,26 +1,30 @@
    #!/bin/bash
    sourcedir="~/.local/src/"

    mkdir ~/.local/src
    mkdir "$sourcedir"
    export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'

    ## Installs the build tools and VDPAU drivers for mesa
    function installDependencies() {
    sudo apt-fast install -y cmake yasm autoconf build-essential mesa-vdpau-drivers \
    libvdpau-va-gl1
    }

    ## Compiles the source code, packages it into a deb and cleans up compiled files
    ## from the source tree.
    function packageDeb() {
    make -j9
    sudo checkinstall --pkgname "$1" --pkgversion "$2" --provides "$3" -y
    make distclean; make clean
    }

    ## Functions for downloading the latest git of each respective project.
    function downloadX265() { git clone https://github.com/videolan/x265 }
    function downloadFfmpeg() { git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg }
    function downloadLibass() { git clone https://github.com/libass/libass/ }
    function downloadBomi() { git clone https://github.com/xylosper/bomi }

    ## Builds the latest version of the libass subtitle library, which is needed by bomi.
    function buildLibass() {
    sudo apt-get autoremove libass{5,-dev}
    sudo apt-fast install lib{freetype6,fribidi,fontconfig1}-dev
    @@ -39,20 +43,27 @@ function buildLibass() {
    libzvbi-common libzvbi0
    }

    ## Bulds the latest version of x265 compiled with 10-bit encode support.
    ## If another package relies upon the stock libx265-43 package, that package might break.
    ## If there is breakage, I'll work for a solution in the immediate future.
    function buildX265() {
    cd "${sourcedir}x265/build/linux"
    sudo apt-fast autoremove libx265{-43,-dev} -y # Conflicts with ffmpeg
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    packageDeb "x265-10bit" "1.6" "x265"
    }

    ## Builds the latest version of ffmpeg with libass-git and x265-10bit-git support.
    function buildFfmpeg() {
    cd "${sourcedir}/ffmpeg"
    sudo apt-fast install -y libx264-dev libvpx-dev libtheora-dev libopus-dev libvorbis-dev libfdk-aac-dev libx11-dev libharfbuzz-dev libenca-dev
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    packageDeb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    }

    ## Builds the latest git of Bomi using the version of ffmpeg that we compiled earlier,
    ## and with all features enabled. Please report missing features.
    function buildBomi() {
    cd "${sourcedir}/bomi"
    ./download-libchardet
    @@ -65,15 +76,12 @@ function buildBomi() {
    packageDeb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    }

    function main() {
    cd "$sourcedir"
    installDependencies
    downloadX265; downloadFfmpeg; downloadLibass
    buildLibass; buildX265; buildFfmpeg
    downloadBomi; buildBomi ## Optional
    }


    cd "$sourcedir"
    installDependencies
    downloadX265
    downloadFfmpeg
    downloadLibass
    buildLibass
    buildX265
    buildFfmpeg
    downloadBomi ## Optional
    buildBomi ## Optional
    main
  14. @mmstick mmstick revised this gist May 28, 2015. 1 changed file with 29 additions and 31 deletions.
    60 changes: 29 additions & 31 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -5,30 +5,28 @@ mkdir ~/.local/src
    export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'

    function package-deb() {
    function installDependencies() {
    sudo apt-fast install -y cmake yasm autoconf build-essential mesa-vdpau-drivers \
    libvdpau-va-gl1
    }

    function packageDeb() {
    make -j9
    sudo checkinstall --pkgname "$1" --pkgversion "$2" --provides "$3" -y
    make distclean; make clean
    }

    function download-x265() {
    git clone https://github.com/videolan/x265
    }

    function download-ffmpeg() {
    git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
    }

    function download-libass() {
    git clone https://github.com/libass/libass/
    }
    function downloadX265() { git clone https://github.com/videolan/x265 }
    function downloadFfmpeg() { git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg }
    function downloadLibass() { git clone https://github.com/libass/libass/ }
    function downloadBomi() { git clone https://github.com/xylosper/bomi }

    function build-libass() {
    function buildLibass() {
    sudo apt-get autoremove libass{5,-dev}
    sudo apt-fast install lib{freetype6,fribidi,fontconfig1}-dev
    cd "${sourcedir}/libass"
    ./autogen.sh; ./configure prefix=/usr
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    packageDeb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    # These packages are removed for some reason when removing libass from Ubuntu.
    sudo apt-fast install -y freepats gstreamer1.0-plugins-bad-faad \
    gstreamer1.0-plugins-bad-videoparsers libcdaudio1 libdca0 \
    @@ -41,41 +39,41 @@ function build-libass() {
    libzvbi-common libzvbi0
    }

    function build-x265() {
    function buildX265() {
    cd "${sourcedir}x265/build/linux"
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    package-deb "x265-10bit" "1.6" "x265"
    packageDeb "x265-10bit" "1.6" "x265"
    }

    function build-ffmpeg() {
    function buildFfmpeg() {
    cd "${sourcedir}/ffmpeg"
    sudo apt-fast install -y libx264-dev libvpx-dev libtheora-dev libopus-dev libvorbis-dev libfdk-aac-dev libx11-dev libharfbuzz-dev libenca-dev
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    package-deb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    packageDeb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    }

    function build-bomi() {
    cd "$sourcedir"
    git clone https://github.com/xylosper/bomi
    cd bomi
    function buildBomi() {
    cd "${sourcedir}/bomi"
    ./download-libchardet
    ./build-libchardet
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,asound2,jack}-dev \
    lib{dvdread,dvdnav,bluray,glib2.0,va,vdpau,xcb-icccm4,xcb-screensaver0}-dev \
    lib{xcb-randr0,xcb-xtest0,systemd,cdio,cdio-cdda,cdio-paranoia,smbclient}-dev \
    lib{qt5svg5,qt5x11extras5,xv,bz2}-dev qtquick1-5-dev qtdeclarative5-dev \
    qtdeclarative5-controls-plugin -y
    package-deb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    packageDeb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    }

    sudo apt-fast install -y cmake yasm autoconf build-essential


    cd "$sourcedir"
    download-x265
    download-ffmpeg
    download-libass
    build-libass
    build-x265
    build-ffmpeg
    build-bomi ## Optional
    installDependencies
    downloadX265
    downloadFfmpeg
    downloadLibass
    buildLibass
    buildX265
    buildFfmpeg
    downloadBomi ## Optional
    buildBomi ## Optional
  15. @mmstick mmstick revised this gist May 28, 2015. 1 changed file with 15 additions and 6 deletions.
    21 changes: 15 additions & 6 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -26,10 +26,19 @@ function download-libass() {
    function build-libass() {
    sudo apt-get autoremove libass{5,-dev}
    sudo apt-fast install lib{freetype6,fribidi,fontconfig1}-dev
    cd "sourcedir"
    cd libass
    cd "${sourcedir}/libass"
    ./autogen.sh; ./configure prefix=/usr
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    # These packages are removed for some reason when removing libass from Ubuntu.
    sudo apt-fast install -y freepats gstreamer1.0-plugins-bad-faad \
    gstreamer1.0-plugins-bad-videoparsers libcdaudio1 libdca0 \
    libdirac-encoder0 libdirectfb-1.2-9 libfluidsynth1 libgme0 \
    libgstreamer-plugins-bad0.10-0 libgstreamer-plugins-bad1.0-0 libkate1 libmimic0 \
    libmms0 libmpg123-0 libofa0 libopencv-calib3d2.4 libopencv-contrib2.4 \
    libopencv-features2d2.4 libopencv-flann2.4 libopencv-legacy2.4 \
    libopencv-ml2.4 libopencv-objdetect2.4 libopencv-video2.4 libslv2-9 \
    libsoundtouch0 libspandsp2 libsrtp0 libwildmidi-config libwildmidi1 libzbar0 \
    libzvbi-common libzvbi0
    }

    function build-x265() {
    @@ -52,11 +61,11 @@ function build-bomi() {
    cd bomi
    ./download-libchardet
    ./build-libchardet
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,libasound2,jack}-dev \
    lib{dvdread,dvdnav,bluray,glib2.0,libva,vdpau,xcb-icccm4,xcb-screensaver0}-dev \
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,asound2,jack}-dev \
    lib{dvdread,dvdnav,bluray,glib2.0,va,vdpau,xcb-icccm4,xcb-screensaver0}-dev \
    lib{xcb-randr0,xcb-xtest0,systemd,cdio,cdio-cdda,cdio-paranoia,smbclient}-dev \
    lib{qt5svg5,qt5x11extras5,xv,bz2}-dev qt-quick1-5-dev qtdeclarative5-dev \
    qtdeclarative5-controls-plugin
    lib{qt5svg5,qt5x11extras5,xv,bz2}-dev qtquick1-5-dev qtdeclarative5-dev \
    qtdeclarative5-controls-plugin -y
    package-deb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    }

  16. @mmstick mmstick revised this gist May 28, 2015. 2 changed files with 14 additions and 23 deletions.
    28 changes: 12 additions & 16 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,14 @@
    #!/bin/bash
    sourcedir="~/.local/src/"

    mkdir ~/.local/src
    export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'

    function package-deb() {
    make -j9
    sudo checkinstall --pkgname "$1" --pkgversion "$2" --provides "$3" -y
    make distclean; make clean
    }

    function download-x265() {
    @@ -22,51 +26,43 @@ function download-libass() {
    function build-libass() {
    sudo apt-get autoremove libass{5,-dev}
    sudo apt-fast install lib{freetype6,fribidi,fontconfig1}-dev
    cd ~/.local/src
    cd "sourcedir"
    cd libass
    ./autogen.sh prefix=/usr
    ./configure
    make -j9
    ./autogen.sh; ./configure prefix=/usr
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    make distclean
    }

    function build-x265() {
    cd ~/.local/src/x265/build/linux
    cd "${sourcedir}x265/build/linux"
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    make -j9
    package-deb "x265-10bit" "1.6" "x265"
    make clean
    }

    function build-ffmpeg() {
    cd ~/.local/src/ffmpeg
    cd "${sourcedir}/ffmpeg"
    sudo apt-fast install -y libx264-dev libvpx-dev libtheora-dev libopus-dev libvorbis-dev libfdk-aac-dev libx11-dev libharfbuzz-dev libenca-dev
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    make -j9
    package-deb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    make distclean
    }

    function build-bomi() {
    cd ~/.local/src/
    cd "$sourcedir"
    git clone https://github.com/xylosper/bomi
    cd bomi
    ./download-libchardet
    ./build-libchardet
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,libasound2,jack}-dev \
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,libasound2,jack}-dev \
    lib{dvdread,dvdnav,bluray,glib2.0,libva,vdpau,xcb-icccm4,xcb-screensaver0}-dev \
    lib{xcb-randr0,xcb-xtest0,systemd,cdio,cdio-cdda,cdio-paranoia,smbclient}-dev \
    lib{qt5svg5,qt5x11extras5,xv,bz2}-dev qt-quick1-5-dev qtdeclarative5-dev \
    qtdeclarative5-controls-plugin
    package-deb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    make distclean
    }

    sudo apt-fast install -y libtool autoconf build-essential cmake yasm
    sudo apt-fast install -y cmake yasm autoconf build-essential

    cd ~/.local/src
    cd "$sourcedir"
    download-x265
    download-ffmpeg
    download-libass
    9 changes: 2 additions & 7 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -4,33 +4,29 @@ export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'

    function package-deb() {
    make -j9
    sudo checkinstall --pkgname "$1" --pkgversion "$2" --provides "$3" -y
    make distclean; make clean
    }

    function update-libass() {
    cd ~/.local/src/libass; git pull
    ./autogen.sh; ./configure prefix=/usr
    make -j9
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    make distclean
    }

    function update-x265() {
    cd ~/.local/src/x265; git pull
    cd ~/.local/src/x265/build/linux
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    make -j9
    package-deb "x265-10bit" "1.6" "x265"
    make clean
    }

    function update-ffmpeg() {
    cd ~/.local/src/ffmpeg; git pull
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    make -j9
    package-deb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    make distclean
    }

    function update-bomi() {
    @@ -43,7 +39,6 @@ function update-bomi() {
    lib{qt5svg5,qt5x11extras5,xv,bz2}-dev qt-quick1-5-dev qtdeclarative5-dev \
    qtdeclarative5-controls-plugin
    package-deb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    make distclean
    }

    sudo apt-fast update; sudo apt-fast dist-upgrade -y
  17. @mmstick mmstick revised this gist May 28, 2015. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ function build-libass() {
    sudo apt-fast install lib{freetype6,fribidi,fontconfig1}-dev
    cd ~/.local/src
    cd libass
    ./autogen.sh
    ./autogen.sh prefix=/usr
    ./configure
    make -j9
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    2 changes: 1 addition & 1 deletion update.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ function package-deb() {

    function update-libass() {
    cd ~/.local/src/libass; git pull
    ./autogen.sh; ./configure
    ./autogen.sh; ./configure prefix=/usr
    make -j9
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    make distclean
  18. @mmstick mmstick revised this gist May 28, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -64,7 +64,7 @@ function build-bomi() {
    make distclean
    }

    sudo apt-fast install -y libtool autoconf build-essential
    sudo apt-fast install -y libtool autoconf build-essential cmake yasm

    cd ~/.local/src
    download-x265
  19. @mmstick mmstick revised this gist May 28, 2015. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -64,6 +64,8 @@ function build-bomi() {
    make distclean
    }

    sudo apt-fast install -y libtool autoconf build-essential

    cd ~/.local/src
    download-x265
    download-ffmpeg
  20. @mmstick mmstick revised this gist May 28, 2015. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion install.sh
    Original file line number Diff line number Diff line change
    @@ -50,8 +50,9 @@ function build-ffmpeg() {
    }

    function build-bomi() {
    cd ~/.local/src/
    git clone https://github.com/xylosper/bomi
    cd ~/.local/src/bomi
    cd bomi
    ./download-libchardet
    ./build-libchardet
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,libasound2,jack}-dev \
  21. @mmstick mmstick revised this gist May 28, 2015. 2 changed files with 4 additions and 2 deletions.
    3 changes: 2 additions & 1 deletion transcode-x264-hardware.fish
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,8 @@ end
    # H.265 video. It receives a preset parameter, "$2", and a CRF parameter, "$3",
    # and will write the newly-transcoded videos to the transcoded directory.
    function transcode
    ffmpeg -i "$argv[1]" -c:a libopus -c:v libx264 -profile:v high -level 4.2 -crf "$argv[2]" (basename $argv[1] .mkv)_transcoded.mkv
    ffmpeg -i "$argv[1]" -c:a libopus -c:v libx264 -profile:v high -level 4.2 \
    -crf "$argv[2]" (basename $argv[1] .mkv)_transcoded.mkv
    end

    # After the transcode is complete, it moves the files to another directory
    3 changes: 2 additions & 1 deletion transcode-x265.fish
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,8 @@ end
    # and will write the newly-transcoded videos to the transcoded directory.
    function transcode
    ffmpeg -i "$argv[1]" -preset "$argv[2]" -c:a libopus -c:v libx265 \
    -x265-params "crf=$argv[3]:ref=6:subme=7:bframes=16" (basename $argv[1] .mkv)_transcoded.mkv
    -x265-params "crf=$argv[3]:ref=6:subme=7:bframes=16" \
    (basename $argv[1] .mkv)_transcoded.mkv
    end

    # After the transcode is complete, it moves the files to another directory
  22. @mmstick mmstick revised this gist May 28, 2015. 2 changed files with 98 additions and 14 deletions.
    59 changes: 45 additions & 14 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -1,42 +1,73 @@
    #!/bin/bash
    mkdir ~/.local/src

    function compile() {
    make -j9 CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall' CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    }
    export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'

    function package-deb() {
    sudo checkinstall --pkgname "$1" --pkgversion "$2" --provides "$3" -y
    }

    function download-x265-stable() {
    function download-x265() {
    git clone https://github.com/videolan/x265
    }

    function download-ffmpeg-git() {
    function download-ffmpeg() {
    git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
    }

    function compile-x265() {
    function download-libass() {
    git clone https://github.com/libass/libass/
    }

    function build-libass() {
    sudo apt-get autoremove libass{5,-dev}
    sudo apt-fast install lib{freetype6,fribidi,fontconfig1}-dev
    cd ~/.local/src
    cd libass
    ./autogen.sh
    ./configure
    make -j9
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    make distclean
    }

    function build-x265() {
    cd ~/.local/src/x265/build/linux
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    compile
    make -j9
    package-deb "x265-10bit" "1.6" "x265"
    make clean
    }

    function compile-ffmpeg() {
    function build-ffmpeg() {
    cd ~/.local/src/ffmpeg
    sudo apt-fast install -y libx264-dev libvpx-dev libtheora-dev libopus-dev libvorbis-dev libfdk-aac-dev libass-dev libx11-dev
    sudo apt-fast install -y libx264-dev libvpx-dev libtheora-dev libopus-dev libvorbis-dev libfdk-aac-dev libx11-dev libharfbuzz-dev libenca-dev
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    make -j9
    package-deb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    make distclean
    }

    function build-bomi() {
    git clone https://github.com/xylosper/bomi
    cd ~/.local/src/bomi
    ./download-libchardet
    ./build-libchardet
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,libasound2,jack}-dev \
    lib{dvdread,dvdnav,bluray,glib2.0,libva,vdpau,xcb-icccm4,xcb-screensaver0}-dev \
    lib{xcb-randr0,xcb-xtest0,systemd,cdio,cdio-cdda,cdio-paranoia,smbclient}-dev \
    lib{qt5svg5,qt5x11extras5,xv,bz2}-dev qt-quick1-5-dev qtdeclarative5-dev \
    qtdeclarative5-controls-plugin
    package-deb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    make distclean
    }

    cd ~/.local/src
    download-x265-stable
    download-ffmpeg-git
    compile-x265
    compile-ffmpeg
    download-x265
    download-ffmpeg
    download-libass
    build-libass
    build-x265
    build-ffmpeg
    build-bomi ## Optional
    53 changes: 53 additions & 0 deletions update.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,53 @@
    #!/bin/bash
    mkdir ~/.local/src
    export CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    export CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'

    function package-deb() {
    sudo checkinstall --pkgname "$1" --pkgversion "$2" --provides "$3" -y
    }

    function update-libass() {
    cd ~/.local/src/libass; git pull
    ./autogen.sh; ./configure
    make -j9
    package-deb "libass-git" "$(git rev-list --count HEAD)" "libass5, libass-dev"
    make distclean
    }

    function update-x265() {
    cd ~/.local/src/x265; git pull
    cd ~/.local/src/x265/build/linux
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    make -j9
    package-deb "x265-10bit" "1.6" "x265"
    make clean
    }

    function update-ffmpeg() {
    cd ~/.local/src/ffmpeg; git pull
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    make -j9
    package-deb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    make distclean
    }

    function update-bomi() {
    cd ~/.local/src/bomi; git pull
    ./download-libchardet
    ./build-libchardet
    sudo apt-fast install qt5-default qttools5-dev-tools lib{pulse,libasound2,jack}-dev \
    lib{dvdread,dvdnav,bluray,glib2.0,libva,vdpau,xcb-icccm4,xcb-screensaver0}-dev \
    lib{xcb-randr0,xcb-xtest0,systemd,cdio,cdio-cdda,cdio-paranoia,smbclient}-dev \
    lib{qt5svg5,qt5x11extras5,xv,bz2}-dev qt-quick1-5-dev qtdeclarative5-dev \
    qtdeclarative5-controls-plugin
    package-deb "bomi-git" "$(git rev-list --count HEAD)" "bomi"
    make distclean
    }

    sudo apt-fast update; sudo apt-fast dist-upgrade -y
    update-libass
    update-x265
    update-ffmpeg
    update-bomi ## Optional
  23. @mmstick mmstick created this gist May 28, 2015.
    42 changes: 42 additions & 0 deletions install.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    #!/bin/bash
    mkdir ~/.local/src

    function compile() {
    make -j9 CFLAGS='-march=native -O3 -pipe -fstack-protector -Wall' CXXFLAGS='-march=native -O3 -pipe -fstack-protector -Wall'
    }

    function package-deb() {
    sudo checkinstall --pkgname "$1" --pkgversion "$2" --provides "$3" -y
    }

    function download-x265-stable() {
    git clone https://github.com/videolan/x265
    }

    function download-ffmpeg-git() {
    git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
    }

    function compile-x265() {
    cd ~/.local/src/x265/build/linux
    [[ $(arch) == x86_64 ]] && LDFLAGS+=',-z,noexecstack'
    cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr ../../source -DHIGH_BIT_DEPTH=1
    compile
    package-deb "x265-10bit" "1.6" "x265"
    make clean
    }

    function compile-ffmpeg() {
    cd ~/.local/src/ffmpeg
    sudo apt-fast install -y libx264-dev libvpx-dev libtheora-dev libopus-dev libvorbis-dev libfdk-aac-dev libass-dev libx11-dev
    ./configure --prefix=/usr --enable-gpl --enable-nonfree --enable-libass --enable-libfreetype --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libx265 --enable-libx264 --enable-libvpx --enable-libtheora --enable-x11grab --extra-cflags="-march=native -O3" --extra-cxxflags="-march=native -O3"
    make -j9
    package-deb "ffmpeg-git" "$(git rev-list --count HEAD)" "ffmpeg"
    make distclean
    }

    cd ~/.local/src
    download-x265-stable
    download-ffmpeg-git
    compile-x265
    compile-ffmpeg
    33 changes: 33 additions & 0 deletions transcode-x264-hardware.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    #!/usr/bin/fish
    # Gets a list of all videos in the current directory and subdirectory.
    function get_video_list
    find * -type f -name \*.mkv
    end

    # Utilizes ffmpeg to transcode the current input video, $1, with Opus audio and
    # H.265 video. It receives a preset parameter, "$2", and a CRF parameter, "$3",
    # and will write the newly-transcoded videos to the transcoded directory.
    function transcode
    ffmpeg -i "$argv[1]" -c:a libopus -c:v libx264 -profile:v high -level 4.2 -crf "$argv[2]" (basename $argv[1] .mkv)_transcoded.mkv
    end

    # After the transcode is complete, it moves the files to another directory
    # for easy cleanup.
    function move_transcodes
    mv "$argv[1]" original
    mv (basename $argv[1] .mkv)_transcoded.mkv transcoded
    end

    # This will create two directories: transcoded and
    # original; then get a list of all videos and begin transcoding each video
    # one by one. After it finishes transcoding a video, it will
    function main
    mkdir transcoded original
    for video in (get_video_list)
    transcode "$video" "18"
    move_transcodes "$video"
    end
    end

    ## Start script
    main
    34 changes: 34 additions & 0 deletions transcode-x265.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    #!/usr/bin/fish
    # Gets a list of all videos in the current directory and subdirectory.
    function get_video_list
    find * -type f -name \*.mkv
    end

    # Utilizes ffmpeg to transcode the current input video, $1, with Opus audio and
    # H.265 video. It receives a preset parameter, "$2", and a CRF parameter, "$3",
    # and will write the newly-transcoded videos to the transcoded directory.
    function transcode
    ffmpeg -i "$argv[1]" -preset "$argv[2]" -c:a libopus -c:v libx265 \
    -x265-params "crf=$argv[3]:ref=6:subme=7:bframes=16" (basename $argv[1] .mkv)_transcoded.mkv
    end

    # After the transcode is complete, it moves the files to another directory
    # for easy cleanup.
    function move_transcodes
    mv "$argv[1]" original
    mv (basename $argv[1] .mkv)_transcoded.mkv transcoded
    end

    # This will create two directories: transcoded and
    # original; then get a list of all videos and begin transcoding each video
    # one by one. After it finishes transcoding a video, it will
    function main
    mkdir transcoded original
    for video in (get_video_list)
    transcode "$video" "veryslow" "18"
    move_transcodes "$video"
    end
    end

    ## Start script
    main