Advertisement
Guest User

FFMpeg Setup Script

a guest
Jan 20th, 2020
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. #!/bin/bash
  2. # Compile and install (or install via Apt) FFmpeg Codecs
  3. # Compile and install FFmpeg suite
  4.  
  5. echo "Begining Installation of FFmpeg Suite"
  6.  
  7. #Update APT Repository
  8. echo "Updating the APT repository information"
  9. #apt-get update
  10.  
  11. #Create Working Directories
  12. echo "Setting up working directories to be used during the installation and build process"
  13. cd ~
  14. mkdir ~/ffmpeg_sources
  15. mkdir ~/ffmpeg_build
  16.  
  17. #Build Tools
  18. echo "Installing various tools and packages, including audio-video codecs, required for building FFmpeg"
  19. apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev \
  20. libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
  21. libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev
  22.  
  23. #YASM Assembler
  24. echo "Installing the YASM Assembler"
  25. #apt-get install -y yasm
  26.  
  27. echo "Compiling and Installing FFmpeg Codecs"
  28.  
  29. #x264 Codec
  30. echo "X264 Codec"
  31. cd ~/ffmpeg_sources
  32. git clone https://code.videolan.org/videolan/x264.git
  33. cd x264
  34. ./configure --host=arm-unknown-linux-gnueabi --enable-shared --disable-opencl --enable-omx --enable-omx-rpi
  35. make -j4
  36. make uninstall
  37. make install
  38. make clean
  39. make distclean
  40.  
  41. echo "Libfdk-aac Codec"
  42. cd ~/ffmpeg_sources
  43. wget -O fdk-aac.tar.gz https://github.com/mstorsjo/fdk-aac/tarball/master
  44. tar xzvf fdk-aac.tar.gz
  45. cd mstorsjo-fdk-aac*
  46. autoreconf -fiv
  47. ./configure --enable-shared
  48. make -j2
  49. make uninstall
  50. make install
  51. make clean
  52. make distclean
  53.  
  54. #Libmp3lame Codec
  55. echo "Libmp3lame Codec"
  56. apt-get install -y libmp3lame-dev
  57.  
  58. #Libopus Codec
  59. echo "Libopus Codec"
  60. apt-get install -y libopus-dev
  61.  
  62. #Libvpx Codec
  63. echo "Libvpx Codec"
  64. cd ~/ffmpeg_sources
  65. git clone https://github.com/webmproject/libvpx.git
  66. cd libvpx
  67. PATH="$HOME/bin:$PATH" ./configure --enable-shared --disable-examples --disable-unit-tests
  68. PATH="$HOME/bin:$PATH" make -j4
  69. make uninstall
  70. make install
  71. make clean
  72. make distclean
  73.  
  74. # FFmpeg Suite
  75. echo "Compiling and installing the FFmpeg Suite"
  76. cd ~/ffmpeg_sources
  77. wget http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2
  78. tar xjvf ffmpeg-snapshot.tar.bz2
  79. cd ffmpeg
  80.  
  81. PATH="$HOME/bin:$PATH" ./configure \
  82. --pkg-config-flags="--static" \
  83. --extra-cflags="-fPIC -I$HOME/ffmpeg_build/include" \
  84. --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  85. --enable-gpl \
  86. --enable-libass \
  87. --enable-libfdk-aac \
  88. --enable-libfreetype \
  89. --enable-libmp3lame \
  90. --enable-libopus \
  91. --enable-libtheora \
  92. --enable-libvorbis \
  93. --enable-libvpx \
  94. --enable-libx264 \
  95. --enable-omx \
  96. --enable-mmal \
  97. --enable-omx-rpi \
  98. --enable-nonfree \
  99. --enable-pic \
  100. --extra-ldexeflags=-pie \
  101. --enable-shared
  102.  
  103. PATH="$HOME/bin:$PATH" make -j4
  104. make uninstall
  105. make install
  106. make distclean
  107. hash -r
  108.  
  109. #Update Shared Library Cache
  110. echo "Updating Shared Library Cache"
  111. ldconfig
  112.  
  113. echo "FFmpeg and Codec Installation Complete"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement