
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (47)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...)
Sur d’autres sites (7974)
-
React-Native / XCode : Build Failing for ffmpeg
18 février 2021, par tiafouroohiTrying to build a react-native app for ios, but build is failing due to problem below :


ld: in /Users/tialifouroohi/Desktop/GitHub/SocialNetworkWrapper-ReactNative/InstagramClone/ios/Pods/mobile-ffmpeg-https/libavcodec.framework/libavcodec(aacencdsp.o), building for iOS Simulator, but linking in object file built for free standing, file '/Users/tialifouroohi/Desktop/GitHub/SocialNetworkWrapper-ReactNative/InstagramClone/ios/Pods/mobile-ffmpeg-https/libavcodec.framework/libavcodec' for architecture x86_64



React-Native version : 0.63.2
XCode Version : 12.4
Build Target ios version : 13.6


What can I change or do to make the build succeed ?


-
iOS Build PJSIP with FFmpeg+libx264
22 février 2021, par MeonardoI have built the FFmpeg with libx264 into static libs, here is my directory tree.


./ffmpeg
├── include
│   ├── libavcodec
│   │   ├── ac3_parser.h
│   │   ├── adts_parser.h
│   │   ├── avcodec.h
│   │   ├── avdct.h
│   │   ├── avfft.h
│   │   ├── bsf.h
│   │   ├── codec.h
│   │   ├── codec_desc.h
│   │   ├── codec_id.h
│   │   ├── codec_par.h
│   │   ├── d3d11va.h
│   │   ├── dirac.h
│   │   ├── dv_profile.h
│   │   ├── dxva2.h
│   │   ├── jni.h
│   │   ├── mediacodec.h
│   │   ├── packet.h
│   │   ├── qsv.h
│   │   ├── vaapi.h
│   │   ├── vdpau.h
│   │   ├── version.h
│   │   ├── videotoolbox.h
│   │   ├── vorbis_parser.h
│   │   └── xvmc.h
│   ├── libavdevice
│   │   ├── avdevice.h
│   │   └── version.h
│   ├── libavfilter
│   │   ├── avfilter.h
│   │   ├── buffersink.h
│   │   ├── buffersrc.h
│   │   └── version.h
│   ├── libavformat
│   │   ├── avformat.h
│   │   ├── avio.h
│   │   └── version.h
│   ├── libavutil
│   │   ├── adler32.h
│   │   ├── aes.h
│   │   ├── aes_ctr.h
│   │   ├── attributes.h
│   │   ├── audio_fifo.h
│   │   ├── avassert.h
│   │   ├── avconfig.h
│   │   ├── avstring.h
│   │   ├── avutil.h
│   │   ├── base64.h
│   │   ├── blowfish.h
│   │   ├── bprint.h
│   │   ├── bswap.h
│   │   ├── buffer.h
│   │   ├── camellia.h
│   │   ├── cast5.h
│   │   ├── channel_layout.h
│   │   ├── common.h
│   │   ├── cpu.h
│   │   ├── crc.h
│   │   ├── des.h
│   │   ├── dict.h
│   │   ├── display.h
│   │   ├── dovi_meta.h
│   │   ├── downmix_info.h
│   │   ├── encryption_info.h
│   │   ├── error.h
│   │   ├── eval.h
│   │   ├── ffversion.h
│   │   ├── fifo.h
│   │   ├── file.h
│   │   ├── frame.h
│   │   ├── hash.h
│   │   ├── hdr_dynamic_metadata.h
│   │   ├── hmac.h
│   │   ├── hwcontext.h
│   │   ├── hwcontext_cuda.h
│   │   ├── hwcontext_d3d11va.h
│   │   ├── hwcontext_drm.h
│   │   ├── hwcontext_dxva2.h
│   │   ├── hwcontext_mediacodec.h
│   │   ├── hwcontext_opencl.h
│   │   ├── hwcontext_qsv.h
│   │   ├── hwcontext_vaapi.h
│   │   ├── hwcontext_vdpau.h
│   │   ├── hwcontext_videotoolbox.h
│   │   ├── hwcontext_vulkan.h
│   │   ├── imgutils.h
│   │   ├── intfloat.h
│   │   ├── intreadwrite.h
│   │   ├── lfg.h
│   │   ├── log.h
│   │   ├── lzo.h
│   │   ├── macros.h
│   │   ├── mastering_display_metadata.h
│   │   ├── mathematics.h
│   │   ├── md5.h
│   │   ├── mem.h
│   │   ├── motion_vector.h
│   │   ├── murmur3.h
│   │   ├── opt.h
│   │   ├── parseutils.h
│   │   ├── pixdesc.h
│   │   ├── pixelutils.h
│   │   ├── pixfmt.h
│   │   ├── random_seed.h
│   │   ├── rational.h
│   │   ├── rc4.h
│   │   ├── replaygain.h
│   │   ├── ripemd.h
│   │   ├── samplefmt.h
│   │   ├── sha.h
│   │   ├── sha512.h
│   │   ├── spherical.h
│   │   ├── stereo3d.h
│   │   ├── tea.h
│   │   ├── threadmessage.h
│   │   ├── time.h
│   │   ├── timecode.h
│   │   ├── timestamp.h
│   │   ├── tree.h
│   │   ├── twofish.h
│   │   ├── tx.h
│   │   ├── version.h
│   │   ├── video_enc_params.h
│   │   └── xtea.h
│   ├── libpostproc
│   │   ├── postprocess.h
│   │   └── version.h
│   ├── libswresample
│   │   ├── swresample.h
│   │   └── version.h
│   ├── libswscale
│   │   ├── swscale.h
│   │   └── version.h
│   └── libx264
│   ├── x264.h
│   └── x264_config.h
└── lib
 ├── libavcodec.a
 ├── libavdevice.a
 ├── libavfilter.a
 ├── libavformat.a
 ├── libavutil.a
 ├── libpostproc.a
 ├── libswresample.a
 ├── libswscale.a
 └── libx264.a



The final lib was created successfully, no error message in log file,
but when I import the lib to my Xcode Project,
the linker give me tons of errors(missing symbols like :
Undefined symbol: _pjsua_vid_codec_set_priority
).
I found thepjsua_vid.o
is very small(200Bytes) compare to my pjsip+openh264 build file(was 47KB), perhaps this is the reason cause the link error.

Here is my build log :
log_file


the build script I am using :


#!/bin/sh

# see http://stackoverflow.com/a/3915420/318790
function realpath { echo $(cd $(dirname "$1"); pwd)/$(basename "$1"); }
__FILE__=`realpath "$0"`
__DIR__=`dirname "${__FILE__}"`

# download
function download() {
 "${__DIR__}/download.sh" "$1" "$2" #--no-cache
}

BASE_DIR="$1"
PJSIP_URL="https://github.com/pjsip/pjproject/archive/2.10.zip"
#http://www.pjsip.org/release/2.8.0/pjproject-2.8.0.tar.bz2
PJSIP_DIR="$1/src"
LIB_PATHS=("pjlib/lib" \
 "pjlib-util/lib" \
 "pjmedia/lib" \
 "pjnath/lib" \
 "pjsip/lib" \
 "third_party/lib")

OPENSSL_PREFIX=
FFMPEG_PREFIX=
OPENH264_PREFIX=
OPUS_PREFIX=
while [ "$#" -gt 0 ]; do
 case $1 in
 --with-openssl)
 if [ "$#" -gt 1 ]; then
 OPENSSL_PREFIX=$(python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$2")
 shift 2
 continue
 else
 echo 'ERROR: Must specify a non-empty "--with-openssl PREFIX" argument.' >&2
 exit 1
 fi
 ;;
 --with-openh264)
 if [ "$#" -gt 1 ]; then
 OPENH264_PREFIX=$(python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$2")
 shift 2
 continue
 else
 echo 'ERROR: Must specify a non-empty "--with-openh264 PREFIX" argument.' >&2
 exit 1
 fi
 ;;
 --with-ffmpeg)
 if [ "$#" -gt 1 ]; then
 FFMPEG_PREFIX=$(python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$2")
 shift 2
 continue
 else
 echo 'ERROR: Must specify a non-empty "--with-ffmpeg PREFIX" argument.' >&2
 exit 1
 fi
 ;;
 --with-opus)
 if [ "$#" -gt 1 ]; then
 OPUS_PREFIX=$(python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$2")
 shift 2
 continue
 else
 echo 'ERROR: Must specify a non-empty "--with-opus PREFIX" argument.' >&2
 exit 1
 fi
 ;;
 esac

 shift
done

function config_site() {
 SOURCE_DIR=$1
 PJSIP_CONFIG_PATH="${SOURCE_DIR}/pjlib/include/pj/config_site.h"
 HAS_VIDEO=

 echo "Creating config_site.h ..."

 if [ -f "${PJSIP_CONFIG_PATH}" ]; then
 rm "${PJSIP_CONFIG_PATH}"
 fi

 echo "#define PJ_CONFIG_IPHONE 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJ_HAS_IPV6 1" >> "${PJSIP_CONFIG_PATH}" # Enable IPV6
 if [[ ${OPENH264_PREFIX} ]]; then
 # echo "#define PJMEDIA_HAS_VID_TOOLBOX_CODEC 1" >> "${PJSIP_CONFIG_PATH}"
 # echo "#define PJMEDIA_HAS_OPENH264_CODEC 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJMEDIA_HAS_FFMPEG_VID_CODEC 1" >> "${PJSIP_CONFIG_PATH}"
 HAS_VIDEO=1
 fi
 if [[ ${HAS_VIDEO} ]]; then
 echo "#define PJMEDIA_HAS_VIDEO 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJMEDIA_VIDEO_DEV_HAS_OPENGL 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#include <opengles></opengles>ES3/glext.h>" >> "${PJSIP_CONFIG_PATH}"
 fi
 echo "#include <pj></pj>config_site_sample.h>" >> "${PJSIP_CONFIG_PATH}"
}

function clean_libs () {
 ARCH=${1}
 for SRC_DIR in ${LIB_PATHS[*]}; do
 DIR="${PJSIP_DIR}/${SRC_DIR}"
 if [ -d "${DIR}" ]; then
 rm -rf "${DIR}"/*
 fi

 DIR="${PJSIP_DIR}/${SRC_DIR}-${ARCH}"
 if [ -d "${DIR}" ]; then
 rm -rf "${DIR}"
 fi
 done
}

function copy_libs () {
 ARCH=${1}

 for SRC_DIR in ${LIB_PATHS[*]}; do
 SRC_DIR="${PJSIP_DIR}/${SRC_DIR}"
 DST_DIR="${SRC_DIR}-${ARCH}"
 if [ -d "${DST_DIR}" ]; then
 rm -rf "${DST_DIR}"
 fi
 cp -R "${SRC_DIR}" "${DST_DIR}"
 rm -rf "${SRC_DIR}"/* # delete files because this directory will be used for the final lipo output
 done
}

function _build() {
 pushd . > /dev/null
 cd ${PJSIP_DIR}

 ARCH=$1
 LOG=${BASE_DIR}/${ARCH}.log

 # configure
 CONFIGURE="./configure-iphone"
 if [[ ${OPENSSL_PREFIX} ]]; then
 CONFIGURE="${CONFIGURE} --with-ssl=${OPENSSL_PREFIX}"
 fi
 # if [[ ${OPENH264_PREFIX} ]]; then
 # CONFIGURE="${CONFIGURE} --with-openh264=${OPENH264_PREFIX}"
 # fi
 if [[ ${FFMPEG_PREFIX} ]]; then
 CONFIGURE="${CONFIGURE} --with-ffmpeg=${FFMPEG_PREFIX}"
 fi
 if [[ ${OPUS_PREFIX} ]]; then
 CONFIGURE="${CONFIGURE} --with-opus=${OPUS_PREFIX}"
 fi

 # flags
 if [[ ! ${CFLAGS} ]]; then
 export CFLAGS=
 fi
 if [[ ! ${LDFLAGS} ]]; then
 export LDFLAGS=
 fi
 if [[ ${OPENSSL_PREFIX} ]]; then
 export CFLAGS="${CFLAGS} -I${OPENSSL_PREFIX}/include"
 export LDFLAGS="${LDFLAGS} -L${OPENSSL_PREFIX}/lib"
 fi
 # if [[ ${OPENH264_PREFIX} ]]; then
 # export CFLAGS="${CFLAGS} -I${OPENH264_PREFIX}/include"
 # export LDFLAGS="${LDFLAGS} -L${OPENH264_PREFIX}/lib"
 # fi
 if [[ ${FFMPEG_PREFIX} ]]; then
 export CFLAGS="${CFLAGS} -I${FFMPEG_PREFIX}/include"
 export LDFLAGS="${LDFLAGS} -L${FFMPEG_PREFIX}/lib"
 fi
 export LDFLAGS="${LDFLAGS} -lstdc++"

 echo "Building for ${ARCH}..."

 clean_libs ${ARCH}

 make distclean > ${LOG} 2>&1
 ARCH="-arch ${ARCH}" ${CONFIGURE} >> ${LOG} 2>&1
 make dep >> ${LOG} 2>&1
 make clean >> ${LOG}
 make lib >> ${LOG} 2>&1

 copy_libs ${ARCH}
}

# function armv7() {
# export DEVPATH="`xcrun -sdk iphoneos --show-sdk-platform-path`/Developer"
# export CFLAGS="-miphoneos-version-min=8.0"
# export LDFLAGS=
# _build "armv7"
# }
# function armv7s() {
# export DEVPATH="`xcrun -sdk iphoneos --show-sdk-platform-path`/Developer"
# export CFLAGS="-miphoneos-version-min=8.0"
# export LDFLAGS=
# _build "armv7s"
# }
function arm64() {
 export DEVPATH="`xcrun -sdk iphoneos --show-sdk-platform-path`/Developer"
 export CFLAGS="-miphoneos-version-min=8.0"
 export LDFLAGS=
 _build "arm64"
}
function i386() {
 export DEVPATH="`xcrun -sdk iphonesimulator --show-sdk-platform-path`/Developer"
 export CFLAGS="-O2 -m32 -mios-simulator-version-min=8.0"
 export LDFLAGS="-O2 -m32 -mios-simulator-version-min=8.0"
 _build "i386"
}
function x86_64() {
 export DEVPATH="`xcrun -sdk iphonesimulator --show-sdk-platform-path`/Developer"
 export CFLAGS="-O2 -m32 -mios-simulator-version-min=8.0"
 export LDFLAGS="-O2 -m32 -mios-simulator-version-min=8.0"
 _build "x86_64"
}

function lipo() {
 TMP=`mktemp -t lipo`
 echo "Lipo libs... (${TMP})"

 for LIB_DIR in ${LIB_PATHS[*]}; do # loop over libs
 DST_DIR="${PJSIP_DIR}/${LIB_DIR}"

 # use the first architecture to find all libraries
 PATTERN_DIR="${DST_DIR}-$1"
 for PATTERN_FILE in `ls -l1 "${PATTERN_DIR}"`; do
 OPTIONS=""

 # loop over all architectures and collect the current library
 for ARCH in "$@"; do
 FILE="${DST_DIR}-${ARCH}/${PATTERN_FILE/-$1-/-${ARCH}-}"
 if [ -e "${FILE}" ]; then
 OPTIONS="$OPTIONS -arch ${ARCH} ${FILE}"
 fi
 done

 if [ "$OPTIONS" != "" ]; then
 OUTPUT_PREFIX=$(dirname "${DST_DIR}")
 OUTPUT="${OUTPUT_PREFIX}/lib/${PATTERN_FILE/-$1-/-}"

 OPTIONS="${OPTIONS} -create -output ${OUTPUT}"
 echo "$OPTIONS" >> "${TMP}"
 fi
 done
 done

 while read LINE; do
 xcrun -sdk iphoneos lipo ${LINE}
 done < "${TMP}"
}

# download "${PJSIP_URL}" "${PJSIP_DIR}"
config_site "${PJSIP_DIR}"
arm64 && i386 && x86_64
lipo arm64 i386 x86_64



Thanks for any advice.


-
iOS Build PJSIP with FFmpeg+libx264
22 février 2021, par MeonardoI have built the FFmpeg with libx264 into static libs, here is my directory tree.


./ffmpeg
├── include
│   ├── libavcodec
│   │   ├── ac3_parser.h
│   │   ├── adts_parser.h
│   │   ├── avcodec.h
│   │   ├── avdct.h
│   │   ├── avfft.h
│   │   ├── bsf.h
│   │   ├── codec.h
│   │   ├── codec_desc.h
│   │   ├── codec_id.h
│   │   ├── codec_par.h
│   │   ├── d3d11va.h
│   │   ├── dirac.h
│   │   ├── dv_profile.h
│   │   ├── dxva2.h
│   │   ├── jni.h
│   │   ├── mediacodec.h
│   │   ├── packet.h
│   │   ├── qsv.h
│   │   ├── vaapi.h
│   │   ├── vdpau.h
│   │   ├── version.h
│   │   ├── videotoolbox.h
│   │   ├── vorbis_parser.h
│   │   └── xvmc.h
│   ├── libavdevice
│   │   ├── avdevice.h
│   │   └── version.h
│   ├── libavfilter
│   │   ├── avfilter.h
│   │   ├── buffersink.h
│   │   ├── buffersrc.h
│   │   └── version.h
│   ├── libavformat
│   │   ├── avformat.h
│   │   ├── avio.h
│   │   └── version.h
│   ├── libavutil
│   │   ├── adler32.h
│   │   ├── aes.h
│   │   ├── aes_ctr.h
│   │   ├── attributes.h
│   │   ├── audio_fifo.h
│   │   ├── avassert.h
│   │   ├── avconfig.h
│   │   ├── avstring.h
│   │   ├── avutil.h
│   │   ├── base64.h
│   │   ├── blowfish.h
│   │   ├── bprint.h
│   │   ├── bswap.h
│   │   ├── buffer.h
│   │   ├── camellia.h
│   │   ├── cast5.h
│   │   ├── channel_layout.h
│   │   ├── common.h
│   │   ├── cpu.h
│   │   ├── crc.h
│   │   ├── des.h
│   │   ├── dict.h
│   │   ├── display.h
│   │   ├── dovi_meta.h
│   │   ├── downmix_info.h
│   │   ├── encryption_info.h
│   │   ├── error.h
│   │   ├── eval.h
│   │   ├── ffversion.h
│   │   ├── fifo.h
│   │   ├── file.h
│   │   ├── frame.h
│   │   ├── hash.h
│   │   ├── hdr_dynamic_metadata.h
│   │   ├── hmac.h
│   │   ├── hwcontext.h
│   │   ├── hwcontext_cuda.h
│   │   ├── hwcontext_d3d11va.h
│   │   ├── hwcontext_drm.h
│   │   ├── hwcontext_dxva2.h
│   │   ├── hwcontext_mediacodec.h
│   │   ├── hwcontext_opencl.h
│   │   ├── hwcontext_qsv.h
│   │   ├── hwcontext_vaapi.h
│   │   ├── hwcontext_vdpau.h
│   │   ├── hwcontext_videotoolbox.h
│   │   ├── hwcontext_vulkan.h
│   │   ├── imgutils.h
│   │   ├── intfloat.h
│   │   ├── intreadwrite.h
│   │   ├── lfg.h
│   │   ├── log.h
│   │   ├── lzo.h
│   │   ├── macros.h
│   │   ├── mastering_display_metadata.h
│   │   ├── mathematics.h
│   │   ├── md5.h
│   │   ├── mem.h
│   │   ├── motion_vector.h
│   │   ├── murmur3.h
│   │   ├── opt.h
│   │   ├── parseutils.h
│   │   ├── pixdesc.h
│   │   ├── pixelutils.h
│   │   ├── pixfmt.h
│   │   ├── random_seed.h
│   │   ├── rational.h
│   │   ├── rc4.h
│   │   ├── replaygain.h
│   │   ├── ripemd.h
│   │   ├── samplefmt.h
│   │   ├── sha.h
│   │   ├── sha512.h
│   │   ├── spherical.h
│   │   ├── stereo3d.h
│   │   ├── tea.h
│   │   ├── threadmessage.h
│   │   ├── time.h
│   │   ├── timecode.h
│   │   ├── timestamp.h
│   │   ├── tree.h
│   │   ├── twofish.h
│   │   ├── tx.h
│   │   ├── version.h
│   │   ├── video_enc_params.h
│   │   └── xtea.h
│   ├── libpostproc
│   │   ├── postprocess.h
│   │   └── version.h
│   ├── libswresample
│   │   ├── swresample.h
│   │   └── version.h
│   ├── libswscale
│   │   ├── swscale.h
│   │   └── version.h
│   └── libx264
│   ├── x264.h
│   └── x264_config.h
└── lib
 ├── libavcodec.a
 ├── libavdevice.a
 ├── libavfilter.a
 ├── libavformat.a
 ├── libavutil.a
 ├── libpostproc.a
 ├── libswresample.a
 ├── libswscale.a
 └── libx264.a



The final lib was created successfully, no error message in log file,
but when I import the lib to my Xcode Project,
the linker give me tons of errors(missing symbols like :
Undefined symbol: _pjsua_vid_codec_set_priority
).
I found thepjsua_vid.o
is very small(200Bytes) compare to my pjsip+openh264 build file(was 47KB), perhaps this is the reason cause the link error.

Here is my build log :
log_file


the build script I am using :


#!/bin/sh

# see http://stackoverflow.com/a/3915420/318790
function realpath { echo $(cd $(dirname "$1"); pwd)/$(basename "$1"); }
__FILE__=`realpath "$0"`
__DIR__=`dirname "${__FILE__}"`

# download
function download() {
 "${__DIR__}/download.sh" "$1" "$2" #--no-cache
}

BASE_DIR="$1"
PJSIP_URL="https://github.com/pjsip/pjproject/archive/2.10.zip"
#http://www.pjsip.org/release/2.8.0/pjproject-2.8.0.tar.bz2
PJSIP_DIR="$1/src"
LIB_PATHS=("pjlib/lib" \
 "pjlib-util/lib" \
 "pjmedia/lib" \
 "pjnath/lib" \
 "pjsip/lib" \
 "third_party/lib")

OPENSSL_PREFIX=
FFMPEG_PREFIX=
OPENH264_PREFIX=
OPUS_PREFIX=
while [ "$#" -gt 0 ]; do
 case $1 in
 --with-openssl)
 if [ "$#" -gt 1 ]; then
 OPENSSL_PREFIX=$(python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$2")
 shift 2
 continue
 else
 echo 'ERROR: Must specify a non-empty "--with-openssl PREFIX" argument.' >&2
 exit 1
 fi
 ;;
 --with-openh264)
 if [ "$#" -gt 1 ]; then
 OPENH264_PREFIX=$(python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$2")
 shift 2
 continue
 else
 echo 'ERROR: Must specify a non-empty "--with-openh264 PREFIX" argument.' >&2
 exit 1
 fi
 ;;
 --with-ffmpeg)
 if [ "$#" -gt 1 ]; then
 FFMPEG_PREFIX=$(python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$2")
 shift 2
 continue
 else
 echo 'ERROR: Must specify a non-empty "--with-ffmpeg PREFIX" argument.' >&2
 exit 1
 fi
 ;;
 --with-opus)
 if [ "$#" -gt 1 ]; then
 OPUS_PREFIX=$(python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$2")
 shift 2
 continue
 else
 echo 'ERROR: Must specify a non-empty "--with-opus PREFIX" argument.' >&2
 exit 1
 fi
 ;;
 esac

 shift
done

function config_site() {
 SOURCE_DIR=$1
 PJSIP_CONFIG_PATH="${SOURCE_DIR}/pjlib/include/pj/config_site.h"
 HAS_VIDEO=

 echo "Creating config_site.h ..."

 if [ -f "${PJSIP_CONFIG_PATH}" ]; then
 rm "${PJSIP_CONFIG_PATH}"
 fi

 echo "#define PJ_CONFIG_IPHONE 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJ_HAS_IPV6 1" >> "${PJSIP_CONFIG_PATH}" # Enable IPV6
 if [[ ${OPENH264_PREFIX} ]]; then
 # echo "#define PJMEDIA_HAS_VID_TOOLBOX_CODEC 1" >> "${PJSIP_CONFIG_PATH}"
 # echo "#define PJMEDIA_HAS_OPENH264_CODEC 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJMEDIA_HAS_FFMPEG_VID_CODEC 1" >> "${PJSIP_CONFIG_PATH}"
 HAS_VIDEO=1
 fi
 if [[ ${HAS_VIDEO} ]]; then
 echo "#define PJMEDIA_HAS_VIDEO 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJMEDIA_VIDEO_DEV_HAS_OPENGL 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJMEDIA_VIDEO_DEV_HAS_OPENGL_ES 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#define PJMEDIA_VIDEO_DEV_HAS_IOS_OPENGL 1" >> "${PJSIP_CONFIG_PATH}"
 echo "#include <opengles></opengles>ES3/glext.h>" >> "${PJSIP_CONFIG_PATH}"
 fi
 echo "#include <pj></pj>config_site_sample.h>" >> "${PJSIP_CONFIG_PATH}"
}

function clean_libs () {
 ARCH=${1}
 for SRC_DIR in ${LIB_PATHS[*]}; do
 DIR="${PJSIP_DIR}/${SRC_DIR}"
 if [ -d "${DIR}" ]; then
 rm -rf "${DIR}"/*
 fi

 DIR="${PJSIP_DIR}/${SRC_DIR}-${ARCH}"
 if [ -d "${DIR}" ]; then
 rm -rf "${DIR}"
 fi
 done
}

function copy_libs () {
 ARCH=${1}

 for SRC_DIR in ${LIB_PATHS[*]}; do
 SRC_DIR="${PJSIP_DIR}/${SRC_DIR}"
 DST_DIR="${SRC_DIR}-${ARCH}"
 if [ -d "${DST_DIR}" ]; then
 rm -rf "${DST_DIR}"
 fi
 cp -R "${SRC_DIR}" "${DST_DIR}"
 rm -rf "${SRC_DIR}"/* # delete files because this directory will be used for the final lipo output
 done
}

function _build() {
 pushd . > /dev/null
 cd ${PJSIP_DIR}

 ARCH=$1
 LOG=${BASE_DIR}/${ARCH}.log

 # configure
 CONFIGURE="./configure-iphone"
 if [[ ${OPENSSL_PREFIX} ]]; then
 CONFIGURE="${CONFIGURE} --with-ssl=${OPENSSL_PREFIX}"
 fi
 # if [[ ${OPENH264_PREFIX} ]]; then
 # CONFIGURE="${CONFIGURE} --with-openh264=${OPENH264_PREFIX}"
 # fi
 if [[ ${FFMPEG_PREFIX} ]]; then
 CONFIGURE="${CONFIGURE} --with-ffmpeg=${FFMPEG_PREFIX}"
 fi
 if [[ ${OPUS_PREFIX} ]]; then
 CONFIGURE="${CONFIGURE} --with-opus=${OPUS_PREFIX}"
 fi

 # flags
 if [[ ! ${CFLAGS} ]]; then
 export CFLAGS=
 fi
 if [[ ! ${LDFLAGS} ]]; then
 export LDFLAGS=
 fi
 if [[ ${OPENSSL_PREFIX} ]]; then
 export CFLAGS="${CFLAGS} -I${OPENSSL_PREFIX}/include"
 export LDFLAGS="${LDFLAGS} -L${OPENSSL_PREFIX}/lib"
 fi
 # if [[ ${OPENH264_PREFIX} ]]; then
 # export CFLAGS="${CFLAGS} -I${OPENH264_PREFIX}/include"
 # export LDFLAGS="${LDFLAGS} -L${OPENH264_PREFIX}/lib"
 # fi
 if [[ ${FFMPEG_PREFIX} ]]; then
 export CFLAGS="${CFLAGS} -I${FFMPEG_PREFIX}/include"
 export LDFLAGS="${LDFLAGS} -L${FFMPEG_PREFIX}/lib"
 fi
 export LDFLAGS="${LDFLAGS} -lstdc++"

 echo "Building for ${ARCH}..."

 clean_libs ${ARCH}

 make distclean > ${LOG} 2>&1
 ARCH="-arch ${ARCH}" ${CONFIGURE} >> ${LOG} 2>&1
 make dep >> ${LOG} 2>&1
 make clean >> ${LOG}
 make lib >> ${LOG} 2>&1

 copy_libs ${ARCH}
}

# function armv7() {
# export DEVPATH="`xcrun -sdk iphoneos --show-sdk-platform-path`/Developer"
# export CFLAGS="-miphoneos-version-min=8.0"
# export LDFLAGS=
# _build "armv7"
# }
# function armv7s() {
# export DEVPATH="`xcrun -sdk iphoneos --show-sdk-platform-path`/Developer"
# export CFLAGS="-miphoneos-version-min=8.0"
# export LDFLAGS=
# _build "armv7s"
# }
function arm64() {
 export DEVPATH="`xcrun -sdk iphoneos --show-sdk-platform-path`/Developer"
 export CFLAGS="-miphoneos-version-min=8.0"
 export LDFLAGS=
 _build "arm64"
}
function i386() {
 export DEVPATH="`xcrun -sdk iphonesimulator --show-sdk-platform-path`/Developer"
 export CFLAGS="-O2 -m32 -mios-simulator-version-min=8.0"
 export LDFLAGS="-O2 -m32 -mios-simulator-version-min=8.0"
 _build "i386"
}
function x86_64() {
 export DEVPATH="`xcrun -sdk iphonesimulator --show-sdk-platform-path`/Developer"
 export CFLAGS="-O2 -m32 -mios-simulator-version-min=8.0"
 export LDFLAGS="-O2 -m32 -mios-simulator-version-min=8.0"
 _build "x86_64"
}

function lipo() {
 TMP=`mktemp -t lipo`
 echo "Lipo libs... (${TMP})"

 for LIB_DIR in ${LIB_PATHS[*]}; do # loop over libs
 DST_DIR="${PJSIP_DIR}/${LIB_DIR}"

 # use the first architecture to find all libraries
 PATTERN_DIR="${DST_DIR}-$1"
 for PATTERN_FILE in `ls -l1 "${PATTERN_DIR}"`; do
 OPTIONS=""

 # loop over all architectures and collect the current library
 for ARCH in "$@"; do
 FILE="${DST_DIR}-${ARCH}/${PATTERN_FILE/-$1-/-${ARCH}-}"
 if [ -e "${FILE}" ]; then
 OPTIONS="$OPTIONS -arch ${ARCH} ${FILE}"
 fi
 done

 if [ "$OPTIONS" != "" ]; then
 OUTPUT_PREFIX=$(dirname "${DST_DIR}")
 OUTPUT="${OUTPUT_PREFIX}/lib/${PATTERN_FILE/-$1-/-}"

 OPTIONS="${OPTIONS} -create -output ${OUTPUT}"
 echo "$OPTIONS" >> "${TMP}"
 fi
 done
 done

 while read LINE; do
 xcrun -sdk iphoneos lipo ${LINE}
 done < "${TMP}"
}

# download "${PJSIP_URL}" "${PJSIP_DIR}"
config_site "${PJSIP_DIR}"
arm64 && i386 && x86_64
lipo arm64 i386 x86_64



Thanks for any advice.