PDA

View Full Version : [SOLVED] Building latest ffmpeg RPM with webm/VP8 support - libvpx not found


HeWhoWatches
9th June 2010, 08:27 AM
Hi, I'm trying to build ffmpeg with VP8 support but I've run into a problem with the svn HEAD version of ffmpeg which now apparently no longer requires the patches. I'm using rpmbuild and basing my SPEC files on the ones used at rpmfusion. I've already build the latest version of x264 as an RPM (the versions in rpmfusion are too old at present and I don't really want to switch to atrpms). Everything seems fine until the point where I run:

rpmbuild -ba ffmpeg.spec

At which point the following error appears:
ERROR: libvpx not found

I'm using libvpx / libvpx-devel packages from main fedora 13 repos (at version 0.9.0-5). I've also tried the newer koji build here to no avail: http://koji.fedoraproject.org/koji/buildinfo?buildID=176419

What I can't figure out is, why does the build process know where all of the other devel files are, but not libvpx?
The include files themselves appear to be stored under: /usr/include/vpx

I've previously managed to build the older svn version 23197 which required the webm patches based on a process shown here: http://lardbucket.org/blog/archives/2010/05/19/vp8-webm-and-ffmpeg/

However, since this svn build, the option to build with libvpx has changed from --enable-libvpx-vp8 to simply --enable-libvpx. Pretty sure this isn't the problem because ffmpeg won't recognise the older syntax now, so it must just be a problem finding the libvpxdevel files.

Trying to build on Fedora 13, x86_64 - I'm completely stumped - anyone have any good ideas?

Full output below:

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.mTelW3
+ umask 022
+ cd /home/rob/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /home/rob/rpmbuild/BUILD
+ rm -rf ffmpeg-20100609
+ /usr/bin/bzip2 -dc /home/rob/rpmbuild/SOURCES/ffmpeg-20100609.tar.bz2
+ /bin/tar -xf -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd ffmpeg-20100609
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.e9UcVc
+ umask 022
+ cd /home/rob/rpmbuild/BUILD
+ cd ffmpeg-20100609
+ LANG=C
+ export LANG
+ unset DISPLAY
+ mkdir generic
+ pushd generic
~/rpmbuild/BUILD/ffmpeg-20100609/generic ~/rpmbuild/BUILD/ffmpeg-20100609
+ ../configure --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 '--extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --extra-version=rpmfusion --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avfilter-lavf --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
ERROR: libvpx not found

If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.err" produced by configure as this will help
solving the problem.
error: Bad exit status from /var/tmp/rpm-tmp.vf2Q4h (%build)


RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.vf2Q4h (%build)


Edit: Sorry, forgot to add that my initial successful build with the svn 23197 version (and patches), I had to modify the configure command in the SPEC file as below:

env CPPFLAGS="-I/usr/include/vpx" ../configure \\\

Unfortunately this does not work any longer. I'm sure there must be a more elegant way of achieving this but...

If it helps, the original ffmpeg.spec file can be extracted from the archive here:
http://download1.rpmfusion.org/free/fedora/releases/13/Everything/source/SRPMS/ffmpeg-0.6-0.3.20100429svn.fc13.src.rpm

Very few changes required to the spec file, just update the %svn version to the current date and run the ffmpeg-snapshot.sh script to download the current svn HEAD version.

Edit2:
Looking at the configure file for ffmpeg (revision 23544), I'm guessing that this is where it looks for the vpx files:

enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
enabled libvpx && require2 libvpx "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_dec_init_ver" -lvpx &&
require2 libvpx "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver" -lvpx

Looking through the file closer, the require2 function sets off a whole bunch of calls to other functions:

require2(){
name="$1"
headers="$2"
func="$3"
shift 3
check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
}

check_lib2(){
log check_lib2 "$@"
headers="$1"
func="$2"
shift 2
check_func_headers "$headers" $func "$@" && add_extralibs "$@"
}

check_func_headers(){
log check_func_headers "$@"
headers=$1
func=$2
shift 2
disable $func
incs=""
for hdr in $headers; do
incs="$incs
#include <$hdr>"
done
check_ld "$@" <<EOF && enable $func && enable_safe $headers
$incs
int main(int argc, char **argv){
return (long) $func;
}
EOF
}

check_ld(){
log check_ld "$@"
flags=''
libs=''
for f; do
test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
done
check_cc $($filter_cflags $flags) || return
check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
}

check_cc(){
log check_cc "$@"
cat > $TMPC
log_file $TMPC
check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
}

check_cmd(){
log "$@"
"$@" >> $logfile 2>&1
}

I'm wondering if somehow the libvpx files fail the one of the tests above, but to be honest it goes a bit beyond my coding knowledge!

It must be something simple, but I'm drawing a blank...
Any help much appreciated!

Thanks,
Rob

HeWhoWatches
10th June 2010, 03:08 AM
Solved I think... the current builds of libvpx in the fedora repo don't seem to work with the newest ffmpeg SVN. If I recreate the libvpx packages by getting the latest revision from git and tweak the SPEC file a tiny bit, then all is good and I get packages building...

Assuming I can convert a video to webm format and test it, I'll post back and mark the thread solved...

;)

---------- Post added at 03:08 AM CDT ---------- Previous post was at 01:06 AM CDT ----------

Success...

ffmpeg -i "freeman_s_mind_episode_28.wmv" -threads 2 "freeman_s_mind_episode_28.webm"

FFmpeg version SVN-r23556, Copyright (c) 2000-2010 the FFmpeg developers
built on Jun 10 2010 00:57:20 with gcc 4.4.4 20100503 (Red Hat 4.4.4-2)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --extra-version=rpmfusion --enable-bzlib --enable-libdc1394 --enable-libdirac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avfilter-lavf --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 50.18. 0 / 50.18. 0
libavcodec 52.75. 1 / 52.75. 1
libavformat 52.68. 0 / 52.68. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 0 / 1.20. 0
libswscale 0.11. 0 / 0.11. 0
libpostproc 51. 2. 0 / 51. 2. 0
[asf @ 0xd85690]max_analyze_duration reached

Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 30.00 (30/1)
Input #0, asf, from 'freeman_s_mind_episode_28.wmv':
Metadata:
WMFSDKVersion : 11.0.5721.5145
WMFSDKNeeded : 0.0.0.0000
IsVBR : 1
VBR Peak : 185
Buffer Average : 459
Duration: 00:09:50.16, start: 3.000000, bitrate: 1227 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, 2 channels, s16, 128 kb/s
Stream #0.1: Video: vc1, yuv420p, 672x384, 30 tbr, 1k tbn, 1k tbc
[libvpx @ 0xd8cd20]v0.9.0
Output #0, webm, to 'freeman_s_mind_episode_28.webm':
Metadata:
encoder : Lavf52.68.0
Stream #0.0: Video: libvpx, yuv420p, 672x384, q=2-31, 200 kb/s, 1k tbn, 30 tbc
Stream #0.1: Audio: libvorbis, 44100 Hz, 2 channels, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
frame=17704 fps= 27 q=0.0 Lsize= 28777kB time=589.79 bitrate= 399.7kbits/s dup=0 drop=1
video:24472kB audio:3931kB global headers:4kB muxing overhead 1.301686%

Tested using:
ffplay freeman_s_mind_episode_28.webm

So in order so far had to build x264, then libvpx, then ffmpeg... now due to the libx264.so.78()(64bit) dependency, I just need to build gstreamer-plugins-ugly, libquicktime, mencoder and vlc-core... :)

VLC from git is now throwing a random error, but that's a challenge for another day.

Will mark thread as solved