bilibili / ijkplayer

Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.
GNU General Public License v2.0
32.6k stars 8.14k forks source link

ios ffmepg + OpenSSL compile error #302

Closed tasdg-yamamoto closed 9 years ago

tasdg-yamamoto commented 9 years ago

I want to use "rtmps". Compile "ffmepg + OpenSSL" in iOS is Error. ./compile-ffmpeg.sh all is ERROR: openssl not found.

git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-ios
cd ijkplayer-ios

# append 'export COMMON_FF_CFG_FLAGS="$COMMON_FF_CFG_FLAGS --enable-protocol=rtmps"' to config/mudule.sh

./init-ios.sh
./init-ios-openssl.sh 

cd ios
./compile-openssl.sh all 
./compile-ffmpeg.sh

====================
[*] check xcode version
====================
FF_ALL_ARCHS = armv7 arm64 i386 x86_64
====================
[*] check host
====================
build_root: /Users/user/work/cats/source/ijkplayer/work/ijkplayer-ios/ios
====================
[*] check gas-preprocessor
====================
gasp: /Users/user/work/cats/source/ijkplayer/work/ijkplayer-ios/ios/../extra/gas-preprocessor/gas-preprocessor.pl
====================
[*] config arch armv7
====================
build_name: ffmpeg-armv7
platform:   iPhoneOS
osversion:  -miphoneos-version-min=5.1.1
====================
[*] make ios toolchain ffmpeg-armv7
====================
build_source: /Users/user/work/cats/source/ijkplayer/work/ijkplayer-ios/ios/ffmpeg-armv7
build_prefix: /Users/user/work/cats/source/ijkplayer/work/ijkplayer-ios/ios/build/ffmpeg-armv7/output

--------------------
[*] configurate ffmpeg
--------------------

--------------------
[*] check OpenSSL
----------------------

--------------------
[*] configure
----------------------
config:   --disable-gpl --disable-nonfree --enable-runtime-cpudetect --disable-gray --disable-swscale-alpha --disable-programs --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-avdevice --enable-avcodec --enable-avformat --enable-avutil --enable-swresample --enable-swscale --disable-postproc --disable-avfilter --disable-avresample --enable-network --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --disable-encoders --disable-decoders --enable-decoder=aac --enable-decoder=aac_latm --enable-decoder=flv --enable-decoder=h263 --enable-decoder=h263i --enable-decoder=h263p --enable-decoder=h264 --enable-decoder=mp3* --enable-decoder=vc1 --enable-decoder=vorbis --enable-decoder=vp6 --enable-decoder=vp6a --enable-decoder=vp6f --enable-decoder=vp8 --enable-decoder=webp --disable-hwaccels --disable-muxers --enable-muxer=mpegts --enable-muxer=mp4 --disable-demuxers --enable-demuxer=aac --enable-demuxer=concat --enable-demuxer=data --enable-demuxer=flv --enable-demuxer=hls --enable-demuxer=latm --enable-demuxer=live_flv --enable-demuxer=loas --enable-demuxer=m4v --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=mpegps --enable-demuxer=mpegts --enable-demuxer=mpegvideo --disable-parsers --enable-parser=aac --enable-parser=aac_latm --enable-parser=h263 --enable-parser=h264 --enable-parser=vc1 --enable-parser=vorbis --enable-parser=vp8 --enable-parser=vp9 --enable-bsfs --disable-bsf=mjpeg2jpeg --disable-bsf=mjpeg2jpeg --disable-bsf=mjpega_dump_header --disable-bsf=mov2textsub --disable-bsf=text2movsub --enable-protocols --disable-protocol=bluray --disable-protocol=ffrtmpcrypt --enable-protocol=ffrtmphttp --disable-protocol=gopher --disable-protocol=librtmp* --disable-protocol=libssh --disable-protocol=mmsh --disable-protocol=mmst --disable-protocol=pipe --disable-protocol=rtmp* --enable-protocol=rtmp --enable-protocol=rtmpt --disable-protocol=rtp --disable-protocol=sctp --disable-protocol=srtp --disable-protocol=unix --disable-devices --disable-filters --disable-iconv --enable-protocol=rtmps --enable-cross-compile --disable-stripping --arch=armv7 --target-os=darwin --enable-static --disable-shared  --enable-pic --enable-neon --enable-optimizations --enable-debug --enable-small --prefix=/Users/user/work/cats/source/ijkplayer/work/ijkplayer-ios/ios/build/ffmpeg-armv7/output  --enable-openssl xcrun -sdk iphoneos clang
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
ERROR: openssl not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.

Compile "ffmepg + OpenSSL" in Android is Success. I compare with Android and iOS in do-compile-ffmpeg.sh.

iOS do-compile-ffmpeg.sh is not set FFMPEG_DEP_LIBS. https://github.com/Bilibili/ijkplayer/blob/master/android/contrib/tools/do-compile-ffmpeg.sh#L232 https://github.com/Bilibili/ijkplayer/blob/master/ios/tools/do-compile-ffmpeg.sh#L193

When set FFMPEG_DEP_LIBS, Compile "ffmepg + OpenSSL" in iOS is Success

# with openssl
if [ -f "${FFMPEG_DEP_OPENSSL_LIB}/libssl.a" ]; then
    FFMPEG_CFG_FLAGS="$FFMPEG_CFG_FLAGS --enable-openssl"

    FFMPEG_CFLAGS="$FFMPEG_CFLAGS -I${FFMPEG_DEP_OPENSSL_INC}"
    FFMPEG_DEP_LIBS="$FFMPEG_DEP_LIBS -L${FFMPEG_DEP_OPENSSL_LIB} -lssl -lcrypto"
fi
bbcallen commented 9 years ago

Fixed: 9e0138ee85181cd2ea0eb661e6d48a21ad4e8349

Thanks.