On Apr 8 22:59:19 EDT 2013, Haomiao Huang wrote: > Hi all, > I have been trying to build pjsip with video support and cannot > compile pjsip with video. I have the latest pjproject-2.1.0 and > ffmpeg 1.2 >(3/15/13 release). > > I followed the instructions from the ffmpeg site to set up and compile > ffmpeg, and where there were deviations between ffmpeg and pjsip > getting started guide followed pjsip. For example pjsip asks to > configure ffmpeg with --enable-shared and thus I had to configure > x264 with --enable-shared to avoid linker errors. > > I am getting the following error compiling pjsip: > > In file included from ../src/pjmedia/ffmpeg_util.c:26:0: > ../src/pjmedia/ffmpeg_util.h:50:12: warning: ?enum CodecID? declared > inside parameter list [enabled by default] > ../src/pjmedia/ffmpeg_util.h:50:12: warning: its scope is only this > definition or declaration, which is probably not what you want > [enabled by default] > [...] Have you managed to resolve this issue? For now, not knowing any better, inserting #define CodecID AVCodecID somewhere near the top of ffmpeg_util.h "solved" the problem for me; compiling succeeded, audio receiving/transmission works just fine, video receiver and local-rendering too; and colour-stripe-pattern transmitter as well (seeing the pattern (and the blinking dot) at remote end). Live camera video transmission fails though. Being new to SIP and PJSIP in particular, what I did is pjsua --id sip:localhost --video --vcapture-dev=-1 --vrender-dev=-2 Then "vid dev list" shows 07:51:30.645 pjsua_app.c Video device list: 07:51:30.645 pjsua_app.c 3 device(s) detected: 07:51:30.645 pjsua_app.c -2 SDL renderer [SDL][render] (default renderer device) 07:51:30.645 pjsua_app.c Supported capabilities: format, window, resize, wndflags 07:51:30.645 pjsua_app.c Supported formats: RGBA, RGB24, BGRA, DIB , YUY2, UYVY, YVYU, I420, YV12, I420JPG, I422JPG 07:51:30.645 pjsua_app.c -1 Camera [QT][capture] (default capture device) 07:51:30.645 pjsua_app.c Supported capabilities: format 07:51:30.645 pjsua_app.c Supported formats: 07:51:30.645 pjsua_app.c 0 Camera [QT][capture] 07:51:30.645 pjsua_app.c Supported capabilities: format 07:51:30.645 pjsua_app.c Supported formats: 07:51:30.645 pjsua_app.c 1 Colorbar generator [Colorbar][capture] 07:51:30.645 pjsua_app.c Supported capabilities: format 07:51:30.645 pjsua_app.c Supported formats: YUY2, UYVY, YVYU, RGBA, RGB24, BGRA, YV12, I420, I422, I420JPG, I422JPG 07:51:30.645 pjsua_app.c 2 SDL renderer [SDL][render] 07:51:30.645 pjsua_app.c Supported capabilities: format, window, resize, wndflags 07:51:30.645 pjsua_app.c Supported formats: RGBA, RGB24, BGRA, DIB , YUY2, UYVY, YVYU, I420, YV12, I420JPG, I422JPG Running on MacPro under MacOSX 10.6 and having some industrial firewire camera attached (it only supports vga, qvga and sqvga) I changed some settings (these seem to be codec settings but I did it in hope this affects camera parameters too): vid codec fps H264/97 10 1 vid codec fps H263-1998/96 10 1 vid codec size H264/97 640 480 vid codec size H263-1998/96 640 480 Finally vid codec list gives 07:51:55.638 pjsua_app.c Found 2 video codecs: 07:51:55.638 pjsua_app.c codec id prio fps bw(kbps) size 07:51:55.638 pjsua_app.c ------------------------------------------ 07:51:55.638 pjsua_app.c H264/97 128 10.00 256/ 256 640x480 07:51:55.638 pjsua_app.c H263-1998/96 128 10.00 256/ 256 640x480 The following sceen-error-log suggests there is a problem with "preview" window, so as next I did this: vid dev prev off -1 vid dev prev off 0 Still without success (no camera video transmission), here is the screen log: 07:59:43.619 pjsua_call.c !Answering call 0: code=200 07:59:43.619 pjsua_media.c ...Call 0: updating media.. 07:59:43.619 pjsua_aud.c ....Audio channel update.. 07:59:43.619 strm0x118001a2 .....VAD temporarily disabled 07:59:43.619 strm0x118001a2 .....Encoder stream started 07:59:43.619 strm0x118001a2 .....Decoder stream started 07:59:43.619 pjsua_media.c ....Audio updated, stream #0: speex (sendrecv) 07:59:43.619 pjsua_vid.c ....Video channel update.. 07:59:43.621 vstenc0x118015 .....Encoder stream started 07:59:43.622 vstdec0x118015 .....Decoder stream started 07:59:43.622 pjsua_vid.c .....Setting up RX.. 07:59:43.622 pjsua_vid.c ......Creating video window: type=stream, cap_id=-1, rend_id=2 07:59:43.622 vid_port.c .......Opening device SDL renderer [SDL] for render: format=I420, size=352x288 @45000:1001 fps 07:59:43.689 vid_port.c !.......Device SDL renderer [SDL] opened: format=I420, size=352x288 @45000:1001 fps 07:59:43.689 pjsua_vid.c .......stream window id 0 created for cap_dev=-1 rend_dev=2 07:59:43.689 pjsua_vid.c .......Window 0 created 07:59:43.689 sdl_dev.c ......Starting sdl video stream 07:59:43.690 pjsua_vid.c .....Setting up TX.. 07:59:43.690 pjsua_vid.c ......Creating video window: type=preview, cap_id=0, rend_id=2 HERE vid_port.c ASSERT AT LINE 246 TRIGGERS WITH "di.fmt_cnt" BEING '0' (I commented this assert out for now to see what happens then) 07:59:43.690 vid_port.c .......Opening device Camera [QT] for capture: format=, size=176x144 @30000:3003 fps 07:59:43.690 vid_port.c .......Closing Camera.. 07:59:43.690 pjsua_vid.c .......Window 1: destroying.. 07:59:43.690 pjsua_media.c .....pjsua_vid_channel_update() failed for call_id 0 media 1: Bad or invalid video device format (PJMEDIA_EVID_BADFORMAT) 07:59:43.690 pjsua_app.c ....Call 0 media 0 [type=audio], status is Active 07:59:43.690 pjsua_aud.c ....Conf disconnect: 2 -x- 0 07:59:43.690 conference.c .....Port 2 (ring) stop transmitting to port 0 (Built-in Line Input) 07:59:43.690 pjsua_aud.c ....Conf connect: 3 --> 0 07:59:43.690 conference.c .....Port 3 (sip:eeri at 192.168.2.102) transmitting to port 0 (Built-in Line Input) 07:59:43.690 pjsua_aud.c ....Conf connect: 0 --> 3 07:59:43.690 conference.c .....Port 0 (Built-in Line Input) transmitting to port 3 (sip:eeri at 192.168.2.102) 07:59:43.690 pjsua_app.c ....Call 0 media 1 [type=video], status is None 07:59:43.697 pjsua_app.c ....Just rejected incoming video offer on call 0, use "vid call enable 1" or "vid call add" to enable video! 07:59:43.697 pjsua_core.c .....TX 956 bytes Response msg 200/INVITE/cseq=20 (tdta0x102883a00) to UDP 192.168.2.102:5060: Finally following the screen-log advice above and executing vid call enable 1 then this resulted in Assertion failed: (call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls), function pjsua_call_set_vid_strm, file ../src/pjsua-lib/pjsua_vid.c, line 2044. and pjsua terminated. At this point I gave up for now to look for help. Being new to SIP technologies probably I have some misunderstandings in basic concepts. I was looking for methods how to adjust camera resolution and framerate in order to willfully influence transmission bandwidth to be used (to maximise video quality at the price of smaller frame size and lower framerate); I am thankful for any help here how to achieve this. Eeri Kask P.S. The camera is OK, working just fine with every other video-chat program under OSX (iChat, skype, xmeeting, and some less popular ones). P.P.S. I am willing to accomplish further tests if this is helpful.