Compare commits

...

2 Commits

Author SHA1 Message Date
Martchus 21c99d5768 WIP 2018-11-14 00:09:18 +01:00
Martchus 2d7d5a4d34 WIP: Add ffmpeg, mpv and omxplayer for Raspberry Pi 3 2018-11-13 18:03:52 +01:00
5 changed files with 366 additions and 0 deletions

115
ffmpeg/omx-rpi/PKGBUILD Normal file
View File

@ -0,0 +1,115 @@
# Maintainer: Martchus <martchus@gmx.net>
# Contributor: Ben Widawsky <ben@bwidawsk.net>
# Contributor: Rob McCathie <korrode at gmail>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Bartomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
# Contributor: Paul Mattal <paul@archlinux.org>
_name=ffmpeg
pkgname=ffmpeg-omx-rpi
pkgver=4.1
pkgrel=1
epoch=1
pkgdesc='Complete solution to record, convert and stream audio and video (with libfdk-aac support)'
arch=('armv6h' 'armv7h' 'aarch64')
url='https://ffmpeg.org/'
license=('GPL3' 'custom:libfdk-aac')
depends=(
'alsa-lib' 'aom' 'bzip2' 'fontconfig' 'fribidi' 'glibc' 'gmp' 'gnutls' 'gsm'
'jack' 'lame' 'libavc1394' 'libdrm' 'libiec61883' 'libmodplug'
'libomxil-bellagio' 'libpulse' 'libraw1394' 'libsoxr' 'libssh'
'libtheora' 'libvdpau' 'libwebp' 'libx11' 'libxcb' 'libxext' 'libxml2'
'libxv' 'opencore-amr' 'openjpeg2' 'opus' 'sdl2' 'speex' 'v4l-utils'
'xz' 'zlib'
'libass.so' 'libbluray.so' 'libfreetype.so' 'libva-drm.so' 'libva.so'
'libva-x11.so' 'libvidstab.so' 'libvorbisenc.so' 'libvorbis.so'
'libvpx.so' 'libx264.so' 'libx265.so' 'libxvidcore.so'
'libfdk-aac'
)
makedepends=('ffnvcodec-headers' 'git' 'ladspa' 'libvdpau' 'yasm')
optdepends=('ladspa: LADSPA filters')
provides=(
'libavcodec.so' 'libavdevice.so' 'libavfilter.so' 'libavformat.so'
'libavutil.so' 'libpostproc.so' 'libswresample.so' 'libswscale.so'
"ffmpeg=$pkgver"
)
conflicts=("$_name")
source=("git+https://git.ffmpeg.org/ffmpeg.git#tag=n${pkgver}")
sha256sums=('SKIP')
build() {
cd $_name
[[ $CARCH == "armv7h" || $CARCH == "aarch64" ]] && CONFIG='--host-cflags="-fPIC"'
./configure \
--prefix='/usr' \
--disable-debug \
--disable-static \
--disable-stripping \
--enable-fontconfig \
--enable-gmp \
--enable-gnutls \
--enable-gpl \
--enable-ladspa \
--enable-libaom \
--enable-libass \
--enable-libbluray \
--enable-libfreetype \
--enable-libfribidi \
--enable-libiec61883 \
--enable-libjack \
--enable-libgsm \
--enable-libmodplug \
--enable-libmp3lame \
--enable-libopencore_amrnb \
--enable-libopencore_amrwb \
--enable-libopenjpeg \
--enable-libopus \
--enable-libpulse \
--enable-libsoxr \
--enable-libspeex \
--enable-libssh \
--enable-libtheora \
--enable-libv4l2 \
--enable-libvidstab \
--enable-libvorbis \
--enable-libvpx \
--enable-libwebp \
--enable-libx264 \
--enable-libx265 \
--enable-libxcb \
--enable-libxml2 \
--enable-libxvid \
--enable-nvdec \
--enable-nvenc \
--enable-omx \
--enable-shared \
--enable-version3 \
\
--enable-libfdk_aac \
--enable-omx-rpi \
--disable-opencl \
--enable-nonfree
#--enable-mmal \
make V=1
make tools/qt-faststart
make doc/ff{mpeg,play}.1
cp /usr/share/licenses/libfdk-aac/NOTICE .
}
package() {
cd $_name
make DESTDIR="${pkgdir}" install install-man
install -Dm 755 tools/qt-faststart "${pkgdir}"/usr/bin/
install -d "$pkgdir/usr/share/licenses/$pkgname"
install -m 0644 NOTICE "$pkgdir/usr/share/licenses/$pkgname/NOTICE"
}
# vim: ts=2 sw=2 et:

69
mpv/rpi/PKGBUILD Normal file
View File

@ -0,0 +1,69 @@
# Maintainer: Martchus <martchus@gmx.net>
# Contributor: Christian Hesse
# Contributor: Bartłomiej Piotrowski
# Contributor: Eivind Uggedal
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
# you also find the URL of a binary repository.
_name=mpv
pkgname=mpv-rpi
epoch=1
pkgver=0.29.1
pkgrel=1
_waf_version=2.0.9
pkgdesc='a free, open source, and cross-platform media player'
arch=('armv6h' 'armv7h' 'aarch64')
# We link against libraries that are licensed GPLv3 explicitly, libsmbclient
# being one of these. So our package is GPLv3 only as well.
license=('GPL3')
url='https://mpv.io/'
depends=('desktop-file-utils' 'ffmpeg' 'hicolor-icon-theme' 'jack' 'lcms2'
'libarchive' 'libcaca' 'libcdio-paranoia' 'libdvdnav' 'libgl' 'libva'
'libxinerama' 'libxkbcommon' 'libxrandr' 'libxss' 'libxv' 'lua52'
'rubberband' 'smbclient' 'uchardet' 'vulkan-icd-loader' 'wayland'
'xdg-utils')
makedepends=('mesa' 'python-docutils' 'ladspa' 'wayland-protocols'
'ffnvcodec-headers' 'vulkan-headers')
optdepends=('youtube-dl: for video-sharing websites playback')
conflicts=("$_name")
provides=("$_name")
options=('!emptydirs')
source=("$_name-$pkgver.tar.gz::https://github.com/mpv-player/$_name/archive/v$pkgver.tar.gz"
"https://waf.io/waf-${_waf_version}")
sha256sums=('f9f9d461d1990f9728660b4ccb0e8cb5dce29ccaa6af567bec481b79291ca623'
'2a8e0816f023995e557f79ea8940d322bec18f286917c8f9a6fa2dc3875dfa48')
prepare() {
cd ${_name}-${pkgver}
install -m755 "${srcdir}"/waf-${_waf_version} waf
}
build() {
cd ${_name}-${pkgver}
./waf configure --prefix=/usr \
--confdir=/etc/mpv \
--enable-cdda \
--enable-dvb \
--enable-dvdnav \
--enable-libarchive \
--enable-libmpv-shared \
--enable-libsmbclient \
--enable-tv \
--enable-zsh-comp \
\
--enable-rpi
./waf build
}
package() {
cd ${_name}-${pkgver}
./waf install --destdir="$pkgdir"
install -m644 DOCS/{encoding.rst,tech-overview.txt} \
"$pkgdir"/usr/share/doc/mpv
}

View File

@ -0,0 +1,93 @@
From 26db8c18b7eb27db94a664eb5875748dcead262e Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Wed, 24 Sep 2014 08:47:14 -0600
Subject: [PATCH 1/2] alarm fixes
---
Makefile | 31 +++++++++----------------------
omxplayer.cpp | 4 ++--
2 files changed, 11 insertions(+), 24 deletions(-)
diff --git a/Makefile b/Makefile
index 5f4e414..cb836a5 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,9 @@ CFLAGS=-pipe -mfloat-abi=hard -mcpu=arm1176jzf-s -fomit-frame-pointer -mabi=aapc
CFLAGS+=-std=c++0x -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_POSIX -DTARGET_LINUX -fPIC -DPIC -D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CMAKE_CONFIG -D__VIDEOCORE4__ -U_FORTIFY_SOURCE -Wall -DHAVE_OMXLIB -DUSE_EXTERNAL_FFMPEG -DHAVE_LIBAVCODEC_AVCODEC_H -DHAVE_LIBAVUTIL_OPT_H -DHAVE_LIBAVUTIL_MEM_H -DHAVE_LIBAVUTIL_AVUTIL_H -DHAVE_LIBAVFORMAT_AVFORMAT_H -DHAVE_LIBAVFILTER_AVFILTER_H -DHAVE_LIBSWRESAMPLE_SWRESAMPLE_H -DOMX -DOMX_SKIP64BIT -ftree-vectorize -DUSE_EXTERNAL_OMX -DTARGET_RASPBERRY_PI -DUSE_EXTERNAL_LIBBCM_HOST
LDFLAGS=-L$(SDKSTAGE)/opt/vc/lib/
-LDFLAGS+=-L./ -Lffmpeg_compiled/usr/local/lib/ -lc -lbrcmGLESv2 -lbrcmEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound
+LDFLAGS+=-L./ -lc -lbrcmGLESv2 -lbrcmEGL -lbcm_host -lopenmaxil -lfreetype -lz -lasound
-INCLUDES+=-I./ -Ilinux -Iffmpeg_compiled/usr/local/include/ -I /usr/include/dbus-1.0 -I /usr/lib/arm-linux-gnueabihf/dbus-1.0/include -I/usr/include/freetype2 -isystem$(SDKSTAGE)/opt/vc/include -isystem$(SDKSTAGE)/opt/vc/include/interface/vcos/pthreads
+INCLUDES+=-I./ -Ilinux -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/freetype2 -I/opt/vc/include
DIST ?= omxplayer-dist
STRIP ?= strip
@@ -41,7 +41,7 @@ SRC= linux/XMemUtils.cpp \
OBJS+=$(filter %.o,$(SRC:.cpp=.o))
-all: dist
+all: omxplayer.bin
%.o: %.cpp
@rm -f $@
@@ -53,7 +53,7 @@ version:
bash gen_version.sh > version.h
omxplayer.bin: version $(OBJS)
- $(CXX) $(LDFLAGS) -o omxplayer.bin $(OBJS) -lvchiq_arm -lvchostif -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
+ $(CXX) -o omxplayer.bin $(OBJS) $(LDFLAGS) -lvchiq_arm -lvchostif -lvcos -ldbus-1 -lrt -lpthread -lavutil -lavcodec -lavformat -lswscale -lswresample -lpcre
$(STRIP) omxplayer.bin
help.h: README.md Makefile
@@ -76,25 +76,12 @@ clean:
@rm -rf $(DIST)
@rm -f omxplayer-dist.tar.gz
-ffmpeg:
- @rm -rf ffmpeg
- make -f Makefile.ffmpeg
- make -f Makefile.ffmpeg install
-
-dist: omxplayer.bin omxplayer.1
- mkdir -p $(DIST)/usr/lib/omxplayer
- mkdir -p $(DIST)/usr/bin
- mkdir -p $(DIST)/usr/share/doc/omxplayer
- mkdir -p $(DIST)/usr/share/man/man1
- cp omxplayer omxplayer.bin $(DIST)/usr/bin
- cp COPYING $(DIST)/usr/share/doc/omxplayer
- cp README.md $(DIST)/usr/share/doc/omxplayer/README
- cp omxplayer.1 $(DIST)/usr/share/man/man1
- cp -P ffmpeg_compiled/usr/local/lib/*.so* $(DIST)/usr/lib/omxplayer/
- cd $(DIST); tar -czf ../$(DIST).tgz *
-
install:
- cp -r $(DIST)/* /
+ install -d $(DESTDIR)/usr/bin
+ install -d $(DESTDIR)/usr/share/doc/omxplayer
+ install omxplayer $(DESTDIR)/usr/bin/
+ install omxplayer.bin $(DESTDIR)/usr/bin/
+ install README.md COPYING $(DESTDIR)/usr/share/doc/omxplayer/
uninstall:
rm -rf /usr/bin/omxplayer
diff --git a/omxplayer.cpp b/omxplayer.cpp
index 8fe7bdd..d04cab4 100644
--- a/omxplayer.cpp
+++ b/omxplayer.cpp
@@ -83,8 +83,8 @@ bool m_osd = true;
bool m_no_keys = false;
std::string m_external_subtitles_path;
bool m_has_external_subtitles = false;
-std::string m_font_path = "/usr/share/fonts/truetype/freefont/FreeSans.ttf";
-std::string m_italic_font_path = "/usr/share/fonts/truetype/freefont/FreeSansOblique.ttf";
+std::string m_font_path = "/usr/share/fonts/TTF/FreeSans.ttf";
+std::string m_italic_font_path = "/usr/share/fonts/TTF/FreeSansOblique.ttf";
std::string m_dbus_name = "org.mpris.MediaPlayer2.omxplayer";
bool m_asked_for_font = false;
bool m_asked_for_italic_font = false;
--
2.18.0

View File

@ -0,0 +1,39 @@
From 5359a817574449563922cefedf402447b23bd5e6 Mon Sep 17 00:00:00 2001
From: Kevin Mihelich <kevin@archlinuxarm.org>
Date: Thu, 4 Oct 2018 06:55:23 -0600
Subject: [PATCH 2/2] fix keyboard input
From: https://github.com/popcornmix/omxplayer/issues/649
---
Keyboard.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Keyboard.cpp b/Keyboard.cpp
index d38a102..d940421 100644
--- a/Keyboard.cpp
+++ b/Keyboard.cpp
@@ -23,9 +23,11 @@ Keyboard::Keyboard()
new_termios = orig_termios;
new_termios.c_lflag &= ~(ICANON | ECHO | ECHOCTL | ECHONL);
new_termios.c_cflag |= HUPCL;
- new_termios.c_cc[VMIN] = 0;
-
+ new_termios.c_cc[VMIN] = 1;
tcsetattr(STDIN_FILENO, TCSANOW, &new_termios);
+
+ orig_fl = fcntl(STDIN_FILENO, F_GETFL);
+ fcntl(STDIN_FILENO, F_SETFL, FNDELAY);
}
else
{
@@ -67,6 +69,7 @@ void Keyboard::restore_term()
if (isatty(STDIN_FILENO))
{
tcsetattr(STDIN_FILENO, TCSANOW, &orig_termios);
+ fcntl(STDIN_FILENO, F_SETFL, orig_fl);
}
else
{
--
2.18.0

50
omxplayer/git/PKGBUILD Normal file
View File

@ -0,0 +1,50 @@
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>
# Contributor: Huulivoide <gmail.com: jesse.jaara>
# Contributor: Jonathan Hudson <daria.co.uk: jh+arch>
buildarch=20
pkgname=omxplayer-git
pkgver=517.a70e9b4
pkgrel=1
pkgdesc="Command line media player for the RaspberryPi"
arch=('armv6h' 'armv7h' 'aarch64')
url="https://github.com/popcornmix/omxplayer"
license=(GPL2)
depends=('ffmpeg' 'fbset')
#depends=('ffmpeg' 'raspberrypi-firmware' 'fbset')
makedepends=('git' 'boost')
optdepends=('ttf-freefont')
provides=(omxplayer)
conflicts=('omxplayer' 'omxplayer-bin')
source=('git://github.com/popcornmix/omxplayer.git'
'0001-alarm-fixes.patch'
'0002-fix-keyboard-input.patch')
md5sums=('SKIP'
'fe4efaa1cf49570a65c51cef319fdf8b'
'28cb317db75a866b22484ac16eb3152a')
pkgver() {
cd omxplayer
echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}
prepare() {
cd "${srcdir}/omxplayer"
git apply ../0001-alarm-fixes.patch
git apply ../0002-fix-keyboard-input.patch
}
build() {
cd "${srcdir}/omxplayer"
[[ $CARCH == "armv7h" ]] && CFLAGS=`echo $CFLAGS | sed -e 's/vfpv3-d16/neon/'` && CXXFLAGS="$CFLAGS"
make
}
package() {
cd "${srcdir}/omxplayer"
make DESTDIR="${pkgdir}" install
}