Notes while video is a work in progress. Repository: http://devel.ag-projects.com/cgi-bin/darcsweb.cgi?r=saul/python-sipsimple-video;a=summarypython
The following dependencies are required to build PJSIP with video support (including H264)web
Versions I have tried:app
If the above versions are used, PJSIP needs to be patched with the attached patch (avcodec.diff) or it won't compile. This does not occur when compiling it against the latest library versions on Debian unstable. No longer needed.ide
The situation here is a bit sad. Both Debian and Ubuntu ship with libav instead of FFmpeg, but libraries are called the same. PJSIP had to be patched in order to properly work with libav, and the patch as not yet been included upstream.svn
On Debian, when the Debian-Multimedia repositories are used (quite common) you get FFmpeg and not libav. Oh the joy!ui
Installing dependencies on Debian:this
apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libsdl2-dev libx264-dev libavcodec-extra
If using the Debian-Multimedia repositories, do not install libavcodec-extra.spa
Installing dependencies on Ubuntu:code
apt-get install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libsdl2-dev libx264-dev libavcodec-extra53
Note on H.264 support: In order to have H.264 support, FFmpeg (or libav) need to be compiled with support for it. The standard packages don't, hence the need for installing the libavcodec-extra packages.component
All dependencies will be compiled to a directory in the user's HOME directory:
export MY_VIDEO_LIBS=$HOME/work/ag-projects/video/local
./configure --enable-shared --disable-avs --disable-swscale --disable-lavf --disable-ffms --disable-gpac --prefix=$MY_VIDEO_LIBS make make install # If a 32bit build is wanted, then run this configure instead: ./configure --host=i386-apple-darwin --enable-shared --disable-avs --disable-swscale --disable-lavf --disable-ffms --disable-gpac --prefix=$MY_VIDEO_LIBS
# Some exports export PKG_CONFIG_PATH=$MY_VIDEO_LIBS/lib/pkgconfig ./configure --enable-shared --disable-static --enable-memalign-hack --enable-gpl --enable-libx264 --prefix=$MY_VIDEO_LIBS --extra-cflags="`pkg-config --cflags x264`" --extra-ldflags="`pkg-config --libs x264`" make make install # If a 32bit build is wanted do: ./configure --enable-shared --disable-static --enable-memalign-hack --enable-gpl --enable-libx264 --prefix=$MY_VIDEO_LIBS --extra-cflags="`pkg-config --cflags x264`" --extra-ldflags="`pkg-config --libs x264`" --cc="gcc -m32" --disable-asm # TODO: I WANT MY ASM
./configure --disable-audio --prefix=$MY_VIDEO_LIBS make make install # If a 32bit build is wanted: CFLAGS="-arch i386" CXXFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure --disable-audio --prefix=$MY_VIDEO_LIBS
svn co http://svn.pjsip.org/repos/pjproject/trunk pjsip cd pjsip echo "#define PJMEDIA_HAS_VIDEO 1" > pjlib/include/pj/config_site.h ./configure --with-sdl=$MY_VIDEO_LIBS --with-ffmpeg=$MY_VIDEO_LIBS # if a 32bit build is wanted: # CFLAGS="-arch i386" CXXFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure --with-sdl=$MY_VIDEO_LIBS --with-ffmpeg=$MY_VIDEO_LIBS make dep make # pjsua will be located in pjsip-apps/bin/
API for video components is based on 2 different types of video capable entities:
Data flow works in pull fashion, that is, a producer doesn't start to produce data until there is a consumer which will consume it.
Produces video data.
Internal API:
Public API:
Consumes video data.
Public API:
These are just theoretical objects, won't be implemented in the first go.
NOTE: pjsip does have a AVI file player, which also seems to support audio.