Skip to content

Commit 541f4f2

Browse files
committed
pkg: danctnix: ffmpeg-v4l2-request: new pkgbuild
1 parent 0829f78 commit 541f4f2

File tree

2 files changed

+269
-0
lines changed

2 files changed

+269
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
# Maintainer: Maxime Gauduin <[email protected]>
2+
# Contributor: Bartłomiej Piotrowski <[email protected]>
3+
# Contributor: Ionut Biru <[email protected]>
4+
# Contributor: Tom Newsom <[email protected]>
5+
# Contributor: Paul Mattal <[email protected]>
6+
7+
# ALARM: Kevin Mihelich <[email protected]>
8+
# - use -fPIC in host cflags for v7/v8 to fix print_options.c compile
9+
# - remove makedepends on ffnvcodec-headers, remove --enable-nvenc, --enable-nvdec
10+
# - remove depends on aom, remove --enable-libaom
11+
# - remove optdepends on intel-media-sdk, onevpl-intel-gpu
12+
# - remove depends on onevpl, remove --enable-libvpl
13+
# - remove depends on vmaf, remove --enable-vmaf
14+
# - remove depends on rav1e, remove --enable-librav1e
15+
# - remove depends on svt-av1, remove --enable-libsvtav1
16+
# - remove --enable-lto
17+
18+
pkgname=ffmpeg-v4l2-request
19+
pkgver=6.1.1
20+
pkgrel=8
21+
epoch=2
22+
pkgdesc='Complete solution to record, convert and stream audio and video'
23+
arch=(x86_64 armv7h aarch64)
24+
url=https://ffmpeg.org
25+
license=(GPL-3.0-only)
26+
depends=(
27+
alsa-lib
28+
bzip2
29+
cairo
30+
dav1d
31+
fontconfig
32+
freetype2
33+
fribidi
34+
glib2
35+
glibc
36+
gmp
37+
gnutls
38+
gsm
39+
harfbuzz
40+
jack
41+
lame
42+
libass
43+
libavc1394
44+
libbluray
45+
libbs2b
46+
libdrm
47+
libgl
48+
libiec61883
49+
libjxl
50+
libmodplug
51+
libopenmpt
52+
libplacebo
53+
libpulse
54+
libraw1394
55+
librsvg
56+
libsoxr
57+
libssh
58+
libtheora
59+
libva
60+
libvdpau
61+
libvorbis
62+
libvpx
63+
libwebp
64+
libx11
65+
libxcb
66+
libxext
67+
libxml2
68+
libxv
69+
ocl-icd
70+
opencore-amr
71+
openjpeg2
72+
opus
73+
rubberband
74+
sdl2
75+
snappy
76+
speex
77+
srt
78+
v4l-utils
79+
vapoursynth
80+
vid.stab
81+
vulkan-icd-loader
82+
x264
83+
x265
84+
xvidcore
85+
xz
86+
zimg
87+
zlib
88+
)
89+
makedepends=(
90+
amf-headers
91+
avisynthplus
92+
clang
93+
frei0r-plugins
94+
ladspa
95+
mesa
96+
nasm
97+
opencl-headers
98+
vulkan-headers
99+
)
100+
optdepends=(
101+
'avisynthplus: AviSynthPlus support'
102+
'frei0r-plugins: Frei0r video effects support'
103+
'ladspa: LADSPA filters'
104+
)
105+
provides=(
106+
libavcodec.so
107+
libavdevice.so
108+
libavfilter.so
109+
libavformat.so
110+
libavutil.so
111+
libpostproc.so
112+
libswresample.so
113+
libswscale.so
114+
)
115+
options=(
116+
debug
117+
)
118+
_commit=502d19c9564969538952051c2d395c714e41e567
119+
source=(
120+
https://github.com/Kwiboo/FFmpeg/archive/${_commit}.tar.gz
121+
https://github.com/FFmpeg/FFmpeg/commit/fef22c87ada4517441701e6e61e062c9f4399c8e.patch
122+
add-av_stream_get_first_dts-for-chromium.patch
123+
)
124+
b2sums=('82e42a6856c87ef4e33a9bec5dc00637ebdc81fa75daa0357fb6f03e85872ac7a52b699c0eaf25723b2a208d2006b094593c4eb8af613ea1d127dd32e541da9d'
125+
'76ec8ce681f1ba77753140df935634817e45da2e9015d06afa042d12186f34a140dfd4c757f03f38b76d993f01231f8093a48a2b367049ded59300fe39f3ed50'
126+
'555274228e09a233d92beb365d413ff5c718a782008075552cafb2130a3783cf976b51dfe4513c15777fb6e8397a34122d475080f2c4483e8feea5c0d878e6de')
127+
128+
prepare() {
129+
cd FFmpeg-${_commit}
130+
patch -Np1 -i ../add-av_stream_get_first_dts-for-chromium.patch # https://crbug.com/1251779
131+
# Fix build with latest vulkan headers
132+
patch -Np1 -i ../fef22c87ada4517441701e6e61e062c9f4399c8e.patch
133+
}
134+
135+
build() {
136+
cd FFmpeg-${_commit}
137+
[[ $CARCH == "armv7h" || $CARCH == "aarch64" ]] && CONFIG='--host-cflags="-fPIC"'
138+
139+
./configure \
140+
--prefix=/usr \
141+
--disable-debug \
142+
--disable-static \
143+
--disable-stripping \
144+
--enable-amf \
145+
--enable-avisynth \
146+
--enable-cuda-llvm \
147+
--enable-fontconfig \
148+
--enable-frei0r \
149+
--enable-gmp \
150+
--enable-gnutls \
151+
--enable-gpl \
152+
--enable-ladspa \
153+
--enable-libass \
154+
--enable-libbluray \
155+
--enable-libbs2b \
156+
--enable-libdav1d \
157+
--enable-libdrm \
158+
--enable-libfreetype \
159+
--enable-libfribidi \
160+
--enable-libgsm \
161+
--enable-libharfbuzz \
162+
--enable-libiec61883 \
163+
--enable-libjack \
164+
--enable-libjxl \
165+
--enable-libmodplug \
166+
--enable-libmp3lame \
167+
--enable-libopencore_amrnb \
168+
--enable-libopencore_amrwb \
169+
--enable-libopenjpeg \
170+
--enable-libopenmpt \
171+
--enable-libopus \
172+
--enable-libplacebo \
173+
--enable-libpulse \
174+
--enable-librsvg \
175+
--enable-librubberband \
176+
--enable-libsnappy \
177+
--enable-libsoxr \
178+
--enable-libspeex \
179+
--enable-libsrt \
180+
--enable-libssh \
181+
--enable-libtheora \
182+
--enable-libv4l2 \
183+
--enable-libvidstab \
184+
--enable-libvorbis \
185+
--enable-libvpx \
186+
--enable-libwebp \
187+
--enable-libx264 \
188+
--enable-libx265 \
189+
--enable-libxcb \
190+
--enable-libxml2 \
191+
--enable-libxvid \
192+
--enable-libzimg \
193+
--enable-opencl \
194+
--enable-opengl \
195+
--enable-shared \
196+
--enable-vapoursynth \
197+
--enable-version3 \
198+
--enable-vulkan $CONFIG \
199+
\
200+
--enable-libudev
201+
make
202+
make tools/qt-faststart
203+
make doc/ff{mpeg,play}.1
204+
}
205+
206+
package() {
207+
depends+=(
208+
libass.so
209+
libbluray.so
210+
libbs2b.so
211+
libdav1d.so
212+
libfreetype.so
213+
libharfbuzz.so
214+
libjxl.so
215+
libopenmpt.so
216+
libplacebo.so
217+
librsvg-2.so
218+
librubberband.so
219+
libva.so
220+
libva-drm.so
221+
libva-x11.so
222+
libvidstab.so
223+
libvorbisenc.so
224+
libvorbis.so
225+
libvpx.so
226+
libx264.so
227+
libx265.so
228+
libxvidcore.so
229+
libzimg.so
230+
)
231+
provides+=(ffmpeg)
232+
conflicts+=(ffmpeg)
233+
234+
make DESTDIR="${pkgdir}" -C FFmpeg-${_commit} install install-man
235+
install -Dm 755 FFmpeg-${_commit}/tools/qt-faststart "${pkgdir}"/usr/bin/
236+
}
237+
238+
# vim: ts=2 sw=2 et:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
diff '--color=auto' -rupN ffmpeg.orig/libavformat/avformat.h ffmpeg/libavformat/avformat.h
2+
--- ffmpeg.orig/libavformat/avformat.h 2022-08-19 17:42:47.323422603 +0200
3+
+++ ffmpeg/libavformat/avformat.h 2022-08-19 17:42:51.347130436 +0200
4+
@@ -1128,6 +1128,10 @@ struct AVCodecParserContext *av_stream_g
5+
*/
6+
int64_t av_stream_get_end_pts(const AVStream *st);
7+
8+
+// Chromium: We use the internal field first_dts vvv
9+
+int64_t av_stream_get_first_dts(const AVStream *st);
10+
+// Chromium: We use the internal field first_dts ^^^
11+
+
12+
#define AV_PROGRAM_RUNNING 1
13+
14+
/**
15+
diff '--color=auto' -rupN ffmpeg.orig/libavformat/mux_utils.c ffmpeg/libavformat/mux_utils.c
16+
--- ffmpeg.orig/libavformat/mux_utils.c 2022-08-19 17:42:47.346758108 +0200
17+
+++ ffmpeg/libavformat/mux_utils.c 2022-08-19 17:47:28.549589002 +0200
18+
@@ -37,6 +37,13 @@ int64_t av_stream_get_end_pts(const AVSt
19+
return AV_NOPTS_VALUE;
20+
}
21+
22+
+// Chromium: We use the internal field first_dts vvv
23+
+int64_t av_stream_get_first_dts(const AVStream *st)
24+
+{
25+
+ return cffstream(st)->first_dts;
26+
+}
27+
+// Chromium: We use the internal field first_dts ^^^
28+
+
29+
int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
30+
int std_compliance)
31+
{

0 commit comments

Comments
 (0)