How to compile the latest development version of smplayer on Ubuntu?

Updated on 10 July 2017
Batch script to compile and install latest development version of smplayer:

#!/bin/bash
#Install dependencies
sudo apt build-dep smplayer
sudo apt-get install libqt4-dev zlib1g-dev fakeroot build-essential devscripts debhelper g++ mplayer2
echo Checking out sources
mkdir ~/src
cd ~/src
echo Removing old debs...
rm *deb
svn co https://subversion.assembla.com/svn/smplayer/smplayer/trunk/ smplayer
svn co https://subversion.assembla.com/svn/smplayer/smplayer-skins/trunk/ smplayer-skins
svn co https://subversion.assembla.com/svn/smplayer/smplayer-themes/trunk/ smplayer-themes
echo Compiling everything...
cd smplayer
./create_deb.sh
cd ..
cd smplayer-skins
./create_deb.sh
cd ..
cd smplayer-themes
./create_deb.sh
cd ..
echo Installing everything as root
sudo dpkg -i smplayer*deb

Updated on 2 May, 2017
Compile the latest smplayer on Ubuntu(New):
We’ll be building smplayer, smplayer-themes, and smplayer-skins.
Install dependencies:

sudo apt build-dep smplayer
sudo apt-get install libqt4-dev zlib1g-dev fakeroot build-essential devscripts debhelper g++ mplayer2

Get source from the svn and build each package:

mkdir ~/src
cd ~/src
svn co https://subversion.assembla.com/svn/smplayer/smplayer/trunk/ smplayer
cd smplayer
./create_deb.sh
svn co https://subversion.assembla.com/svn/smplayer/smplayer-skins/trunk/ smplayer-skins
cd smplayer-skins
./create_deb.sh
cd ..
svn co https://subversion.assembla.com/svn/smplayer/smplayer-themes/trunk/ smplayer-themes
cd smplayer-themes
./create_deb.sh
cd ..
sudo dpkg -i smplayer*deb

Hurray, we’ve successfully built and installed the latest dev version of smplayer.

To update to latest version:
smplayer will notify new update releases. Once updated, we can compile new one:

svn update
./create_deb.sh
sudo dpkg -i ../smplayer_17.5.0_amd64.deb

Note: I found that on playing, smplayer did not have any sound. I had to change my default audio device to pulse.
Options:Preferences:
Audio>Output driver: pulse

Older post:
First, download the latest smplayer tarball from the official site.

Eg:

wget http://downloads.sourceforge.net/project/smplayer/SMPlayer/16.9.0/smplayer-16.9.0.tar.bz2

Extract it:

tar jxf smplayer*bz2
cd smplayer*

Install essential prerequisites for building:

sudo apt-get install libqt4-dev zlib1g-dev fakeroot build-essential devscripts debhelper g++ mplayer2
sudo apt-get -f install

Now create the .deb package:

./create_deb.sh

Install the package:

sudo dpkg -i ../smplayer_16.9.0_amd64.deb

Alternately download the .deb after installing the prerequisites:

http://sourceforge.net/projects/smplayer/files/Unstable/ubuntu/

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

How to compile latest mplayer on Ubuntu?

echo Installing some essential packages.. && \
sudo apt-get -y install build-essential subversion checkinstall git-core \
docbook-xml docbook-xsl xsltproc libxml2-utils && \
mkdir -pv $HOME/mplayer_build && \
cd $HOME/mplayer_build && \
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \
tar xvf yasm-1.3.0.tar.gz && cd yasm-1.3.0 && \
./configure && make -j 2 && \
mkdir -vp doc-pak && \
cp -v Artistic.txt AUTHORS COPYING doc-pak && \
sudo checkinstall --pakdir "$HOME/mplayer_build" --backup=no --deldoc=yes \
                  --pkgname yasm --pkgversion "1.2.0" --fstrans=no \
                  --deldesc=yes --delspec=yes --default && \
make distclean && \
echo Installing some dev packages.. && \
echo sudo apt-get -y install libaa1-dev libasound2-dev libcaca-dev libcdparanoia-dev libdca-dev libdirectfb-dev libenca-dev libesd0-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgif-dev libgl1-mesa-dev libjack-jackd2-dev libopenal1 libpulse-dev libsdl1.2-dev libvdpau-dev libxinerama-dev libxv-dev libxvmc-dev libxxf86dga-dev libxxf86vm-dev librtmp-dev libsctp-dev libass-dev libfaac-dev libsmbclient-dev libtheora-dev libogg-dev libxvidcore-dev libspeex-dev libvpx-dev libschroedinger-dev libdv4-dev libopencore-amrnb-dev libopencore-amrwb-dev libmp3lame-dev liblivemedia-dev libtwolame-dev libmad0-dev libgsm1-dev libbs2b-dev liblzo2-dev ladspa-sdk libopenjpeg-dev libfaad-dev libmpg123-dev libopus-dev libbluray-dev libaacs-dev && \
echo && \
sudo apt-get -y install libaa1-dev libasound2-dev libcaca-dev libcdparanoia-dev libdca-dev libdirectfb-dev libenca-dev libesd0-dev libfontconfig1-dev libfreetype6-dev libfribidi-dev libgif-dev libgl1-mesa-dev libjack-jackd2-dev libopenal1 libpulse-dev libsdl1.2-dev libvdpau-dev libxinerama-dev libxv-dev libxvmc-dev libxxf86dga-dev libxxf86vm-dev librtmp-dev libsctp-dev libass-dev libfaac-dev libsmbclient-dev libtheora-dev libogg-dev libxvidcore-dev libspeex-dev libvpx-dev libschroedinger-dev libdv4-dev libopencore-amrnb-dev libopencore-amrwb-dev libmp3lame-dev liblivemedia-dev libtwolame-dev libmad0-dev libgsm1-dev libbs2b-dev liblzo2-dev ladspa-sdk libopenjpeg-dev libfaad-dev libmpg123-dev libopus-dev libbluray-dev libaacs-dev && \
cd $HOME/mplayer_build && \
sudo mkdir -pv /usr/local/lib/codecs && \
if [ "$(uname -m)" = "x86_64" ]; then
 wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
 tar xjvf essential-amd64-20071007.tar.bz2
 sudo cp -v essential-amd64-20071007/* /usr/local/lib/codecs
else
 wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20110131.tar.bz2
 tar xjvf all-20110131.tar.bz2
 sudo cp -v all-20110131/* /usr/local/lib/codecs
fi
if [ "$(uname -m)" = "x86_64" ]; then
  ARCHOPTS="--enable-pic"
 else
  ARCHOPTS=""
fi && \
cd $HOME/mplayer_build && \
git clone git://git.videolan.org/x264.git --depth 1 && \
cd x264 && \
./configure --prefix=$HOME/mplayer_build/mplayer_deps/usr \
            --enable-static --disable-cli $ARCHOPTS && \
make && make install && \
echo Compiling mplayer...
cd $HOME/mplayer_build && \
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer && \
cd mplayer && \
PKG_CONFIG_PATH="$HOME/mplayer_build/mplayer_deps/usr/lib/pkgconfig" \
./configure \
           --extra-cflags="-I$HOME/mplayer_build/mplayer_deps/usr/include" \
           --extra-ldflags="-L$HOME/mplayer_build/mplayer_deps/usr/lib" \
           --confdir=/etc/mplayer \
           --codecsdir=/usr/local/lib/codecs && \
make -j 2 && make html-chunked && \
mkdir -vp doc-pak && \
cp -v DOCS/HTML/*/* AUTHORS Changelog LICENSE README doc-pak && \
sudo checkinstall -D --install=yes --fstrans=no --pakdir "$HOME/mplayer_build" \
   --pkgname mplayer --backup=no --deldoc=yes --deldesc=yes --delspec=yes --default \
   --pkgversion "2:1.0~svn$(LC_ALL=C svn info 2> /dev/null | \
     grep Revision | cut -d' ' -f2)" --provides "mplayer,mencoder" && \
make distclean && sudo ldconfig

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Cut videos in Linux with avidemux

avidemux is a program that offers a GUI to cut videos on Linux. To install it, you need to either have the readymade .deb for your distro of Ubuntu, or compile it from source yourself. This post tells you how to compile and install avidemux for Ubuntu 16.10 (and other versions)

You need to first compile and install avidemux:

Download it from here, extract it.

tar xf avidemux_2.6.12.tar.gz
cd avidemux_2.6.12

Install all dependencies:

sudo apt-get install gcc g++ make cmake pkg-config libpng12-dev fakeroot yasm libsqlite3-dev  build-essential qttools5-dev-tools qtbase5-dev libaften-dev libmp3lame-dev libx264-dev  libfaad-dev libfaac-dev libqt4-dev

Compile and install:

bash bootStrap.bash --deb

Now install the compiled debs:

sudo dpkg -i debs/*deb

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Cross compile Bash for Android (Updated for Bash 4.4) with download links

Latest instructions for bash 4.4 and arm64 device architecture:
Step 1: Get and prepare the environment and toolchain:

mkdir ~/aarch64-toolchain/
wget http://releases.linaro.org/components/toolchain/binaries/latest-6/aarch64-linux-gnu/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz
tar xf gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu.tar.xz
export PATH=$PATH:~/aarch64-toolchain/gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu/bin

Next get the bash source and build:

mkdir bashsrc
cd bashsrc
wget http://ftp.gnu.org/gnu/bash/bash-4.4.tar.gz

Get latest from http://ftp.gnu.org/gnu/bash/?C=M;O=D

tar xf bash-4.4.tar.gz
cd bash-4.4
mkdir /root/bashstatic
./configure --prefix=/root/bashstatic --host=aarch64-linux-gnu --enable-static-link --without-bash-malloc --enable-largefile --enable-alias --enable-history
export CFLAGS="-static"
make

We can also modify the line (add -static to the end) to read:
CFLAGS = -g -O2 -Wno-parentheses -Wno-format-security -static

Test the file to see whether it is ARM x64:

~/aarch64-toolchain/bash/bash-4.4 $file bash
bash: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, for GNU/Linux 3.7.0, BuildID[sha1]=3e2a4fc358a13f74714907c7b454a9024675dbff, not stripped
[/bash]

Download “bash 4.4 for arm64” bash.zip – Downloaded 24 times – 4 MB

Older post:
Step 1: Downloading and installing the toolchain

This is the difficult step. Once this is done, usually compiling is a no-brainer.

The following steps use the latest Codesourcery compiler and worked for bash 4.3 on Debian squeeze host.

To get the latest Codesourcery toolchain, Visit the Codesourcery home at http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ and under “ARM Processors”, click on “Download the GNU/Linux release”, enter your user details. The download link will be mailed to your email address in a couple of seconds.

Clicking on the link in the email will take you to a page with a list of releases and a link to the one you chose. For me, it was https://sourcery.mentor.com/GNUToolchain/release2795. Clicking on it will give you the following options: IA32 GNU/Linux Installer, IA32 Windows Installer and advanced options. Click on IA32 GNU/Linux Installer to download the bin file.

Now, you need to install certain dependencies for the toolchain, and the toolchain itself:

apt-get install ia32-libs ia32-libs-gtk
wget https://sourcery.mentor.com/GNUToolchain/kbattach150/getlibs-all.deb
sudo dpkg -i getlibs-all.deb
getlibs -p xulrunner-1.9.2
wget https://sourcery.mentor.com/GNUToolchain/package12815/public/arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.bin
/bin/sh arm-2014.05-29-arm-none-linux-gnueabi.bin -console

Step 2: Setup the environment

Now you need to setup your environment to have certain environmental variables for cross compiling and pointing to the toolchain path. You dont want to use your system compiler to compile these files do you (those files cant be run on your phone/tablet)?

export CROSS_COMPILE="/root/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-gcc"
export PATH=/root/MentorGraphics/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin:$PATH

Step 3: Getting and preparing the source code
Now you will need to download the latest bash source code, extract it.

cd ~/
mkdir bashsrc
cd bashsrc
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
tar -xvvf bash-4.3.tar.gz

Step 4: Compiling
You will now compile and then ‘make’ the binaries.

mkdir /root/bashstatic
cd bash-4.3
./configure --prefix=/root/bashstatic --host=arm-none-linux-gnueabi --enable-static-link --without-bash-malloc --enable-largefile --enable-alias --enable-history

You will need to enable a “-static” flag to compile a static bash.
First see where the line CFLAGS comes in:
grep -in ‘CFLAGS’ Makefile
emacs Makefile

Edit Makefile so that CFLAGS reads like this:

CFLAGS = -g -O2 -static[/code]

Now you can make and install the binaries.
make install

Test with `file /root/bashstatic/bin/bash`[/bash]

Attached:
bash:

Download “bash” bash.4.3.0(1)-release_arm-none-linux-gnueabi.zip – Downloaded 309 times – 1 MB


busybox:

Download “busybox” busybox.1.23.0.zip – Downloaded 162 times – 1 MB


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

How to compile avconv from source in Linux

ffmpeg is apparently outdated to do this. Get libav from its git:

Compiling from source
Make sure you have compilers installed:

apt-get update && apt-get install build-essential

Download latest libav from its Git:

git clone git://git.libav.org/libav.git

Download, compile and install yasm:

wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xf yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure
make && make install
cd ..

Download x264 codec and compile it:
git clone git://git.videolan.org/x264.git x264
cd x264
./configure –enable-static
make && make install

Now compile libav

cd libav
./configure --enable-gpl --enable-nonfree
make && make install

Update: The above compiles avconv without x264 support. When I tried to compile x264, I found a compile error.

Alternate method: Installation from repo:

apt-get install libav-tools
apt-get install libavcodec-extra-53
apt-get install libx264-dev
Convert a .wmv file to .avi on the linux command line

Converting wmv to mp4:

avconv -i 'myvid.wmv' -f mp4 -acodec mp2 'myvid.mp4'

Another command:

avconv -i myfile.wmv -strict experimental myfile.mp4

Or:

avconv -i myfile.wmv -c:v libx264 -c:a copy 'myvid.mp4'

You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

Easier .gitignore file generation

You know when you start off building a kernel after creating a default .gitignore file containg list of object files and other temp files to be ignored, and at the end of a compilation, when you run a “git status”, you get a long list of new files that arent necessary to be included in the git. Manually adding them without wildcards is a headache. If you do add them with wildcards, you may potentially have conflicts with essential source scripts.

In this case, you can use the list output by git to your advantage.

You can just pipe the “git status” output to a file, and use it to add to your .gitignore.

Eg:

git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   .gitignore
#       modified:   include/config/kernel.release
#       modified:   include/generated/compile.h
#       modified:   include/generated/utsrelease.h
#       modified:   scripts/basic/fixdep
#       modified:   scripts/conmakehash
#       modified:   scripts/kallsyms
#       modified:   scripts/kconfig/conf
#       modified:   scripts/mod/elfconfig.h
#       modified:   scripts/mod/mk_elfconfig
#       modified:   scripts/mod/modpost
#       modified:   scripts/recordmcount
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       ..tmp_vmlinux1.cmd
#       ..tmp_vmlinux2.cmd
#       .missing-syscalls.d
#       .tmp_System.map
#       .tmp_kallsyms1.S
#       .tmp_kallsyms2.S
#       .tmp_versions/
#       .tmp_vmlinux1
#       .tmp_vmlinux2
#       .vmlinux.cmd
#       System.map
#       arch/arm/boot/.Image.cmd
#       arch/arm/boot/.zImage.cmd
#       arch/arm/boot/compressed/.piggy.lzma.cmd
#       arch/arm/boot/compressed/.vmlinux.cmd
#       arch/arm/boot/compressed/lib1funcs.S
#       arch/arm/boot/compressed/piggy.lzma
#       arch/arm/boot/compressed/vmlinux.lds
#       arch/arm/common/modules.builtin

Capture it to a file pipe.

git status > ../unnecessary.txt
cat ../unnecessary.txt | awk '{for(i=3;i<=NF;++i)print $i}'

 

 

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.

HOW TO Compile and install the latest smplayer on Debian

Note: This post is old. Refer to this post for updated instructions (2017).
The version of smplayer in the original Debian repos is too old. This is how you can compile the latest smplayer from sources:

Download the latest source package here

Extract it:

tar -jxvvf smplayer-0.8.2.1.tar.bz2

Install necessary packages as root.

apt-get install libqt4-dev zlib1g-dev fakeroot build-essential devscripts debhelper g++

Now compile into a debian .deb package:

cd smplayer-0.8.2.1
./create_deb.sh
su
dpkg -i ../smplayer_0.8.2.1_i386.deb

 


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.