Best config for ffmpeg to convert MP3 file only - ffmpeg

I want to compile FFMPEG to support conversion from MP3 to WAV and WAV to MP3.
as I only need that task, and output compiled size is really matter to me, Please correct me best compile config that accompilesh my requirement.
here is full config file:
function build_ffmpeg
{
echo "Starting build ffmpeg for $ARCH"
cd ffmpeg
./configure --target-os=linux \
--prefix=$PREFIX \
--enable-cross-compile \
--extra-libs="-lgcc" \
--arch=$ARCH \
--cc=$CC \
--cross-prefix=$CROSS_COMPILE \
--nm=$NM \
--sysroot=$PLATFORM \
--extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \
--disable-shared \
--enable-static \
--enable-runtime-cpudetect \
--extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog -L$PREFIX/lib" \
--extra-cflags="-I$PREFIX/include" \
--disable-everything \
--enable-pthreads \
--enable-libass \
--enable-libvo-aacenc \
--enable-libvo-amrwbenc \
--enable-hwaccel=h264_vaapi \
--enable-hwaccel=h264_vaapi \
--enable-hwaccel=h264_dxva2 \
--enable-hwaccel=mpeg4_vaapi \
--enable-demuxer=mov \
--enable-demuxer=h264 \
--enable-demuxer=mpegvideo \
--enable-demuxer=h263 \
--enable-demuxer=mpegps \
--enable-demuxer=mjpeg \
--enable-demuxer=rtsp \
--enable-demuxer=rtp \
--enable-demuxer=hls \
--enable-demuxer=matroska \
--enable-muxer=rtsp \
--enable-muxer=mp4 \
--enable-muxer=mov \
--enable-muxer=mjpeg \
--enable-muxer=matroska \
--enable-protocol=crypto \
--enable-protocol=jni \
--enable-protocol=file \
--enable-encoder=libvo_amrwbenc \
--enable-decoder=amrwb \
--enable-muxer=mp2 \
--enable-bsfs \
--enable-decoders \
--enable-encoders \
--enable-parsers \
--enable-hwaccels \
--enable-muxers \
--enable-avformat \
--enable-avcodec \
--enable-avresample \
--enable-zlib \
--disable-doc \
--disable-ffplay \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avfilter \
--disable-avdevice \
--enable-nonfree \
--enable-version3 \
--enable-memalign-hack \
--enable-asm \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make -j4 install
make clean
cd ..
echo "FINISHED ffmpeg for $ARCH"
}
function build_one {
echo "Starting build one for $ARCH"
cd ffmpeg
${LD} -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -L$PREFIX/lib -soname $SONAME -shared -nostdlib -Bsymbolic --whole-archive --no-undefined -o $OUT_LIBRARY -lavcodec -lavformat -lavresample -lavutil -lswresample -lass -lfreetype -lfribidi -lswscale -lvo-aacenc -lvo-amrwbenc -lc -lm -lz -ldl -llog --dynamic-linker=/system/bin/linker -zmuldefs $PREBUILT/lib/gcc/$EABIARCH/$COMPILATOR_VERSION/libgcc.a
cd ..
echo "FINISHED one for $ARCH"
}

./configure --disable-all --disable-autodetect --disable-network --enable-pthreads \
--enable-avcodec --enable-avformat --enable-swresample --enable-avfilter \
--enable-libmp3lame --enable-parser=mpegaudio --enable-demuxer=mp3,wav \
--enable-muxer=mp3,wav --enable-decoder=pcm*,mp3* --enable-encoder=pcm*,libmp3lame \
--enable-filter=aresample --enable-protocol=file --enable-ffmpeg --enable-small
Consider using libshine instead of libmp3lame is you need faster, but lower quality, MP3 encoding (especially on architectures without a FPU).
I usually don't recommend using --disable-all, but the size of the executable seems to be the most important factor for you. Using --disable-everything is easier to use because it does not disable the FFmpeg libraries, and is therefore less prone to forgotten components.
--disable-small optimizes for size instead of speed. It does make a size difference (1 MB vs 1.4 MB in this example), but I'm not sure how much of a speed difference it makes.
I did not include any additional options you may need for compiling for or on Android.
This may not work for MP3 inputs that contain album art because I did not enable any video options (specifically JPG and PNG related components). You may get by that by mapping just the audio with the -map option, such as with -map 0:a.

Related

How to build ffmpeg with hardware decoding support for raspberry pi? (cross compilation if possible)

Is it possible to build ffmpeg with decoding support for Raspberry Pi? I've read that mmal can do hardware accelerated decoding on the Raspberry Pi.
I've tried on debian 10 x86_64:
./configure \
--prefix=${BUILD_DIR}/desktop/${FFMPEG_ARCH_FLAG} \
--disable-doc \
--enable-cross-compile \
--cross-prefix=${CROSS_PREFIX} \
--target-os=linux \
--arch=${FFMPEG_ARCH_FLAG} \
--extra-cflags="-O3 -fPIC $EXTRA_CFLAGS" \
--enable-mmal \
--enable-omx \
--enable-omx-rpi \
--enable-shared \
--disable-debug \
--disable-runtime-cpudetect \
--disable-programs \
--disable-muxers \
--disable-encoders \
--disable-bsfs \
--disable-pthreads \
--disable-avdevice \
--disable-network \
--disable-postproc
where CROSS_PREFIX=aarch64-linux-gnu- and FFMPEG_ARCH_FLAG=aarch64 but obviously I get ERROR: mmal not found. I couldn't find MMAL to compile and install.
This is possible. You can use this build script, which you will need to run on the Raspberry Pi itself. The part you probably care most about is towards the end:
git clone --depth 1 https://github.com/FFmpeg/FFmpeg.git ~/FFmpeg \
&& cd ~/FFmpeg \
&& ./configure \
--extra-cflags="-I/usr/local/include" \
--extra-ldflags="-L/usr/local/lib" \
--extra-libs="-lpthread -lm -latomic" \
--arch=armel \
--enable-gmp \
--enable-gpl \
--enable-libaom \
--enable-libass \
--enable-libdav1d \
--enable-libfdk-aac \
--enable-libfreetype \
--enable-libkvazaar \
--enable-libmp3lame \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
--enable-libopus \
--enable-librtmp \
--enable-libsnappy \
--enable-libsoxr \
--enable-libssh \
--enable-libvorbis \
--enable-libvpx \
--enable-libzimg \
--enable-libwebp \
--enable-libx264 \
--enable-libx265 \
--enable-libxml2 \
--enable-mmal \
--enable-nonfree \
--enable-omx \
--enable-omx-rpi \
--enable-version3 \
--target-os=linux \
--enable-pthreads \
--enable-openssl \
--enable-hardcoded-tables \
&& make -j$(nproc) \
&& sudo make install
Note this caveat from RaspberryPi.org:
MMAL is a Broadcom-specific API used only on VideoCore 4 systems
This makes me think the chances of cross-compiling are low, but you can always give it a shot with this script.
To build ffmpeg with mmal support you need to install the raspberry userland which provides the mmal interface. Note that mmal is not supported on 64bit userland systems (See https://github.com/raspberrypi/userland/issues/688)

minimal ffmpeg build without filters

I'm trying to build a minimal version of ffmpeg that is as small as possible, with only support to decode AAC audio in an MP4 container, and write it out to PCM or WAV.
For some reason though, I can't find a way to build ffmpeg without it including all of these filters:
Enabled filters:
aformat atrim hflip transpose vflip
anull format null trim
Is there any way to disable these?
I'm using this configure command:
./configure \
--disable-fast-unaligned \
--disable-pthreads \
--disable-w32threads \
--disable-os2threads \
--disable-debug \
--disable-stripping \
--disable-safe-bitstream-reader \
--disable-all \
--enable-ffmpeg \
--enable-avcodec \
--enable-avformat \
--enable-avfilter \
--disable-filters \
--enable-protocol=pipe \
--disable-swresample \
--disable-swscale \
--disable-network \
--disable-d3d11va \
--disable-dxva2 \
--disable-vaapi \
--disable-vdpau \
--enable-protocol=file \
--disable-bzlib \
--disable-iconv \
--disable-libxcb \
--disable-lzma \
--disable-sdl2 \
--disable-securetransport \
--disable-xlib \
--disable-zlib \
--enable-encoder=pcm_s16le \
--enable-muxer=pcm_s16le,wav \
--enable-demuxer=mov \
--enable-libfdk-aac \
--enable-nonfree \
--enable-decoder=libfdk_aac
The ffmpeg binary depends on libavfilter besides libavcodec and libavformat.
A few filters are selected to support some command-line options, e.g. trim/atrim for when input -ss is set and the streams are decoded, transpose and flip filters for when the input is to be autorotated. format/aformat for auto-inserted conversion from decoder output to encoder-supported format.

I am building ffmpeg now, but I always get an error after executing make

Configure parameter
/--
./configure --prefix=/usr/workspace/android --disable-static --enable-shared --disable-ffplay --disable-ffprobe --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --arch=arm --target-os=linux --cross-prefix=/usr/workspace/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi- --sysroot=/usr/workspace/ndk/platforms/android-21/arch-arm --extra-cflags="-Os -fpic $ADDI_CFLAGS" --extra-ldflags="$ADDI_LDFLAGS"
--/
make execution error
/--
In file included from ./libavformat/internal.h:24:0,
from libavdevice/alldevices.c:23:
/usr/workspace/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
# include_next <stdint.h>
^
compilation terminated.
make: *** [libavdevice/alldevices.o] Error 1
--/
Update to NDK r19 and use:
TOOLCHAIN=$NDK/toolchains/llvm/prebuilt/linux-x86_64/
./configure \
--arch=arm \
--target-os=android \
--cc=$TOOLCHAIN/bin/armv7a-linux-androideabi21-clang \
--cxx=$TOOLCHAIN/bin/armv7a-linux-androideabi21-clang++ \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--extra-cflags="-Os -fpic" \
--disable-static \
--enable-shared \
--disable-ffplay \
--disable-ffprobe \
--disable-htmlpages \
--disable-manpages \
--disable-podpages \
--disable-txtpages
If for some reason you can't update your NDK, you need to use https://developer.android.com/ndk/guides/standalone_toolchain.

Unable to convert MP3 file to PCM with ffmpeg

I have compiled ffmpeg to convert mp3 file with this config, as the ffmpeg output size is matter to me, I have disabled everything in ffmpeg:
#!/bin/bash
. abi_settings.sh $1 $2 $3
pushd ffmpeg
case $1 in
armeabi-v7a | armeabi-v7a-neon)
CPU='cortex-a8'
;;
x86)
CPU='i686'
;;
esac
make clean
./configure \
--target-os="$TARGET_OS" \
--cross-prefix="$CROSS_PREFIX" \
--arch="$NDK_ABI" \
--cpu="$CPU" \
--enable-runtime-cpudetect \
--sysroot="$NDK_SYSROOT" \
--disable-all \
--disable-network \
--enable-avcodec \
--enable-avformat \
--enable-swresample \
--enable-avfilter \
--enable-parser=mpegaudio \
--enable-demuxer=mp3,wav \
--enable-muxer=mp3,wav \
--enable-decoder=pcm*,mp3*\
--enable-encoder=pcm*,libmp3lame \
--enable-filter=aresample \
--enable-protocol=file \
--enable-ffmpeg \
--enable-libmp3lame \
--enable-pthreads \
--disable-debug \
--disable-ffserver \
--enable-version3 \
--enable-hardcoded-tables \
--disable-ffplay \
--disable-ffprobe \
--enable-gpl \
--enable-yasm \
--disable-doc \
--disable-shared \
--enable-static \
--enable-small \
--enable-nonfree \
--pkg-config="${2}/ffmpeg-pkg-config" \
--prefix="${2}/build/${1}" \
--extra-cflags="-I${TOOLCHAIN_PREFIX}/include $CFLAGS" \
--extra-ldflags="-L${TOOLCHAIN_PREFIX}/lib $LDFLAGS" \
--extra-libs="-lm" \
--extra-cxxflags="$CXX_FLAGS" || exit 1
make -j${NUMBER_OF_CORES} && make install || exit 1
popd
but when I want to convert mp3 to pcm, I get this error:
configuration: --target-os=linux --cross-prefix=/root/ffmpeg2/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/root/ffmpeg2/ffmpeg-android/toolchain-android/sysroot --disable-all --disable-network --enable-avcodec --enable-avformat --enable-swresample --enable-avfilter --enable-parser=mpegaudio --enable-demuxer='mp3,wav' --enable-muxer='mp3,wav' --enable-decoder='pcm*,mp3*--enable-encoder=pcm*,libmp3lame' --enable-filter=aresample --enable-protocol=file --enable-ffmpeg --enable-libmp3lame --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --enable-small --enable-nonfree --pkg-config=/root/ffmpeg2/ffmpeg-android/ffmpeg-pkg-config --prefix=/root/ffmpeg2/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/root/ffmpeg2/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/root/ffmpeg2/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs=-lm --extra-cxxflags=
libavutil 55. 17.103 / 55. 17.103
libavcodec 57. 24.102 / 57. 24.102
libavformat 57. 25.100 / 57. 25.100
libavfilter 6. 31.100 / 6. 31.100
libswresample 2. 0.101 / 2. 0.101
[mp3 # 0xb72041d0] Skipping 0 bytes of junk at 0.
[mp3 # 0xb72041d0] Estimating duration from bitrate, this may be inaccurate
[mp3 # 0xb72041d0] Could not find codec parameters for stream 0 (Audio: mp3, 44100 Hz, 1 channels, 256 kb/s): unspecified frame size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
/storage/emulated/0/Android/data/com.edspace.alefba/files/alefba/page/voices/109/cource_1.mp3: could not find codec parameters
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, mp3, from '/storage/emulated/0/Android/data/com.edspace.alefba/files/alefba/page/voices/109/cource_1.mp3':
Duration: 00:00:08.67, start: 0.000000, bitrate: 256 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, 1 channels, 256 kb/s
[NULL # 0xb7242370] Requested output format 's16le' is not a suitable output format
/storage/emulated/0/Android/data/com.edspace.alefba/files/alefba/page/voices/109/cource_1.pcm: Invalid
what should I change in configure parameters to make it work?
EDIT:
it seem that the problem is with output format:
Requested output format 's16le' is not a suitable output format , but I do not know how can I fix that
Change to
--enable-muxer=mp3,pcm_s16le,wav \

Apache tomcat catalina springsource bundle is not RESOLVED on equinox OSGi container

I have a java application in which I start Equinox OSGi container (version 3.10.1.v20140909-1633) and load apache catalina springsource bundle com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956 and other dependent bundles.
Following is my config.ini file.
eclipse.ignoreApp=true
# custom org.osgi.framework.system.packages to export javax.activation and javax.xml.bind.* with a non-0.0.0 version
org.osgi.framework.system.packages=javax.accessibility; version="0.0.0", \
javax.activation; version="1.1.0", \
javax.activity; version="0.0.0", \
javax.annotation; version="0.0.0", \
javax.annotation.processing; version="0.0.0", \
javax.crypto; version="0.0.0", \
javax.crypto.interfaces; version="0.0.0", \
javax.crypto.spec; version="0.0.0", \
javax.imageio; version="0.0.0", \
javax.imageio.event; version="0.0.0", \
javax.imageio.metadata; version="0.0.0", \
javax.imageio.plugins.bmp; version="0.0.0", \
javax.imageio.plugins.jpeg; version="0.0.0", \
javax.imageio.spi; version="0.0.0", \
javax.imageio.stream; version="0.0.0", \
javax.jws; version="0.0.0", \
javax.jws.soap; version="0.0.0", \
javax.lang.model; version="0.0.0", \
javax.lang.model.element; version="0.0.0", \
javax.lang.model.type; version="0.0.0", \
javax.lang.model.util; version="0.0.0", \
javax.management; version="0.0.0", \
javax.management.loading; version="0.0.0", \
javax.management.modelmbean; version="0.0.0", \
javax.management.monitor; version="0.0.0", \
javax.management.openmbean; version="0.0.0", \
javax.management.relation; version="0.0.0", \
javax.management.remote; version="0.0.0", \
javax.management.remote.rmi; version="0.0.0", \
javax.management.timer; version="0.0.0", \
javax.naming; version="0.0.0", \
javax.naming.directory; version="0.0.0", \
javax.naming.event; version="0.0.0", \
javax.naming.ldap; version="0.0.0", \
javax.naming.spi; version="0.0.0", \
javax.net; version="0.0.0", \
javax.net.ssl; version="0.0.0", \
javax.print; version="0.0.0", \
javax.print.attribute; version="0.0.0", \
javax.print.attribute.standard; version="0.0.0", \
javax.print.event; version="0.0.0", \
javax.rmi; version="0.0.0", \
javax.rmi.CORBA; version="0.0.0", \
javax.rmi.ssl; version="0.0.0", \
javax.script; version="0.0.0", \
javax.security.auth; version="0.0.0", \
javax.security.auth.callback; version="0.0.0", \
javax.security.auth.kerberos; version="0.0.0", \
javax.security.auth.login; version="0.0.0", \
javax.security.auth.spi; version="0.0.0", \
javax.security.auth.x500; version="0.0.0", \
javax.security.cert; version="0.0.0", \
javax.security.sasl; version="0.0.0", \
javax.sound.midi; version="0.0.0", \
javax.sound.midi.spi; version="0.0.0", \
javax.sound.sampled; version="0.0.0", \
javax.sound.sampled.spi; version="0.0.0", \
javax.sql; version="0.0.0", \
javax.sql.rowset; version="0.0.0", \
javax.sql.rowset.serial; version="0.0.0", \
javax.sql.rowset.spi; version="0.0.0", \
javax.swing; version="0.0.0", \
javax.swing.border; version="0.0.0", \
javax.swing.colorchooser; version="0.0.0", \
javax.swing.event; version="0.0.0", \
javax.swing.filechooser; version="0.0.0", \
javax.swing.plaf; version="0.0.0", \
javax.swing.plaf.basic; version="0.0.0", \
javax.swing.plaf.metal; version="0.0.0", \
javax.swing.plaf.multi; version="0.0.0", \
javax.swing.plaf.synth; version="0.0.0", \
javax.swing.table; version="0.0.0", \
javax.swing.text; version="0.0.0", \
javax.swing.text.html; version="0.0.0", \
javax.swing.text.html.parser; version="0.0.0", \
javax.swing.text.rtf; version="0.0.0", \
javax.swing.tree; version="0.0.0", \
javax.swing.undo; version="0.0.0", \
javax.tools; version="0.0.0", \
javax.transaction; version="0.0.0", \
javax.transaction.xa; version="0.0.0", \
javax.xml; version="0.0.0", \
javax.xml.bind; version="2.1.0", \
javax.xml.bind.annotation; version="2.1.0", \
javax.xml.bind.annotation.adapters; version="2.1.0", \
javax.xml.bind.attachment; version="2.1.0", \
javax.xml.bind.helpers; version="2.1.0", \
javax.xml.bind.util; version="2.1.0", \
javax.xml.crypto; version="0.0.0", \
javax.xml.crypto.dom; version="0.0.0", \
javax.xml.crypto.dsig; version="0.0.0", \
javax.xml.crypto.dsig.dom; version="0.0.0", \
javax.xml.crypto.dsig.keyinfo; version="0.0.0", \
javax.xml.crypto.dsig.spec; version="0.0.0", \
javax.xml.datatype; version="0.0.0", \
javax.xml.namespace; version="0.0.0", \
javax.xml.parsers; version="0.0.0", \
javax.xml.soap; version="0.0.0", \
javax.xml.stream; version="0.0.0", \
javax.xml.stream.events; version="0.0.0", \
javax.xml.stream.util; version="0.0.0", \
javax.xml.transform; version="0.0.0", \
javax.xml.transform.dom; version="0.0.0", \
javax.xml.transform.sax; version="0.0.0", \
javax.xml.transform.stax; version="0.0.0", \
javax.xml.transform.stream; version="0.0.0", \
javax.xml.validation; version="0.0.0", \
javax.xml.ws; version="0.0.0", \
javax.xml.ws.handler; version="0.0.0", \
javax.xml.ws.handler.soap; version="0.0.0", \
javax.xml.ws.http; version="0.0.0", \
javax.xml.ws.soap; version="0.0.0", \
javax.xml.ws.spi; version="0.0.0", \
javax.xml.xpath; version="0.0.0", \
org.ietf.jgss; version="0.0.0", \
org.omg.CORBA; version="0.0.0", \
org.omg.CORBA_2_3; version="0.0.0", \
org.omg.CORBA_2_3.portable; version="0.0.0", \
org.omg.CORBA.DynAnyPackage; version="0.0.0", \
org.omg.CORBA.ORBPackage; version="0.0.0", \
org.omg.CORBA.portable; version="0.0.0", \
org.omg.CORBA.TypeCodePackage; version="0.0.0", \
org.omg.CosNaming; version="0.0.0", \
org.omg.CosNaming.NamingContextExtPackage; version="0.0.0", \
org.omg.CosNaming.NamingContextPackage; version="0.0.0", \
org.omg.Dynamic; version="0.0.0", \
org.omg.DynamicAny; version="0.0.0", \
org.omg.DynamicAny.DynAnyFactoryPackage; version="0.0.0", \
org.omg.DynamicAny.DynAnyPackage; version="0.0.0", \
org.omg.IOP; version="0.0.0", \
org.omg.IOP.CodecFactoryPackage; version="0.0.0", \
org.omg.IOP.CodecPackage; version="0.0.0", \
org.omg.Messaging; version="0.0.0", \
org.omg.PortableInterceptor; version="0.0.0", \
org.omg.PortableInterceptor.ORBInitInfoPackage; version="0.0.0", \
org.omg.PortableServer; version="0.0.0", \
org.omg.PortableServer.CurrentPackage; version="0.0.0", \
org.omg.PortableServer.POAManagerPackage; version="0.0.0", \
org.omg.PortableServer.POAPackage; version="0.0.0", \
org.omg.PortableServer.portable; version="0.0.0", \
org.omg.PortableServer.ServantLocatorPackage; version="0.0.0", \
org.omg.SendingContext; version="0.0.0", \
org.omg.stub.java.rmi; version="0.0.0", \
org.w3c.dom; version="0.0.0", \
org.w3c.dom.bootstrap; version="0.0.0", \
org.w3c.dom.css; version="0.0.0", \
org.w3c.dom.events; version="0.0.0", \
org.w3c.dom.html; version="0.0.0", \
org.w3c.dom.ls; version="0.0.0", \
org.w3c.dom.ranges; version="0.0.0", \
org.w3c.dom.stylesheets; version="0.0.0", \
org.w3c.dom.traversal; version="0.0.0", \
org.w3c.dom.views; version="0.0.0", \
org.xml.sax; version="0.0.0", \
org.xml.sax.ext; version="0.0.0", \
org.xml.sax.helpers; version="0.0.0"
#
# derby and mysql must appear before com.castiron.drivers
#
osgi.bundles=acme/org.apache.derbyclient-10.8.3.3.jar#1:start, \
acme/org.apache.derby-10.8.3.3.jar#1:start, \
acme/com.castiron.drivers-1.0.0.jar#1:start, \
acme/org.apache.openjpa-2.2.0.jar#1:start, \
com.approuter.jpa.fragment-1.0.0.jar#1, \
acme/com.springsource.serp-1.13.1.jar#1:start, \
acme/org.apache.commons-dbcp-1.2.2.jar#1:start, \
acme/com.springsource.org.apache.commons.pool-1.5.3.jar#1:start, \
acme/com.springsource.org.apache.xmlcommons-1.3.3.jar#1:start, \
acme/com.springsource.javax.xml.soap-1.3.0.jar#1:start, \
acme/javax.xml.rpc-1.1.0.jar#1:start, \
acme/com.springsource.javax.ejb-3.0.0.jar#1:start, \
com.approuter.ejb.fragment-1.0.0.jar#1, \
acme/com.springsource.javax.management.j2ee-1.0.1.jar#1:start, \
acme/javax.jms-1.1.0.jar#1:start, \
acme/com.springsource.org.apache.activemq-5.3.0.jar#1:start, \
acme/com.springsource.org.apache.kahadb-5.3.0.jar#1:start, \
acme/org.apache.camel-1.3.0.jar#1:start, \
acme/org.apache.hadoop-2.2.0.jar#1:start, \
acme/org.javassist-3.13.0.jar#1:start, \
acme/net.sf.ehcache-1.6.jar#1:start, \
acme/org.hibernate-3.2.5.jar#1:start, \
acme/javax.interceptor-1.1.jar#1:start, \
acme/org.apache.webbeans-1.0.0.jar#3:start, \
acme/org.stax-ex-1.0.0.jar#1:start, \
acme/com.xmlrpc-1.2.jar#:start, \
acme/com.saaj-impl-1.3.0.jar#1:start, \
acme/com.jaxb-impl-2.1.12.jar#1:start, \
acme/com.jaxws-rt-2.1.7.jar#1:start, \
acme/com.xml-streambuffer-0.8.jar#1:start, \
acme/com.ibm.xml.xlxp-1.1.14.jar#1:start, \
acme/antlr-2.7.7.jar#1:start, \
acme/com.springsource.commonj-1.1.0.jar#1:start, \
acme/net.sf.cglib-2.1.3.jar#1:start, \
acme/com.springsource.org.apache.commons.collections-3.2.1.jar#1:start, \
acme/com.springsource.org.apache.commons.io-1.4.0.jar#1:start, \
acme/com.springsource.org.apache.commons.logging-1.1.1.jar#1:start, \
acme/com.springsource.org.apache.log4j-1.2.15.jar#1:start, \
com.approuter.log4j.fragment-1.0.0.jar#1, \
acme/com.springsource.org.dom4j-1.6.1.jar#1:start, \
acme/com.springsource.org.jaxen-1.1.1.jar#1:start, \
acme/com.springsource.javax.xml.stream-1.0.1.jar#1:start, \
acme/com.springsource.org.objectweb.asm-1.5.3.jar#1:start, \
acme/com.springsource.org.objectweb.asm.attrs-1.5.3.jar#1:start, \
acme/spring-osgi-extender-1.2.0.jar#1:start, \
acme/spring-osgi-core-1.2.0.jar#1:start, \
acme/spring-osgi-io-1.2.0.jar#1:start, \
acme/spring-core-2.5.6.jar#1:start, \
acme/spring-context-2.5.6.jar#1:start, \
acme/spring-beans-2.5.6.jar#1:start, \
acme/spring-aop-2.5.6.jar#1:start, \
acme/spring-web-2.5.6.jar#1:start, \
acme/spring-webmvc-2.5.6.jar#1:start, \
acme/com.springsource.org.aopalliance-1.0.0.jar#1:start, \
acme/com.springsource.slf4j.org.apache.commons.logging-1.5.0.jar#1:start, \
acme/com.springsource.slf4j.api-1.5.0.jar#1:start, \
acme/com.springsource.slf4j.log4j-1.5.0.jar#1:start, \
acme/com.springsource.org.apache.el.springsource-6.0.20.S2-r5956.jar#1:start, \
acme/com.springsource.org.apache.jasper.springsource-6.0.20.S2-r5956.jar#1, \
acme/com.springsource.org.apache.jasper.org.eclipse.jdt-6.0.16.jar#1:start, \
acme/com.springsource.org.apache.juli.extras.springsource-6.0.20.S2-r5956.jar#1:start, \
acme/com.springsource.org.apache.coyote.springsource-6.0.20.S2-r5956.jar#1, \
acme/com.springsource.javax.el-2.1.0.jar#1:start, \
acme/com.springsource.javax.servlet-2.5.0.jar#1:start, \
acme/com.springsource.javax.servlet.jsp-2.1.0.jar#1:start, \
acme/com.springsource.javax.servlet.jsp.jstl-1.1.2.jar#1:start, \
acme/com.springsource.org.apache.commons.el-1.0.0.jar#1:start, \
acme/com.springsource.org.apache.taglibs.standard-1.1.2.jar#1:start, \
acme/com.springsource.javax.annotation-1.0.0.jar#1:start, \
acme/com.springsource.javax.persistence-1.0.0.jar#1:start, \
acme/com.springsource.javax.transaction-1.1.0.jar#1:start, \
acme/com.springsource.javax.xml.ws-2.1.1.jar#1:start, \
acme/javax.mail-1.4.jar#1:start, \
acme/com.springsource.org.apache.catalina.springsource-6.0.20.S2-r5956.jar#5:start, \
com.approuter.catalina.start-1.0.0.jar#5:start, \
com.approuter.catalina.fragment-1.0.0.jar#5, \
com.approuter.catalina.realm-1.0.0.jar#5:start, \
com.approuter.spring.osgi.web.fragment-1.0.0.jar#6, \
com.approuter.spring.osgi.web.extender.fragment-1.0.0.jar#6, \
acme/spring-osgi-web-1.2.0.jar#6:start, \
acme/spring-osgi-web-extender-1.2.0.jar#6:start, \
com.approuter.system.configure-1.0.0.jar#1:start, \
com.approuter.system.configure.analytics-1.0.0.jar#1:start, \
wmc.war#7:start, \
acme/net.sf.saxon-9.1.0.7.jar#1:start, \
acme/org.apache.xmlbeans-2.4.0.jar#1:start, \
acme/com.springsource.com.thoughtworks.xstream-1.3.0.jar#1:start, \
acme/com.springsource.com.lowagie.text-2.0.8.jar#1:start, \
acme/com.springsource.javax.management.j2ee-1.0.1.jar#1:start, \
acme/com.springsource.org.apache.commons.codec-1.3.0.jar#1:start, \
acme/org.apache.commons-dbcp-1.2.2.jar#1:start, \
acme/com.springsource.org.apache.commons.fileupload-1.2.0.jar#1:start, \
acme/org.apache.httpcomponents.httpcore_4.2.4.jar#1:start, \
acme/org.apache.httpcomponents.httpclient_4.2.5.jar#1:start, \
acme/com.springsource.org.apache.commons.lang-2.4.0.jar#1:start, \
acme/com.springsource.org.apache.commons.net-1.4.1.jar#1:start, \
acme/com.springsource.org.apache.xbean.spring-3.3.0.jar#1:start, \
acme/com.springsource.org.apache.xerces-2.8.1.jar#1:start, \
acme/com.springsource.org.apache.xml.resolver-1.2.0.jar#1:start, \
acme/org.quartz-1.8.6.jar#1:start, \
com.approuter.quartz_scheduler-1.0.0.jar#1:start, \
acme/com.springsource.org.xmlpull-1.1.3.4-O.jar#1:start, \
com.approuter.common-base-1.0.0.jar#1:start, \
com.approuter.common-1.0.0.jar#1:start, \
com.approuter.module.connectorrepository-1.0.0.jar#1:start, \
com.approuter.deploy.arrepo-1.0.0.jar#1:start, \
com.approuter.logging-1.0.0.jar#1:start, \
com.approuter.maestro.sdk-1.0.0.jar#1:start, \
com.approuter.maestro-1.0.0.jar#1, \
com.approuter.module.common-1.0.0.jar#1:start, \
com.approuter.orcmon-1.0.0.jar#1:start, \
acme/com.xerox.amazonws.typica-1.6.jar#1:start, \
com.approuter.sysconf-1.0.0.jar#1:start, \
com.approuter.security-1.0.0.jar#1:start, \
com.approuter.module.projects-1.0.0.jar#2:start, \
com.approuter.module.thirdparty-1.0.0.jar#2:start, \
com.approuter.module.manageappliances-1.0.0.jar#2:start, \
com.approuter.agent.configuration-1.0.0.jar#1:start, \
com.approuter.module.capacitymeter-1.0.0.jar#4, \
acme/com.hector-0.7.0-31.jar#1:start, \
com.approuter.agent.management-1.0.0.jar#1:start, \
com.approuter.pki-1.0.0.jar#4:start, \
com.approuter.module.pip.repository-1.0.0.jar#4:start, \
org.eclipse.equinox.common#2:start, \
org.eclipse.update.configurator#3:start
# start all bundles up to start level 8
osgi.startLevel=8
When I connect to OSGi console and list all bundles with ss command I see the following result
"Framework is launched."
id State Bundle
0 ACTIVE org.eclipse.osgi_3.10.1.v20140909-1633
Fragments=1
1 RESOLVED com.approuter.eclipse.osgi.fragment_1.0.0
Master=0
2 ACTIVE org.apache.derbyclient_10.8.3.3
3 ACTIVE org.apache.derby_10.8.3.3
4 ACTIVE com.castiron.drivers_1.0.0
5 ACTIVE com.springsource.serp_1.13.1
6 ACTIVE org.apache.commons-dbcp_1.2.2
7 ACTIVE com.springsource.org.apache.commons.pool_1.5.3
8 ACTIVE com.springsource.org.apache.xmlcommons_1.3.3
9 ACTIVE com.springsource.javax.xml.soap_1.3.0
10 ACTIVE javax.xml.rpc_1.1.0
11 ACTIVE com.springsource.javax.ejb_3.0.0
Fragments=12
12 RESOLVED com.approuter.ejb.fragment_1.0.0
Master=11
13 ACTIVE com.springsource.javax.management.j2ee_1.0.1
14 ACTIVE javax.jms_1.1.0
15 ACTIVE com.springsource.org.apache.activemq_5.3.0
16 ACTIVE com.springsource.org.apache.kahadb_5.3.0
17 ACTIVE org.apache.camel_1.3.0
18 ACTIVE org.apache.hadoop_2.2.0
19 ACTIVE org.javassist_3.13.0
20 ACTIVE net.sf.ehcache_1.6.0
21 ACTIVE org.hibernate_3.2.5
22 ACTIVE javax.interceptor_1.1.0
23 ACTIVE org.apache.webbeans_1.0.0
24 ACTIVE org.stax-ex_1.0.0
25 ACTIVE com.xmlrpc_1.2.0
26 ACTIVE com.saaj-impl_1.3.0
27 ACTIVE com.jaxb-impl_2.1.12
28 ACTIVE com.jaxws-rt_2.1.7
29 ACTIVE com.xml-streambuffer_0.8.0
30 ACTIVE com.ibm.xml.xlxp_1.1.14
31 ACTIVE antlr_2.7.7
32 ACTIVE com.springsource.commonj_1.1.0
33 ACTIVE net.sf.cglib_2.1.3
34 ACTIVE com.springsource.org.apache.commons.collections_3.2.1
35 ACTIVE com.springsource.org.apache.commons.io_1.4.0
36 ACTIVE com.springsource.org.apache.commons.logging_1.1.1
37 ACTIVE com.springsource.org.apache.log4j_1.2.15
Fragments=38
38 RESOLVED com.approuter.log4j.fragment_1.0.0
Master=37
39 ACTIVE com.springsource.org.dom4j_1.6.1
40 ACTIVE com.springsource.org.jaxen_1.1.1
41 ACTIVE com.springsource.javax.xml.stream_1.0.1
42 ACTIVE com.springsource.org.objectweb.asm_1.5.3
43 ACTIVE com.springsource.org.objectweb.asm.tree.attrs_1.5.3
44 ACTIVE org.springframework.osgi.extender_1.2.0
45 ACTIVE org.springframework.osgi.core_1.2.0
46 ACTIVE org.springframework.osgi.io_1.2.0
47 ACTIVE org.springframework.core_2.5.6
48 ACTIVE org.springframework.context_2.5.6
49 ACTIVE org.springframework.beans_2.5.6
50 ACTIVE org.springframework.aop_2.5.6
51 ACTIVE org.springframework.web_2.5.6
52 ACTIVE org.springframework.web.servlet_2.5.6
53 ACTIVE com.springsource.org.aopalliance_1.0.0
54 ACTIVE com.springsource.slf4j.org.apache.commons.logging_1.5.0
55 ACTIVE com.springsource.slf4j.api_1.5.0
56 ACTIVE com.springsource.slf4j.log4j_1.5.0
57 ACTIVE com.springsource.org.apache.el.springsource_6.0.20.S2-r5956
58 INSTALLED com.springsource.org.apache.jasper.springsource_6.0.20.S2-r5956
59 ACTIVE com.springsource.org.apache.jasper.org.eclipse.jdt_6.0.16
60 ACTIVE com.springsource.org.apache.juli.extras.springsource_6.0.20.S2-r5956
61 INSTALLED com.springsource.org.apache.coyote.springsource_6.0.20.S2-r5956
62 ACTIVE com.springsource.javax.el_2.1.0
63 ACTIVE com.springsource.javax.servlet_2.5.0
64 ACTIVE com.springsource.javax.servlet.jsp_2.1.0
65 ACTIVE com.springsource.javax.servlet.jsp.jstl_1.1.2
66 ACTIVE com.springsource.org.apache.commons.el_1.0.0
67 ACTIVE com.springsource.org.apache.taglibs.standard_1.1.2
68 ACTIVE com.springsource.javax.annotation_1.0.0
69 ACTIVE com.springsource.javax.persistence_1.0.0
70 ACTIVE com.springsource.javax.transaction_1.1.0
71 ACTIVE com.springsource.javax.xml.ws_2.1.1
72 ACTIVE javax.mail_1.4.0
73 INSTALLED com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956
74 INSTALLED com.approuter.catalina.start_1.0.0
75 INSTALLED com.approuter.catalina.fragment_1.0.0
76 ACTIVE com.approuter.catalina.realm_1.0.0
77 RESOLVED com.approuter.spring.osgi.web.fragment_1.0.0
Master=79
78 RESOLVED com.approuter.spring.osgi.web.extender.fragment_1.0.0
Master=80
79 ACTIVE org.springframework.osgi.web_1.2.0
Fragments=77
80 RESOLVED org.springframework.osgi.web.extender_1.2.0
Fragments=78
81 ACTIVE com.approuter.system.configure_1.0.0
82 ACTIVE com.approuter.system.configure.analytics_1.0.0
85 INSTALLED com.approuter.nmc_0.0.0
86 ACTIVE net.sf.saxon_9.1.0.7
87 ACTIVE org.apache.xmlbeans_2.4.0
88 ACTIVE com.springsource.com.thoughtworks.xstream_1.3.0
89 ACTIVE com.springsource.com.lowagie.text_2.0.8
90 ACTIVE com.springsource.org.apache.commons.codec_1.3.0
91 ACTIVE com.springsource.org.apache.commons.fileupload_1.2.0
92 ACTIVE org.apache.httpcomponents.httpcore_4.4.0
93 ACTIVE org.apache.httpcomponents.httpclient_4.4.0
94 ACTIVE com.springsource.org.apache.commons.lang_2.4.0
95 ACTIVE com.springsource.org.apache.commons.net_1.4.1
96 ACTIVE com.springsource.org.apache.xbean.spring_3.3.0
97 ACTIVE com.springsource.org.apache.xerces_2.8.1
98 ACTIVE com.springsource.org.apache.xml.resolver_1.2.0
99 ACTIVE org.quartz_1.8.6
100 ACTIVE com.springsource.org.xmlpull_1.1.3.4-O
101 ACTIVE com.approuter.common-base_1.0.0
102 ACTIVE com.approuter.common_1.0.0
103 ACTIVE com.approuter.module.connectorrepository_1.0.0
104 ACTIVE com.approuter.deploy.arrepo_1.0.0
ACTIVE com.approuter.logging_1.0.0
106 ACTIVE com.approuter.maestro.sdk_1.0.0
107 RESOLVED com.approuter.maestro_1.0.0
108 ACTIVE com.approuter.module.common_1.0.0
109 ACTIVE com.approuter.orcmon_1.0.0
110 ACTIVE com.xerox.amazonws.typica_1.6.0
111 ACTIVE com.approuter.sysconf_1.0.0
113 ACTIVE com.approuter.module.projects_1.0.0
114 ACTIVE com.approuter.module.thirdparty_1.0.0
115 ACTIVE com.approuter.module.manageappliances_1.0.0
116 ACTIVE com.approuter.agent.configuration_1.0.0
117 RESOLVED com.approuter.module.capacitymeter_1.0.0
118 ACTIVE com.hector_0.7.0.31
119 ACTIVE com.approuter.agent.management_1.0.0
120 RESOLVED com.approuter.pki_1.0.0
121 ACTIVE com.approuter.module.pip.repository_1.0.0
122 ACTIVE org.eclipse.equinox.common_3.6.200.v20130402-1505
123 ACTIVE org.apache.felix.gogo.command_0.10.0.v201209301215
124 ACTIVE org.apache.felix.gogo.runtime_0.10.0.v201209301036
125 ACTIVE org.apache.felix.gogo.shell_0.10.0.v201212101605
126 ACTIVE org.eclipse.equinox.console_1.1.0.v20140131-1639
127 ACTIVE org.apache.felix.fileinstall_3.4.0
128 ACTIVE org.eclipse.osgi.services_3.4.0.v20140312-2051
Here the bundles com.springsource.org.apache.jasper.springsource_6.0.20.S2-r5956 and com.springsource.org.apache.coyote.springsource_6.0.20.S2-r5956 are fragment bundles whose parent bundle is com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956.
We can see that all these 3 bundles are just INSTALLED.
When I tried to start the bundle com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956 manually with the command start 73, I see following exception.
gogo: BundleException: Could not resolve module: com.springsource.org.apache.catalina.springsource [73]
Unresolved requirement: Import-Package: org.apache.coyote; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.coyote; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.coyote.springsource"; version="6.0.20.S2-r5956"; uses:="javax.management,org.apache.tomcat.util.buf,org.apache.tomcat.util.http,org.apache.tomcat.util.net"
com.springsource.org.apache.coyote.springsource [61]
Unresolved requirement: Import-Package: org.apache.catalina.deploy; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.catalina.deploy; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.catalina.springsource"; version="6.0.20.S2-r5956"
Unresolved requirement: Import-Package: org.apache.catalina; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.catalina; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.catalina.springsource"; version="6.0.20.S2-r5956"; uses:="javax.naming.directory,javax.servlet,javax.servlet.http,org.apache.catalina.connector,org.apache.catalina.deploy,org.apache.catalina.util,org.apache.juli.logging,org.apache.tomcat,org.apache.tomcat.util.http.mapper"
Unresolved requirement: Fragment-Host: com.springsource.org.apache.catalina.springsource; bundle-version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Bundle-SymbolicName: com.springsource.org.apache.catalina.springsource; bundle-version="6.0.20.S2-r5956"
Unresolved requirement: Import-Package: org.apache.coyote.http11; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.coyote.http11; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.coyote.springsource"; version="6.0.20.S2-r5956"; uses:="javax.management,org.apache.coyote,org.apache.tomcat.util.buf,org.apache.tomcat.util.net"
Unresolved requirement: Import-Package: org.apache.coyote.ajp; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.coyote.ajp; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.coyote.springsource"; version="6.0.20.S2-r5956"; uses:="javax.management,org.apache.coyote,org.apache.tomcat.util.buf,org.apache.tomcat.util.net"
Unresolved requirement: Import-Package: org.apache.tomcat; version="[6.0.20.S2-r5956,6.0.20.S2-r5956]"
-> Export-Package: org.apache.tomcat; bundle-version="6.0.20.S2-r5956"; bundle-symbolic-name="com.springsource.org.apache.jasper.springsource"; version="6.0.20.S2-r5956"; uses:="javax.servlet"
com.springsource.org.apache.jasper.springsource [58]
Unresolved requirement: Import-Package: org.apache.tools.ant; version="[1.7.0,2.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: org.apache.tools.ant.taskdefs; version="[1.7.0,2.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: org.apache.tools.ant.types; version="[1.7.0,2.0.0)"; resolution:="optional"
Unresolved requirement: Import-Package: org.apache.tools.ant.util; version="[1.7.0,2.0.0)"; resolution:="optional"
Unresolved requirement: Fragment-Host: com.springsource.org.apache.catalina.springsource; version="[6.0.20.S2-r5956, 6.0.20.S2-r5956]"
But when I looked at the Import and Export packages of both coyote and Jasper bundles, its proper. In fact they are taken from springsource repository.
I did not get the missing constraints for the bundle com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956.
Here which bundle will be resolved first ? Is it parent bundle or fragments ?
How do I resolve this to make sure all the bundles are resolved and successfully start the bundle com.springsource.org.apache.catalina.springsource_6.0.20.S2-r5956
Parent bundles are resolved first. After the parents are resolved than fragments get attached to their respective parents. I'd suggest to use latest equinox jar as well. It's easier to resolve these kind of errors by debugging using equinox shell commands. For example, in your case you can check who is exporting the package "org.apache.coyote" by using the command packages org.apache.coyote.

Resources