PJSIP 加视频功能 ON MAC

/Users/wzw/Downloads/pjproject-2.7.2:
$cp pjlib/include/pj/config_site_sample.h  pjlib/include/pj/config_site.h

$vi pjlib/include/pj/config_site.h
#define PJMEDIA_HAS_VID_TOOLBOX_CODEC 1
#define PJMEDIA_HAS_VIDEO 1
#define PJMEDIA_VIDEO_DEV_HAS_SDL 1
#define PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL    1
#define PJMEDIA_VIDEO_DEV_HAS_DSHOW 0
#define PJMEDIA_HAS_FFMPEG 1
#undef PJMEDIA_USE_OLD_FFMPEG
#define  FF_INPUT_BUFFER_PADDING_SIZE   32

$vi user.mak
# You can create user.mak file in PJ root directory to specify
# additional flags to compiler and linker. For example:
export CFLAGS += -Wno-unused-label
#export CFLAGS += -Wno-unused-label -Werror
export LDFLAGS += -framework OpenGL

$sudo port install ffmpeg
$brew install SDL2

$./configure --with-ffmpeg=/opt/local --with-sdl=/opt/local
$make

................................................

/Users/wzw/Downloads/pjproject-2.7.2/pjsip-apps/bin/samples/x86_64-apple-darwin17.7.0:

wget http://samples.mplayerhq.hu/avi/2-audio-streams.avi
zwdeMacBook-Pro:x86_64-apple-darwin17.7.0 wzw$ ./aviplay ./2-audio-streams.avi 
16:46:52.581         os_core_unix.c !pjlib 2.7.2 for POSIX initialized
16:46:52.638           darwin_dev.m  Darwin video initialized with 1 devices:
16:46:52.639           darwin_dev.m   0: [Capturer] AVF - FaceTime HD Camera
16:46:52.674              sdl_dev.c  SDL 2.0 initialized
16:46:52.674         colorbar_dev.c  Colorbar video src initialized with 2 device(s):
16:46:52.674         colorbar_dev.c   0: Colorbar generator
16:46:52.674         colorbar_dev.c   1: Colorbar-active
16:46:52.855        coreaudio_dev.c  core audio detected 2 devices
16:46:52.856        coreaudio_dev.c   dev_id 0: Built-in Output  (in=0, out=2) 44100Hz
16:46:52.856        coreaudio_dev.c   dev_id 1: Built-in Microphone  (in=2, out=0) 44100Hz
16:46:52.856        coreaudio_dev.c  core audio initialized
16:46:52.862           avi_player.c  The AVI file has 3 streams.
16:46:52.862           avi_player.c  Unsupported audio stream
16:46:52.862           avi_player.c  Unsupported audio stream
16:46:52.862           avi_player.c  AVI file player './2-audio-streams.avi' created with 1 media ports
16:46:52.867             vid_port.c  Opening device SDL renderer [SDL] for render: format=I420, size=624x272 @24000:1001 fps
16:46:52.997             vid_port.c  Device SDL renderer [SDL] opened: format=I420, size=624x272 @24000:1001 fps
16:46:52.997              sdl_dev.c  Starting sdl video stream

/opt/local 为FFMPEG SDL2的安装目录 

你可能感兴趣的:(PJSIP 加视频功能 ON MAC)