
Recherche avancée
Médias (91)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
-
Les Miserables
4 juin 2012, par
Mis à jour : Février 2013
Langue : English
Type : Texte
-
Ne pas afficher certaines informations : page d’accueil
23 novembre 2011, par
Mis à jour : Novembre 2011
Langue : français
Type : Image
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Richard Stallman et la révolution du logiciel libre - Une biographie autorisée (version epub)
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (101)
-
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (11516)
-
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.


-
Safari on Mac and IOS 14 Won't Play HTML 5 MP4 Video
10 mars 2021, par Glen ElkinsSo i have developed a chat application that uses node for the back-end. When a user selects a video on their iphone it usually is .mov format so when it's sent to the node server it's then converted to mp4 with ffmpeg. All that works fine, then if i load up my chat again in Chrome on my mac the video plays just fine as the mp4.




This screenshot shows the video embed is there, set to mp4 yet it won't play in Safari on my mac or my phone, in fact it just shows the video as 0 seconds long yet i can play it in chrome and also download the mp4 file by accessing the embed url directly.


Any ideas ? I had it convert to mp4 to prevent things like this, but safari doesn't seem to even like mp4 files.


The back-end part that serves the private file is in Symfony 4 (PHP) :


/**
 * @Route("/private/files/download/{base64Path}", name="downloadFile")
 * @param string $base64Path
 * @param Request $request
 * @return Response
 */
 public function downloadFile(string $base64Path, Request $request) : Response
 {


 // get token
 if(!$token = $request->query->get('token')){
 return new Response('Access Denied',403);
 }



 /** @var UserRepository $userRepo */
 $userRepo = $this->getDoctrine()->getRepository(User::class);

 /** @var User $user */
 if(!$user = $userRepo->findOneBy(['deleted'=>false,'active'=>true,'systemUser'=>false,'apiKey'=>$token])){
 return new Response('Access Denied',403);
 }



 // get path
 if($path = base64_decode($base64Path)){

 // make sure the folder we need exists
 $fullPath = $this->getParameter('private_upload_folder') . '/' . $path;



 if(!file_exists($fullPath)){
 return new Response('File Not Found',404);
 }

 

 $response = new Response();
 $response->headers->set('Content-Type', mime_content_type($fullPath));
 $response->headers->set('Content-Disposition', 'inline; filename="' . basename($fullPath) . '"');
 $response->headers->set('Content-Length', filesize($fullPath));
 $response->headers->set('Pragma', "no-cache");
 $response->headers->set('Expires', "0");
 $response->headers->set('Content-Transfer-Encoding', "binary");

 $response->sendHeaders();

 $response->setContent(readfile($fullPath));

 return $response;
 }

 return new Response('Invalid Path',404);
 }



This works fine everywhere except safari when trying to embed the video. It's done like this because the videos are not public and need an access token.


UPDATE : Here is a test link of an mp4, you'll have to allow the insecure certificate as it's on a quick test sub domain. If you open it in chrome, you'll see a 3 second video of my 3d printer curing station, if you load the same link in safari, you'll see it doesn't work




The server runs on cPanel with Apache and i think it might be something to do with the video needs streaming ?


UPDATED CODE THAT WORKS IN SAFARI BUT NOW BROKEN IN CHROME :


Chrome is now giving Content-Length : 0 but it's working fine in safari.


public function downloadFile(string $base64Path, Request $request) : ?Response
 {

 ob_clean();

 // get token
 if(!$token = $request->query->get('token')){
 return new Response('Access Denied',403);
 }


 

 /** @var UserRepository $userRepo */
 $userRepo = $this->getDoctrine()->getRepository(User::class);

 /** @var User $user */
 if(!$user = $userRepo->findOneBy(['deleted'=>false,'active'=>true,'systemUser'=>false,'apiKey'=>$token])){
 return new Response('Access Denied',403);
 }



 // get path
 if($path = base64_decode($base64Path)){

 // make sure the folder we need exists
 $fullPath = $this->getParameter('private_upload_folder') . '/' . $path;



 if(!file_exists($fullPath)){
 return new Response('File Not Found',404);
 }


 $filesize = filesize($fullPath);
 $mime = mime_content_type($fullPath);

 header('Content-Type: ' . $mime);

 if(isset($_SERVER['HTTP_RANGE'])){

 // Parse the range header to get the byte offset
 $ranges = array_map(
 'intval', // Parse the parts into integer
 explode(
 '-', // The range separator
 substr($_SERVER['HTTP_RANGE'], 6) // Skip the `bytes=` part of the header
 )
 );



 // If the last range param is empty, it means the EOF (End of File)
 if(!$ranges[1]){
 $ranges[1] = $filesize - 1;
 }

 header('HTTP/1.1 206 Partial Content');
 header('Accept-Ranges: bytes');
 header('Content-Length: ' . ($ranges[1] - $ranges[0])); // The size of the range

 // Send the ranges we offered
 header(
 sprintf(
 'Content-Range: bytes %d-%d/%d', // The header format
 $ranges[0], // The start range
 $ranges[1], // The end range
 $filesize // Total size of the file
 )
 );

 // It's time to output the file
 $f = fopen($fullPath, 'rb'); // Open the file in binary mode
 $chunkSize = 8192; // The size of each chunk to output

 // Seek to the requested start range
 fseek($f, $ranges[0]);

 // Start outputting the data
 while(true){
 // Check if we have outputted all the data requested
 if(ftell($f) >= $ranges[1]){
 break;
 }

 // Output the data
 echo fread($f, $chunkSize);

 // Flush the buffer immediately
 @ob_flush();
 flush();
 }
 }else{

 // It's not a range request, output the file anyway
 header('Content-Length: ' . $filesize);

 // Read the file
 @readfile($filesize);

 // and flush the buffer
 @ob_flush();
 flush();



 }

 }else {

 return new Response('Invalid Path', 404);
 }
 }



I have notice in chrome that it's sending the range header like this :


Range : bytes=611609-


Where safari sends


Range : bytes=611609-61160


So for some reason chrome is missing the second range amount, that obviously means my code can't find a range number for the second one.


Doesn’t matter what I do I can’t get it working in both chrome and safari. Safari wants the byte range part , chrome seems to request it then sends a new request for the full file but even the full file part of the code gives a 500 error. If I take out the byte range bit then it works fine in chrome but not safari.


UPDATE :


Here is some strange things going on in chrome :


For the video i am testing with it makes 3 range requests :


REQUEST 1 HEADERS - asking for bytes 0- (to the end of the file)


GET /private/files/download/Y2hhdC83Nzk1Y2U2MC04MDFmLTExZWItYjkzYy1lZjI4ZGYwMDhkOTMubXA0?token=6ab1720bfe922d44208c25f655d61032 HTTP/1.1

Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36
Accept-Encoding: identity;q=1, *;q=0
Accept: */*
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: no-cors
Sec-Fetch-Dest: video
Referer: https://gofollow.vip/
Accept-Language: en-US,en;q=0.9
Range: bytes=0-



RESPONSE GIVES IT BACK ALL THE BYTES IN THE FILE AS THAT'S WHAT WAS ASKED FOR BY CHROME :


HTTP/1.1 206 Partial Content
Date: Wed, 10 Mar 2021 12:35:54 GMT
Server: Apache
Accept-Ranges: bytes
Content-Length: 611609
Content-Range: bytes 0-611609/611610
Vary: User-Agent
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: video/mp4



SECOND REQUEST HEADERS : NOW IT'S ASKING FOR 589824 to the end of the file :


Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36
Accept-Encoding: identity;q=1, *;q=0
Accept: */*
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: no-cors
Sec-Fetch-Dest: video
Referer: https://gofollow.vip/
Accept-Language: en-US,en;q=0.9
Range: bytes=589824-



RESPONSE OBLIGES :


HTTP/1.1 206 Partial Content
Date: Wed, 10 Mar 2021 12:35:55 GMT
Server: Apache
Accept-Ranges: bytes
Content-Length: 21785
Content-Range: bytes 589824-611609/611610
Vary: User-Agent
Keep-Alive: timeout=5, max=99
Connection: Keep-Alive
Content-Type: video/mp4



THEN IT'S MAKING THIS 3rd REQUEST THAT GIVES AN INTERNAL SERVER ERORR, THIS TIME IT'S LITERALLY ASKING FOR THE LAST BYTE :


GET /private/files/download/Y2hhdC83Nzk1Y2U2MC04MDFmLTExZWItYjkzYy1lZjI4ZGYwMDhkOTMubXA0?token=6ab1720bfe922d44208c25f655d61032 HTTP/1.1

Connection: keep-alive
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.192 Safari/537.36
Accept-Encoding: identity;q=1, *;q=0
Accept: */*
Sec-Fetch-Site: same-site
Sec-Fetch-Mode: no-cors
Sec-Fetch-Dest: video
Referer: https://gofollow.vip/
Accept-Language: en-US,en;q=0.9
Range: bytes=611609-



RESPONSE - THE CONTENT LENGTH IS 0 BECAUSE THERE IS NO DIFFERENCE BETWEEN THE REQUESTED BYTES AND THE BYTES RETURNED :


HTTP/1.1 500 Internal Server Error
Date: Wed, 10 Mar 2021 12:35:56 GMT
Server: Apache
Accept-Ranges: bytes
Cache-Control: max-age=0, must-revalidate, private
X-Frame-Options: DENY
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
Referrer-Policy: origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
Expires: Wed, 10 Mar 2021 12:35:56 GMT
Content-Length: 0
Content-Range: bytes 611609-611609/611610
Vary: User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8