Log in

View Full Version : Cross-Platform D2V Source for VapourSynth


Pages : 1 [2] 3 4

Daemon404
9th December 2012, 05:20
Bad news. The GCC Beta4 build seems to be broken. It just hangs when I try to load it. MSVC Beta4 build works fine.

I asked someone else to build it this time, as my usual box I build the MinGW stuff on was down. I'll rebuild it / test on Monday.

Daemon404
11th December 2012, 04:12
I asked someone else to build it this time, as my usual box I build the MinGW stuff on was down. I'll rebuild it / test on Monday.

New MinGW binary up in OP, with a critical bug too.

I've tested this binary to work on Windows 7.

Not going to bother posting Visual Studio builds now, as theyre a fair bit slower than MinGW builds (even though they're ~2.5x smaller).

mikewando
13th January 2013, 23:16
It might be worth noting which version of libavcodec this requires (especially in the configure script) since Ubuntu 12.10's libavcodec-dev is evidently too old.

For others trying to compile on 12.10 I grabbed the 9.1 tarball from http://libav.org/download.html and that worked for me, but I had to add --enable-pic to my configure line when building libavcodec; d2vsource complained otherwise.

Edit: Tried it out and it seems to work fine for my purposes. Thanks a lot for the work! Looking forward to a future where I can keep my whole workflow in 64bit Linux.

Daemon404
14th January 2013, 00:29
It might be worth noting which version of libavcodec this requires (especially in the configure script) since Ubuntu 12.10's libavcodec-dev is evidently too old.

For others trying to compile on 12.10 I grabbed the 9.1 tarball from http://libav.org/download.html and that worked for me, but I had to add --enable-pic to my configure line when building libavcodec; d2vsource complained otherwise.

I generally follow git master. As for --enable-pic, I figured that was common knowledge, since PIC is kind of required for Linux shared libraries. I suppose I could note it.

mikewando
14th January 2013, 00:58
I generally follow git master. As for --enable-pic, I figured that was common knowledge, since PIC is kind of required for Linux shared libraries. I suppose I could note it.

Of course PIC makes sense, but I didn't know libavcodec builds without -fpic by default. I'm not sure how common that is; I try to generally avoid building my own libraries as much as possible. I also wanted to note it for other people who may have no idea what the error message is really telling them.

At any rate I think the most helpful thing would just to have the configure script spit out that it requires libavcodec >= 0.9.0, or whatever its current requirement is, since it's entirely possible for libavcodec/avcodec.h to exist and have been found and still fail the configure check.

Daemon404
26th February 2013, 16:55
Beta5 Released: http://chromashift.org/vs/d2vsource_beta5.zip
ChangeLog here (https://github.com/dwbuiten/d2vsource/compare/beta4...beta5).

Highlights: Open GOP seeking now works properly in all cases!

At any rate I think the most helpful thing would just to have the configure script spit out that it requires libavcodec >= 0.9.0, or whatever its current requirement is, since it's entirely possible for libavcodec/avcodec.h to exist and have been found and still fail the configure check.

Sure.

paradoxical
26th February 2013, 17:05
Thanks for this! Quick question: Have you fixed the limitation about last frame not decoded? If not check out this (http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/api-example_8c-source.html) starting at line 417. Or I can probably try to make a patch for you.

Daemon404
26th February 2013, 17:18
Thanks for this! Quick question: Have you fixed the limitation about last frame not decoded? If not check out this (http://cekirdek.pardus.org.tr/~ismail/ffmpeg-docs/api-example_8c-source.html) starting at line 417. Or I can probably try to make a patch for you.

I know. I've just been too lazy to deal with libavcodec's tomfoolery...

paradoxical
26th February 2013, 17:37
I know. I've just been too lazy to deal with libavcodec's tomfoolery...

Well, I think I know where the fix needs to be. Testing now and if it works I'll send you a patch shortly.

paradoxical
26th February 2013, 19:02
So this is odd. The fix I made works for certain clips to get all frames whereas others crash when reading the last frame. Continuing to debug it.

Daemon404
26th February 2013, 19:07
So this is odd. The fix I made works for certain clips to get all frames whereas others crash when reading the last frame. Continuing to debug it.

Welcome to the wonderful world of libavcodec. \o/

paradoxical
26th February 2013, 19:19
Actually the issue wasn't on libavcodec. The decoding code was getting caught in an infinite loop for some of the streams on the last frame. Why some did and some didn't is weird, but once I changed the logic the decoding worked on all streams. Diff file for the changes is here (https://www.dropbox.com/s/coqidk0pjuuyp9b/patch.txt). It's actually a pretty small change.

Daemon404
26th February 2013, 19:30
Actually the issue wasn't on libavcodec. The decoding code was getting caught in an infinite loop for some of the streams on the last frame. Why some did and some didn't is weird, but once I changed the logic the decoding worked on all streams. Diff file for the changes is here (https://www.dropbox.com/s/coqidk0pjuuyp9b/patch.txt). It's actually a pretty small change.

I'll poke it a bit tonight or tomorrow morn.

Thanks!

Do you have a name/email I can put in the git history as the author?

paradoxical
26th February 2013, 19:31
If you want I can send you an actual pull request through github.

Daemon404
26th February 2013, 19:33
If you want I can send you an actual pull request through github.

Sweet. Go for it.

paradoxical
26th February 2013, 19:39
Done. :)

Daemon404
26th February 2013, 20:05
Done. :)

Merged. It'll be in beta6 (or v0.1... bugs are getting low now). Whenever that is.

paradoxical
26th February 2013, 21:58
Cool. Glad to have helped that get solved. :)

Daemon404
13th March 2013, 03:17
So I've written a working prototype of a D2V creation utility in Perl, and it seems to work cross-platform. I'll have to get off my ass and write it properly in C so I can release it soon... ;)

Revgen
13th March 2013, 15:17
Good news. Glad to hear.

Keiyakusha
21st May 2013, 11:10
So I've written a working prototype of a D2V creation utility in Perl, and it seems to work cross-platform. I'll have to get off my ass and write it properly in C so I can release it soon... ;)

I'm trying to hold myself, but looks like I can't do it anymore. So I have to ask, was there any progress on that?
Just want to mention that if people don't post much, doesn't means they don't need it :o

Daemon404
22nd May 2013, 22:05
I'm trying to hold myself, but looks like I can't do it anymore. So I have to ask, was there any progress on that?
Just want to mention that if people don't post much, doesn't means they don't need it :o

Mostly just laziness and busyness are holding it up. Moving between continents and hectic work schedule. But mostly, I need to get up the motivation to write the large amount of boilerplate code that the libavformat and libavcodec cumbersome APIs require to do anything. I'll set a tentative date of "before June 1st^H^H^H^H^H^H^H^Hmid june.".

For now, here's my horrible hacky perl script: https://gist.github.com/dwbuiten/5630882

It's pretty broken, hacky, inefficient, and is missing several features, but the basic idea is there.

Thanks for the wake up call!

opteronup
21st August 2013, 11:25
Please help me to compile this package on Arch linux.

When I try to compile this package, I receive this error:

==> Starting pkgver()...
==> Updated version: vapoursynth-plugin-d2vsource-git 20130428.a6741ad-1
==> Starting build()...
CXXFLAGS/LDFLAGS checking...
checking for libavformat...
checking for libavcodec...

settings...
CXX = g++
LD = g++
STRIP = strip
CXXFLAGS = -Os -ffast-math -Wall -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I./vs -I./core -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -fexcess-precision=fast -DQT_SHARED -I/usr/include/vapoursynth -I/usr/include/qt4 -I/usr/include/qt4/QtCore
LDFLAGS = -shared -Wl,-Bsymbolic -fPIC
LIBS = -lavformat -lavcodec -lvapoursynth
LIBNAME = libd2vsource.so
install path = /home/user/Downloads/vapoursynth-plugin-d2vsource-git/pkg/vapoursynth-plugin-d2vsource-git/usr/lib/vapoursynth
configure finished.
g++ -Os -ffast-math -Wall -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I./vs -I./core -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -fexcess-precision=fast -DQT_SHARED -I/usr/include/vapoursynth -I/usr/include/qt4 -I/usr/include/qt4/QtCore -c vs/applyrff.cpp -o vs/applyrff.o
g++ -Os -ffast-math -Wall -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I./vs -I./core -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -fexcess-precision=fast -DQT_SHARED -I/usr/include/vapoursynth -I/usr/include/qt4 -I/usr/include/qt4/QtCore -c vs/d2vsource.cpp -o vs/d2vsource.o
vs/d2vsource.cpp: In function ‘const VSFrameRef* d2vGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, const VSAPI*)’:
vs/d2vsource.cpp:51:28: error: ‘av_frame_unref’ was not declared in this scope
av_frame_unref(d->frame);
^
vs/d2vsource.cpp: In function ‘void d2vFree(void*, VSCore*, const VSAPI*)’:
vs/d2vsource.cpp:86:28: error: ‘av_frame_unref’ was not declared in this scope
av_frame_unref(d->frame);
^
vs/d2vsource.cpp: In function ‘void d2vCreate(const VSMap*, VSMap*, void*, VSCore*, const VSAPI*)’:
vs/d2vsource.cpp:122:23: error: ‘AVCodecContext’ has no member named ‘get_buffer2’
data->dec->avctx->get_buffer2 = VSGetBuffer;
^
make: *** [vs/d2vsource.o] Error 1
==> ERROR: A failure occurred in build().
Aborting...
I think the reason is incompatibility with newer versions of ffmpeg, but I'm not sure. I tried with these versions of ffmpeg - 1.1.5, 1.2.2 and 2.0.

Please help!

Thanks in advance.

jackoneill
21st August 2013, 12:14
Your ffmpeg is probably not new enough rather than too new (though I thought 2.0 was pretty new...? With ffmpeg releases, who knows.)

I recommend you build the latest ffmpeg from git somewhere (~/, or /opt/) with --enable-static --disable-shared, and make d2vsource use that.

opteronup
21st August 2013, 18:29
Thanks, jackoneill.

I tried with git version of ffmpeg. Now I receive this error:

==> Starting build()...
CXXFLAGS/LDFLAGS checking...
checking for libavformat...
error: libavformat checking failed.
error: libavformat/avformat.h might not be installed or some libs missing.
==> ERROR: A failure occurred in build().
Aborting...

I have used --disable-shared --enable-static, as you said. I only did not change the directory, I removed my ffmpeg and installed git version of ffmpeg.

jackoneill
21st August 2013, 20:16
Thanks, jackoneill.

I tried with git version of ffmpeg. Now I receive this error:



I have used --disable-shared --enable-static, as you said. I only did not change the directory, I removed my ffmpeg and installed git version of ffmpeg.

Uh... run it like this:

PKG_CONFIG_PATH=$ffmpeg_prefix/lib/pkgconfig/ ./configure

where $ffmpeg_prefix is whatever prefix you passed to ffmpeg's configure (the default is probably /usr/local).

opteronup
21st August 2013, 23:01
Absolutely the same error. :angry:

Do you have a compiled d2vsource package? I do not know which distribution you use but I think I can convert it.

jackoneill
22nd August 2013, 11:21
Absolutely the same error. :angry:


Okay... tell me exactly what commands you used to download, compile and install ffmpeg. If you used a PKGBUILD just paste that. Also the config.log from d2vsource.

opteronup
22nd August 2013, 15:00
I have used this PKGBUILD for d2vsource

# Maintainer: Gustavo Alvarez <sl1pkn07@gmail.com>

_plug=d2vsource
pkgname=vapoursynth-plugin-${_plug}-git
pkgver=20130226.1dd663c
pkgrel=1
pkgdesc="Plugin for Vapoursynth: ${_plug} (GIT version)"
arch=('i686' 'x86_64')
url="https://github.com/dwbuiten/${_plug}"
license=('GPL')
depends=('vapoursynth')
provides=("vapoursynth-plugin-${_plug}")
conflicts=("vapoursynth-plugin-${_plug}")
makedepends=('git')
source=("git://github.com/dwbuiten/${_plug}.git")
md5sums=('SKIP')
_gitname="${_plug}"

pkgver() {
cd "${_gitname}"
echo "$(git log -1 --format="%cd" --date=short | tr -d '-').$(git log -1 --format="%h")"
}

build() {
cd "${srcdir}/${_gitname}"

./configure --install="${pkgdir}/usr/lib/vapoursynth" --extra-cxxflags="$CXXFLAGS"
make
}

package(){
cd "${srcdir}/${_gitname}"
make install
install -Dm644 README "${pkgdir}/usr/share/doc/vapoursynth/plugins/${_plug}/README"
}

this for ffmpeg 1.1.5, 1.2.2 and 2.0:

# $Id$
# Maintainer: Gerad Munsch <gmunsch@unforgivendevelopment.com>
# Previous maintainer: Rudolf Polzer <divVerent[at]xonotic[dot]org>
# Original maintainer: Ionut Biru <ibiru@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
# Contributor: Paul Mattal <paul@archlinux.org>

# NOTE: This package was derived from 'ffmpeg-full', with some additional codecs
# enabled, and brought up to date to extra/ffmpeg.

# NOTE before flagging this out of date: this PKGBUILD is supposed to have the
# same ffmpeg version as extra/ffmpeg. Once that one got updated, this one
# needs too.

pkgname=ffmpeg-full-extra
pkgver=2.0
pkgrel=1
epoch=1
pkgdesc="Record, convert, and stream audio and video (all codecs; compatible to extra/ffmpeg)"
arch=('i686' 'x86_64')
url="http://ffmpeg.org/"
license=('GPL' 'custom:UNREDISTRIBUTABLE')
depends=('alsa-lib' 'bzip2' 'fontconfig' 'faac' 'lame' 'libtheora' 'libva' 'sdl' 'x264' 'libass' 'libbluray' 'libcaca' 'libiec61883' 'openal' 'twolame' 'libavc1394' 'xvidcore' 'schroedinger' 'v4l-utils' 'speex' 'opus' 'libvpx' 'jack' 'opencore-amr' 'rtmpdump' 'openjpeg' 'libmodplug' 'gsm' 'libpulse' 'vo-aacenc' 'vo-amrwbenc' 'celt' 'gnutls' 'libdc1394' 'libfdk-aac' 'libcdio-paranoia' 'libaacplus' 'libvorbis' 'zlib')
makedepends=('libvdpau' 'yasm' 'pkg-config')
conflicts=('ffmpeg' 'ffmpeg-full' 'ffmpeg-git' 'ffmpeg-full-git')
provides=('ffmpeg' 'qt-faststart')
source=(http://ffmpeg.org/releases/ffmpeg-$pkgver.tar.bz2 'UNREDISTRIBUTABLE.txt')
sha256sums=('940e1bc4f3e185364099b4ba60d4b952615a4232c5641baa3e9f45d4d748130c'
'e0c1b126862072a71e18b9580a6b01afc76a54aa6e642d2c413ba0ac9d3010c4')

[[ "$CARCH" == i686 ]] && _asm='--disable-asm'

build() {
cd ffmpeg-$pkgver

msg "Starting configure..."
./configure \
--enable-shared \
--disable-debug \
--disable-static \
--prefix=/usr \
$_asm \
--enable-avresample \
--enable-bzlib \
--enable-dxva2 \
--enable-fontconfig \
--enable-gnutls \
--enable-gpl \
--enable-iconv \
--enable-libass \
--enable-libbluray \
--enable-libcaca \
--enable-libcdio \
--enable-libcelt \
--enable-libdc1394 \
--enable-libfaac \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libgsm \
--enable-libiec61883 \
--enable-libmodplug \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libopus \
--enable-libpulse \
--enable-librtmp \
--enable-libschroedinger \
--enable-libspeex \
--enable-libtheora \
--enable-libtwolame \
--enable-libv4l2 \
--enable-libvo-aacenc \
--enable-libvo-amrwbenc \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libxvid \
--enable-nonfree \
--enable-openal \
--enable-openssl \
--enable-postproc\
--enable-runtime-cpudetect \
--enable-vaapi \
--enable-vda \
--enable-vdpau \
--enable-version3 \
--enable-x11grab \
--enable-zlib \

msg "Starting make"
make
make tools/qt-faststart
make doc/ff{mpeg,play,server}.1
}

package() {
cd ffmpeg-$pkgver
make DESTDIR="$pkgdir" install install-man
install -D -m755 tools/qt-faststart "$pkgdir/usr/bin/qt-faststart"
install -D -m644 "$srcdir"/UNREDISTRIBUTABLE.txt "$pkgdir/usr/share/licenses/$pkgname/UNREDISTRIBUTABLE.txt"
}

# How to audit the ./configure flags:
#
# cut -c 3- <<'# EOF' | sh
# cd src/ffmpeg-1.2
# export DISABLED='
# # debugging flags follow:
# --enable-coverage
# --enable-extra-warnings
# --enable-ftrapv
# --enable-memalign-hack
# --enable-memory-poisoning
# --enable-random
# --enable-xmm-clobber-test
# # we do not want this:
# --enable-cross-compile # not cross building
# --enable-gray # slow
# --enable-hardcoded-tables # no advantage
# --enable-lto # slow build
# --enable-pic # not our job to decide this
# --enable-shared # handled by options before --prefix
# --enable-small # we want SPEED instead
# # this stuff does not build:
# --enable-frei0r # circular dependency
# --enable-libaacplus # does not build from AUR: configure.ac:8: error: "AM_CONFIG_HEADER": this macro is obsolete.
# --enable-libflite # configure fail: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libflite.a(au_alsa.o): In function "audio_open_alsa": (.text+0x20): undefined reference to "snd_pcm_hw_params_sizeof"
# --enable-libilbc # configure fail: /tmp/ffconf.lccg5Ux6.c:1:18: fatal error: ilbc.h: No such file or directory
# --enable-libnut # link fail: /usr/bin/ld: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libnut.a(muxer.o): relocation R_X86_64_32S against ".rodata" can not be used when making a shared object; recompile with -fPIC
# --enable-libsoxr # only as -git in AUR
# --enable-libstagefright-h264 # not in AUR
# --enable-libopencv # circular dependency
# --enable-libutvideo # compile fail: libavcodec/libutvideodec.cpp:64:18: error: "UTVF_RGB24_WIN" was not declared in this scope
# --enable-libxavs # does not build from AUR: /usr/bin/ld: common/i386/deblock.o: relocation R_X86_64_32 against ".rodata" can not be used when making a shared object; recompile with -fPIC
# # this stuff is not for linux/x86:
# --enable-avisynth # windows only
# --enable-sram # not x86
# --enable-thumb # not x86
# '
# ./configure --help | perl -ne 'for(/--enable-([0-9a-z-]+)\s/) { if($ENV{DISABLED} !~ /^--enable-$_\b/m) { print " --enable-$_ \\\n"; } }' | sort -u
# EOF

# vim:set ts=2 sw=2 et:

and this one for ffmpeg git:

# Maintainer: Rudolf Polzer <divVerent[at]xonotic[dot]org>
# Original maintainer: DrZaius <lou[at]fakeoutdoorsman[dot]com>

pkgname=ffmpeg-full-git
pkgver=0.51608.495ed19
pkgrel=1
pkgdesc="Record, convert, and stream audio and video (all codecs; git version)"
arch=('i686' 'x86_64')
url="http://ffmpeg.org/"
license=('GPL' 'custom:UNREDISTRIBUTABLE')
depends=('faac' 'lame' 'libtheora' 'libva' 'sdl' 'x264' 'libass' 'libbluray' 'libcaca' 'libiec61883' 'openal' 'twolame' 'libavc1394' 'xvidcore' 'schroedinger' 'v4l-utils' 'speex' 'opus' 'libvpx' 'jack' 'opencore-amr' 'rtmpdump' 'openjpeg' 'libmodplug' 'gsm' 'libpulse' 'vo-aacenc' 'vo-amrwbenc' 'libsoxr-git' 'celt' 'gnutls' 'libdc1394' 'libfdk-aac' 'libcdio-paranoia')
makedepends=('git' 'yasm' 'libnut-git' 'utvideo' 'pkg-config')
conflicts=('ffmpeg' 'ffmpeg-git' 'ffmpeg-full')
provides=('ffmpeg' 'ffmpeg-git' 'qt-faststart')
source=('git://git.videolan.org/ffmpeg#branch=master'
'UNREDISTRIBUTABLE.txt')
sha256sums=('SKIP'
'e0c1b126862072a71e18b9580a6b01afc76a54aa6e642d2c413ba0ac9d3010c4')

_gitname="ffmpeg"

pkgver() {
cd "$srcdir/$_gitname"
microver="$(git log -1 --pretty=format:%h )"
minorver="$(git rev-list --count HEAD)"
echo "0.$minorver.$microver"
}

build() {
cd "$srcdir/$_gitname"

msg "Starting configure..."
./configure \
--disable-shared \
--enable-debug \
--enable-static \
--prefix=/usr \
--enable-avresample \
--enable-bzlib \
--enable-fontconfig \
--enable-gnutls \
--enable-gpl \
--enable-libass \
--enable-libbluray \
--enable-libcaca \
--enable-libcdio \
--enable-libcelt \
--enable-libdc1394 \
--enable-libfaac \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libgsm \
--enable-libiec61883 \
--enable-libmodplug \
--enable-libmp3lame \
--enable-libnut \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopenjpeg \
--enable-libopus \
--enable-libpulse \
--enable-librtmp \
--enable-libschroedinger \
--enable-libsoxr \
--enable-libspeex \
--enable-libtheora \
--enable-libtwolame \
--enable-libutvideo \
--enable-libv4l2 \
--enable-libvo-aacenc \
--enable-libvo-amrwbenc \
--enable-libvorbis \
--enable-libvpx \
--enable-libx264 \
--enable-libxvid \
--enable-nonfree \
--enable-openal \
--enable-openssl \
--enable-vaapi \
--enable-vda \
--enable-vdpau \
--enable-version3 \
--enable-x11grab \
--enable-zlib \

msg "Starting make"
make
make tools/qt-faststart
make doc
}

package() {
cd "$srcdir/$_gitname"
make DESTDIR="$pkgdir" install install-man
install -D -m755 tools/qt-faststart "$pkgdir/usr/bin/qt-faststart"
install -D -m644 "$srcdir"/UNREDISTRIBUTABLE.txt "$pkgdir/usr/share/licenses/$pkgname/UNREDISTRIBUTABLE.txt"
}

# How to audit the ./configure flags:
#
# cut -c 3- <<'# EOF' | sh
# cd src/ffmpeg
# export DISABLED='
# # debugging flags follow:
# --enable-coverage
# --enable-extra-warnings
# --enable-ftrapv
# --enable-memalign-hack
# --enable-memory-poisoning
# --enable-random
# --enable-xmm-clobber-test
# # we do not want this:
# --enable-cross-compile # not cross building
# --enable-gray # slow
# --enable-hardcoded-tables # no advantage
# --enable-lto # slow build
# --enable-pic # not our job to decide this
# --enable-shared # handled by options before --prefix
# --enable-small # we want SPEED instead
# # this stuff does not build:
# --enable-frei0r # circular dependency
# --enable-libaacplus # does not build from AUR: configure.ac:8: error: "AM_CONFIG_HEADER": this macro is obsolete.
# --enable-libflite # configure fail: /usr/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib/libflite.a(au_alsa.o): In function "audio_open_alsa": (.text+0x20): undefined reference to "snd_pcm_hw_params_sizeof"
# --enable-libilbc # configure fail: /tmp/ffconf.lccg5Ux6.c:1:18: fatal error: ilbc.h: No such file or directory
# --enable-libopencv # circular dependency
# --enable-libstagefright-h264 # not in AUR
# --enable-libxavs # does not build from AUR: /usr/bin/ld: common/i386/deblock.o: relocation R_X86_64_32 against ".rodata" can not be used when making a shared object; recompile with -fPIC
# # this stuff is not for linux/x86:
# --enable-avisynth # windows only
# --enable-dxva2 # windows only
# --enable-sram # not x86
# --enable-thumb # not x86
# '
# ./configure --help | perl -ne 'for(/--enable-([0-9a-z-]+)\s/) { if($ENV{DISABLED} !~ /^--enable-$_\b/m) { print " --enable-$_ \\\n"; } }' | sort -u
# EOF

# vim:set ts=2 sw=2 et:

And this is config.log when I build with ffmpeg 1.2.2:

all command lines:
--install=/home/user/Downloads/vapoursynth-plugin-d2vsource-git/pkg/vapoursynth-plugin-d2vsource-git/usr/lib/vapoursynth --extra-cxxflags=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4

---------------------------------
CXXFLAGS/LDFLAGS checking...
int main(void){ return 0;}
g++ conftest.cpp -o conftest -Wall -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I./vs -I./core -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC
0
int main(void){ return 0;}
g++ conftest.cpp -o conftest -Os -ffast-math -Wall -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I./vs -I./core -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC
0
int main(void){ return 0;}
g++ conftest.cpp -o conftest -Os -ffast-math -Wall -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I./vs -I./core -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -fexcess-precision=fast
0

---------------------------------
checking for libavformat...
#include <libavformat/avformat.h>
int main(void){avformat_find_stream_info(0,0); return 0;}
g++ conftest.cpp -o conftest -Os -ffast-math -Wall -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I./vs -I./core -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -fexcess-precision=fast -DQT_SHARED -I/usr/include/vapoursynth -I/usr/include/qt4 -I/usr/include/qt4/QtCore -lavformat -lavcodec -lvapoursynth
0

---------------------------------
checking for libavcodec...
#include <libavcodec/avcodec.h>
int main(void){avcodec_find_decoder(AV_CODEC_ID_NONE); return 0;}
g++ conftest.cpp -o conftest -Os -ffast-math -Wall -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I./vs -I./core -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -fexcess-precision=fast -DQT_SHARED -I/usr/include/vapoursynth -I/usr/include/qt4 -I/usr/include/qt4/QtCore -lavformat -lavcodec -lvapoursynth
0
---------------------------------
setting
---------------------------------
CXX = g++
LD = g++
STRIP = strip
CXXFLAGS = -Os -ffast-math -Wall -D__STDC_CONSTANT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I. -I./vs -I./core -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -fPIC -fexcess-precision=fast -DQT_SHARED -I/usr/include/vapoursynth -I/usr/include/qt4 -I/usr/include/qt4/QtCore
LDFLAGS = -shared -Wl,-Bsymbolic -fPIC
LIBS = -lavformat -lavcodec -lvapoursynth
SRCDIR = .
LIBNAME = libd2vsource.so
libdir = /home/user/Downloads/vapoursynth-plugin-d2vsource-git/pkg/vapoursynth-plugin-d2vsource-git/usr/lib/vapoursynth

I think there is a problem with libdir. I also noted that in file "configure" from d2vsource on line 74 the libdir is "/usr/local/lib/vapoursynth" but on my Arch linux vapoursynth libs are in "/usr/lib/vapoursynth". I changed that from "/usr/local/lib/vapoursynth" to "/usr/lib/vapoursynth", but something modifies it during compilation. After compilation libdir is again "/usr/local/lib/vapoursynth".

jackoneill
22nd August 2013, 16:14
Uh, according to the config.log you pasted, the libavformat and libavcodec checks succeeded.

opteronup
22nd August 2013, 20:06
I managed to compile d2vsource with ffmpeg 2.0.1.

Thanks, jackoneill.

The problem with git version of ffmpeg was that my vapoursynth was built with ffmpeg 1.2.1.
I didn't know that I must use the same ffmpeg for compile vapoursynth and d2vsource.
Then I tried to build vapoursynth with ffmpeg git but I also received errors.
And now I used ffmpeg 2.0.1 to compile vapoursynth and d2vsource and everything works fine.

Mystery Keeper
17th November 2013, 15:40
Please read several posts starting from this one:
http://forum.doom9.org/showthread.php?p=1653750#post1653750
Not sure, but it seems that d2v.Source hangs if requested a frame with number beyond the real source length.

handaimaoh
17th November 2013, 16:40
Yeah, the filter simply doesn't handle such a case. It seems to just assume that any frame number it is given is in the valid range. I'll send them a pull request real fast with a fix.

If you want a compile a test version to try the fix I have it here (https://github.com/handaimaoh/d2vsource ). If it works, I'll do the pull request up. Fix in the getframe functions was to add:

if (n >= d->d2v->frames.size()) {
n = d->d2v->frames.size() - 1;
}

Gavino
17th November 2013, 16:57
Yeah, the filter simply doesn't handle such a case. It seems to just assume that any frame number it is given is in the valid range.
Normally, the Avisynth cache filter (inserted automatically after all script filters) will ensure that all frame requests actually received by your filter are in range.

However, I guess that does not apply in Vapoursynth. (?)
(and it's still bad practice anyway for a source filter)

handaimaoh
17th November 2013, 17:01
Well it's just a quirk of the API like Myrsloik says. It's such a simple thing to check for though. And as he says, it's going to be changed.

I'm going to change it for r22, that's why I didn't notice all the crashes you were getting.

Also, I've fixed the check once again to be a ">=" as it was originally.

handaimaoh
17th November 2013, 17:58
I've created a pull request that fixes this issue and set it off.

StainlessS
17th November 2013, 18:03
n = (n<0) ? 0 : (n>= vi.num_frames) ? vi.num_frames - 1 : n; // Range limit frame n


In Avisynth speak.

handaimaoh
17th November 2013, 18:08
n = (n<0) ? 0 : (n>= vi.num_frames) ? vi.num_frames -1 : n; // Range limit frame n


In Avisynth speak.

Yeah that would work as well. I just forgot about using the VSVideoInfo. Probably more elegant that way too. Fixed up the pull request to be like this instead. Looks like:

// Range limit n
n = (n < 0) ? 0 : (n >= d->vi.numFrames) ? d->vi.numFrames - 1 : n;

Gavino
17th November 2013, 18:58
Probably more elegant that way too.Even more elegant is

n = min(vi.num_frames-1, max(0,n));

which is what the Avisynth Cache filter uses.

Daemon404
17th November 2013, 20:00
Please see: https://github.com/dwbuiten/d2vsource/pull/8#issuecomment-28655105

Mystery Keeper
17th November 2013, 21:39
In my opinion it is not wise to omit a guard based on assumption that it won't be needed in the next release. It might be broken later. Or some other software might misuse the library interface. Since the check is only made once per frame - 'tis a quite welcome and non-hindering precaution.

Daemon404
17th November 2013, 21:55
In my opinion it is not wise to omit a guard based on assumption that it won't be needed in the next release. It might be broken later. Or some other software might misuse the library interface. Since the check is only made once per frame - 'tis a quite welcome and non-hindering precaution.

Sorry, scattering basic sanity checks over every single plugin for VapourSynth, because it was once a bug in the core, is retarded. It negates the point of a framework. It's a hack.

Maybe I should also add a check to make sure water is wet too.

Myrsloik
17th November 2013, 22:04
In my opinion it is not wise to omit a guard based on assumption that it won't be needed in the next release. It might be broken later. Or some other software might misuse the library interface. Since the check is only made once per frame - 'tis a quite welcome and non-hindering precaution.

I don't intend to change the behavior back ever. This change is permanent since it makes sense and slightly simplifies plugin writing. It also means that not all plugins have to be littered with the same check again and again. Or more exactly as many different versions of the check as there are coders on doom9.

On the subject of backseat coders (which we've been having quite a few of recently), the correct answer is:
if (d->vi->numFrames && d->vi->numFrames <= n)
n = d->vi->numFrames -1;
Number of people posting in this this thread who got it right: 0

StainlessS
17th November 2013, 22:43
Best place for check on having video is in constructor, not getframe. Guess it means -ve n is ok then.


Number of people posting in this this thread who got it right: 0

Maybe so.

lansing
17th November 2013, 22:54
may we be expecting a 64bit version soon?

Daemon404
18th November 2013, 15:13
may we be expecting a 64bit version soon?

Done. As of Beta 6, the windows zip contains both 32bit and 64bit builds.

ChangeLog here (https://github.com/dwbuiten/d2vsource/compare/beta5...beta6).

I also SHOULD get to writing the d2v creation utility... life is busy. Meh. There's still this (https://gist.github.com/dwbuiten/5630882), though.

Mystery Keeper
19th November 2013, 19:53
This video (http://www.mediafire.com/?34e84dlmb707chd) makes VapourSynth crash near the end when loaded with D2V Source. Other d2v projects don't, so the bug most likely is not in VS.

Daemon404
23rd November 2013, 22:58
This video (http://www.mediafire.com/?34e84dlmb707chd) makes VapourSynth crash near the end when loaded with D2V Source. Other d2v projects don't, so the bug most likely is not in VS.

I'll look into it on Monday.

Mystery Keeper
29th November 2013, 02:23
Hope this crash report (http://paste.org.ru/?esc0vc) can help.

Daemon404
29th November 2013, 11:22
Hope this crash report (http://paste.org.ru/?esc0vc) can help.

Sorry, I've been busier this week than expected. I've filed an issue (https://github.com/dwbuiten/d2vsource/issues/9) for it, and will poke it this weekend (I am currently on a transatlantic flight after a week of work).