검색 한 결과 Building FFMPEG with librtmp for android이 내 질문에 응답했지만 필자는 컴파일 과정에서 다른 문제를 발견했습니다.안드로이드에서 librtmp로 FFMPEG를 컴파일 할 때 "정의되지 않은 참조"
첫째, 나는 다음과 같은
--enable-librtmp \
--extra-cflags=-I/home/bradford/Development/FFMPEG/rtmp/rtmpdump/librtmp/ \
--extra-ldflags=-L/home/bradford/Development/FFMPEG/rtmp/rtmpdump/librtmp"
내가 polarSSL와 librtmp 구축을 포함하도록 플래그를 변경 this github repo의 스크립트를 사용하려고 S74ck3r의 instructions on his github repo 및 stream-recorder thread. 즉, 제대로 작동하려면 나타납니다, 나는 librtmp으로는 FFmpeg 컴파일 할 때 나는 librtmp.so, librtmp.a 및 rtmp.h
을 가지고, 나는 오류를
ERROR: librtmp not found
This SO question helped을 얻을, 나는 수정 이 librtmp에 대한 PKG-설정 보지 것이다 그래야는 FFmpeg의 설정 파일 (PKG-설정은 ... librtmp 알고 있었다하더라도) :
지금 구축#enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
, 성공적으로 시작하고, 내가 할 희망 줄 :
librtmp enabled yes
그리고 나중에 나는 더보기 좋은 소식 :
...
Enabled protocols:
applehttp http mmsh
cache httpproxy mmst
concat librtmp mmsu
crypto librtmpe pipe
fd librtmps rtp
file librtmpt tcp
gopher librtmpte udp
hls md5
...
하지만 결국, 모든 것을하고 설치 단계를 컴파일 한 후, 나는 이러한 유형의 오류 얻을 :
INSTALL libavutil/libavutil.pc
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_get_file_handle:libavformat/librtmp.c:190: error: undefined reference to 'RTMP_Socket'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_read_seek:libavformat/librtmp.c:180: error: undefined reference to 'RTMP_SendSeek'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_read_pause:libavformat/librtmp.c:161: error: undefined reference to 'RTMP_Pause'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_close:libavformat/librtmp.c:64: error: undefined reference to 'RTMP_Close'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_write:libavformat/librtmp.c:145: error: undefined reference to 'RTMP_Write'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_read:libavformat/librtmp.c:153: error: undefined reference to 'RTMP_Read'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:96: error: undefined reference to 'RTMP_LogSetLevel'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:97: error: undefined reference to 'RTMP_LogSetCallback'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:118: error: undefined reference to 'RTMP_Init'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:119: error: undefined reference to 'RTMP_SetupURL'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:127: error: undefined reference to 'RTMP_Connect'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:127: error: undefined reference to 'RTMP_ConnectStream'
/tmp/FFMPEG/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: libavformat/librtmp.o: in function rtmp_open:libavformat/librtmp.c:125: error: undefined reference to 'RTMP_EnableWrite'
collect2: ld returned 1 exit status
그리고 내가 할 수있는을 그들을 지나쳐 버리지 마라. 그것은 그 함수에 대한 참조를 포함하고있는 rtmp.h를 찾을 수없는 것처럼 들리지만 그것이 어디에 있어야하는지 (afaik).
또한 내 프로젝트에는 librtmp가 필요합니다. librtmp의 인증 기능이 필요하기 때문에 ffmpeg의 내장 rtmp 기능으로는 충분하지 않습니다.
먼저 librtmp를 빌드하고 .so 또는 .a를 링크해야합니다. Vitamio 4.0 이상을 사용하는 경우 https://github.com/yixia/FFmpeg-Vitamio를 복제하고 ./build_android.sh를 실행하십시오. – crossle
@CrossleSong - 고맙습니다. 지난 3 주 동안 repo가 업데이트 된 것을 볼 수 있습니다. 나는 그것을 다시 돌려 줄거야 – elBradford