'xorg-fonts-misc' 'ttf-dejavu' 'inkscape' 'dvdauthor' 'udftools' )
makedepends=( 'autoconf' 'automake' 'yasm' 'nasm' 'cmake' 'libtool'
- 'libxml2' 'perl-xml-libxml' 'perl-xml-parser'
+ 'libxml2' 'perl-xml-libxml' 'perl-xml-parser' 'meson'
'xorg-mkfontdir' 'xorg-mkfontscale' )
conflicts=()
libsndfile-devel libtheora-devel linux-firmware ivtv-firmware \
libvorbis-devel texinfo xz-devel lzma-devel cmake udftools git \
autoconf automake rpm-build jbigkit-devel libvdpau-devel libva-devel \
- alsa-lib-devel gtk2-devel
+ alsa-lib-devel gtk2-devel meson
yasm=yasm-1.3.0-3.fc24.x86_64.rpm
release=http://archives.fedoraproject.org/pub/fedora/linux/releases/24
url=$release/Everything/x86_64/os/Packages/y/$yasm
ivtv-firmware libvorbis-devel texinfo xz-devel lzma-devel cmake git \
ctags patch gcc-c++ perl-XML-XPath libtiff-devel python dvdauthor \
gettext-devel inkscape udftools autoconf automake numactl-devel \
- jbigkit-devel libvdpau-devel libva-devel gtk2-devel mesa-vdpau-drivers
+ jbigkit-devel libvdpau-devel libva-devel gtk2-devel mesa-vdpau-drivers \
+ meson
;;
"suse" | "leap")
zypper -n install nasm gcc gcc-c++ zlib-devel texinfo libpng16-devel \
ilmbase-devel fftw3-devel libsndfile-devel libtheora-devel flac-devel \
libtiff-devel inkscape cmake patch libnuma-devel lzma-devel udftools git \
yasm autoconf automake rpm-build libjbig-devel libvdpau-devel libva-devel \
- gtk2-devel libusb-1_0-devel
+ gtk2-devel libusb-1_0-devel meson
if [ ! -f /usr/lib64/libtermcap.so ]; then
ln -s libtermcap.so.2 /usr/lib64/libtermcap.so
fi
fonts-dejavu libopenexr-dev festival libfftw3-dev gdb libusb-1.0-0-dev \
libdc1394-22-dev libflac-dev libjbig-dev libvdpau-dev libva-dev \
inkscape libsndfile1-dev libtheora-dev cmake udftools libxml2-utils git \
- autoconf automake debhelper libgtk2.0-dev
+ autoconf automake debhelper libgtk2.0-dev meson
;;
#"ub16-10")
# apt-get -y install libx264-dev libx265-dev libvpx-dev libmjpegtools-dev
fonts-dejavu libopenexr-dev libavc1394-dev festival-dev fftw3-dev gdb \
libdc1394-22-dev libiec61883-dev libflac-dev libjbig-dev libusb-1.0-0-dev \
libvdpau-dev libva-dev libsndfile1-dev libtheora-dev cmake udftools \
- libxml2-utils git inkscape autoconf automake debhelper libgtk2.0-dev
+ libxml2-utils git inkscape autoconf automake debhelper libgtk2.0-dev \
+ meson
;;
*)
echo "unknown os: $dir"
BuildRequires: gtk2-devel
BuildRequires: libva-devel
BuildRequires: libvdpau-devel
+BuildRequires: meson
%{?rhat:BuildRequires: alsa-lib-devel}
%{?rhat:BuildRequires: bzip2-devel}
%{?rhat:BuildRequires: xorg-x11-fonts-cyrillic}
libpng-dev, libtool, libusb-1.0-0-dev, libva-dev, libvdpau-dev,
libxft-dev, libxinerama-dev, libxml2-utils, libxv-dev,
libz-dev, linux-firmware, nasm, texinfo, ttf-bitstream-vera,
- udftools, xfonts-100dpi, xfonts-75dpi, yasm
+ udftools, xfonts-100dpi, xfonts-75dpi, yasm, meson
Package: cin
Depends: ${misc:Depends}
}
while( ret >= 0 && st != 0 && !reading ) {
AVCodecID codec_id = st->codecpar->codec_id;
- AVCodec *decoder = avcodec_find_decoder(codec_id);
+ AVCodec *decoder = 0;
+ if( is_video() ) {
+ if( ffmpeg->opt_video_decoder )
+ decoder = avcodec_find_decoder_by_name(ffmpeg->opt_video_decoder);
+ else
+ ffmpeg->video_codec_remaps.update(codec_id, decoder);
+ }
+ else if( is_audio() ) {
+ if( ffmpeg->opt_audio_decoder )
+ decoder = avcodec_find_decoder_by_name(ffmpeg->opt_audio_decoder);
+ else
+ ffmpeg->audio_codec_remaps.update(codec_id, decoder);
+ }
+ if( !decoder )
+ decoder = avcodec_find_decoder(codec_id);
avctx = avcodec_alloc_context3(decoder);
if( !avctx ) {
eprintf(_("cant allocate codec context\n"));
opt_video_filter = 0;
opt_audio_filter = 0;
opt_hw_dev = 0;
+ opt_video_decoder = 0;
+ opt_audio_decoder = 0;
fflags = 0;
char option_path[BCTEXTLEN];
set_option_path(option_path, "%s", "ffmpeg.opts");
return ret;
}
+FFCodecRemap::FFCodecRemap()
+{
+ old_codec = 0;
+ new_codec = 0;
+}
+FFCodecRemap::~FFCodecRemap()
+{
+ delete [] old_codec;
+ delete [] new_codec;
+}
+
+int FFCodecRemaps::add(const char *val)
+{
+ char old_codec[BCSTRLEN], new_codec[BCSTRLEN];
+ if( sscanf(val, " %63[a-zA-z0-9_-] = %63[a-z0-9_-]",
+ &old_codec[0], &new_codec[0]) != 2 ) return 1;
+ FFCodecRemap &remap = append();
+ remap.old_codec = cstrdup(old_codec);
+ remap.new_codec = cstrdup(new_codec);
+ return 0;
+}
+
+
+int FFCodecRemaps::update(AVCodecID &codec_id, AVCodec *&decoder)
+{
+ AVCodec *codec = avcodec_find_decoder(codec_id);
+ if( !codec ) return -1;
+ const char *name = codec->name;
+ FFCodecRemaps &map = *this;
+ int k = map.size();
+ while( --k >= 0 && strcmp(map[k].old_codec, name) );
+ if( k < 0 ) return 1;
+ const char *new_codec = map[k].new_codec;
+ codec = avcodec_find_decoder_by_name(new_codec);
+ if( !codec ) return -1;
+ decoder = codec;
+ return 0;
+}
+
int FFMPEG::read_options(FILE *fp, const char *options, AVDictionary *&opts)
{
int ret = 0, no = 0;
if( !ret ) {
if( !strcmp(key, "duration") )
opt_duration = strtod(val, 0);
+ else if( !strcmp(key, "video_decoder") )
+ opt_video_decoder = cstrdup(val);
+ else if( !strcmp(key, "audio_decoder") )
+ opt_audio_decoder = cstrdup(val);
+ else if( !strcmp(key, "remap_video_decoder") )
+ video_codec_remaps.add(val);
+ else if( !strcmp(key, "remap_audio_decoder") )
+ audio_codec_remaps.add(val);
else if( !strcmp(key, "video_filter") )
opt_video_filter = cstrdup(val);
else if( !strcmp(key, "audio_filter") )
int top_field_first;
};
+class FFCodecRemap
+{
+public:
+ FFCodecRemap();
+ ~FFCodecRemap();
+ const char *old_codec, *new_codec;
+};
+
+class FFCodecRemaps : public ArrayList<FFCodecRemap>
+{
+public:
+ FFCodecRemaps() {}
+ int add(const char *val);
+ int update(AVCodecID &codec_id, AVCodec *&decoder);
+};
+
class FFMPEG : public Thread {
public:
static Mutex fflock;
char *opt_video_filter;
char *opt_audio_filter;
char *opt_hw_dev;
+ char *opt_video_decoder;
+ char *opt_audio_decoder;
+ FFCodecRemaps video_codec_remaps;
+ FFCodecRemaps audio_codec_remaps;
char file_format[BCTEXTLEN];
int fflags;
[ usr/local/lib*/libaom*.a ],
[ usr/local/include ])
+PKG_3RD([dav1d],[auto],
+ [dav1d-0.4.0],
+ [ usr/local/lib*/libdav1d*.a ],
+ [ usr/local/include ])
+
PKG_3RD([libwebp],[auto],
[libwebp-1.0.2],
[ usr/local/lib*/libwebp*.a ],
CHECK_HEADERS([opus], [libopus headers], [opus/opus_multistream.h])
CHECK_LIB([libaom], [aom], [aom_codec_version])
CHECK_HEADERS([libaom], [libaom headers], [aom/aom.h])
+CHECK_LIB([dav1d], [dav1d], [dav1d_version])
+CHECK_HEADERS([dav1d], [libdav1d headers], [dav1d/dav1d.h])
CHECK_LIB([libwebp], [webp], [WebPGetEncoderVersion])
CHECK_HEADERS([libwebp], [libwebp headers], [webp/encode.h])
CHECK_LIB([a52dec], [a52], [a52_init])
PKG_PROVIDE([libvorbis])
PKG_PROVIDE([mjpegtools])
PKG_PROVIDE([libaom])
+PKG_PROVIDE([dav1d])
PKG_PROVIDE([libwebp])
PKG_PROVIDE([openexr], [$WANT_OPENEXR])
PKG_PROVIDE([openjpeg])
loglevel=fatal
formatprobesize=5000000
scan_all_pmts=1
+remap_video_decoder libaom-av1=libdav1d
$(call if_pkg,openjpeg,--enable-libopenjpeg) \
$(call if_pkg,lame,--enable-libmp3lame) \
$(call if_pkg,libaom,--enable-libaom) \
+ $(call if_pkg,dav1d,--enable-libdav1d) \
$(call if_pkg,libwebp,--enable-libwebp) \
$(call if_pkg,opus,--enable-libopus) \
$(call if_pkg,libvorbis,--enable-libvorbis) \
$(call inc_path,twolame,libtwolame) \
$(call inc_path,lame,include) \
$(call inc_path,libaom,usr/local/include) \
+ $(call inc_path,dav1d,usr/local/include) \
$(call inc_path,libwebp,usr/local/include) \
$(call inc_path,openjpeg,src/lib/openjp2) \
$(call inc_path,libogg,include) \
$(call ld_path,twolame,libtwolame/.libs) \
$(call ld_path,lame,libmp3lame/.libs) \
$(call ld_path,libaom,usr/local/lib) \
+ $(call ld_path,dav1d,usr/local/lib) \
$(call ld_path,libwebp,usr/local/lib) \
$(call ld_path,openjpeg,bin) \
$(call ld_path,opus,.libs) \
libaom.cfg_params?= -DENABLE_SHARED=no -DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=$(call bld_path,libaom)/usr/local
libaom.mak_params?= ; $(MAKE) -C libaom* install
+dav1d.cfg_vars?=echo "meson build --buildtype release --default-library=both" > configure; chmod +x ./configure;
+dav1d.mak_vars?=(echo "all:"; echo " ninja -C build") > $(call bld_path,dav1d)/Makefile;
+dav1d.mak_params?=; cd "$(call bld_path,dav1d)"; DESTDIR="$(call bld_path,dav1d)" meson install -C build
libwebp.cfg_vars?= mkdir build && cd build && $(call cmake_config,..)
libwebp.mak_params?= -C build all install DESTDIR=$(call bld_path,libwebp)
mjpegtools.cflags?="$(call inc_path,libjpeg) $(call ld_path,libjpeg,.libs)"
$(call rules,$(call std-build,encore))
$(call rules,$(call std-build,esound,audiofile))
$(call rules,$(call std-build,ffmpeg, twolame lame openjpeg opus \
- libtheora x264 x265 libvpx libaom libwebp \
+ libtheora x264 x265 libvpx libaom dav1d libwebp \
$(if $(WANT_NV), ffnvcodec)))
$(call rules,$(call std-build,fftw))
$(call rules,$(call std-build,flac,libogg))
$(call rules,$(call std-build,ladspa))
$(call rules,$(call std-build,lame))
$(call rules,$(call std-build,libaom))
+$(call rules,$(call std-build,dav1d))
$(call rules,$(call std-build,libwebp))
$(call rules,$(call std-build,libavc1394,libraw1394))
$(call rules,$(call std-build,libdv))