rotation of video frames from camera

102 views
Skip to first unread message

Juha Heinanen

unread,
May 10, 2020, 10:35:55 AM5/10/20
to baresip
I have now solved most video related problems in my baresip Android app except rotation of video frames from the camera. If screen of the device is in portrait mode, video frames from the camera are sent and showed on selfview as rotated clockwise 90 degrees. Does baresip include some filter or some other means that I could use to rotate the camera frames by a given amount of degrees clockwise or counter clockwise?

-- Juha

Juha Heinanen

unread,
May 13, 2020, 12:44:18 PM5/13/20
to baresip
After studying this a bit, I got the impression that video from android_camera has camera rotation information in video's metadata.  If this is so, is baresip able to read the metadata and show the video as it was recorded?

-- Juha

Alfred E. Heggestad

unread,
May 14, 2020, 6:21:34 AM5/14/20
to Juha Heinanen, baresip
the video frame is transported from avformat to core
using struct vid_frame. this type has no orientation info.


your best option is probably to manually
rotate the frame, +/- 90 degrees.




/alfred

Juha Heinanen

unread,
May 14, 2020, 7:19:48 AM5/14/20
to Alfred E. Heggestad, baresip
Alfred E. Heggestad writes:

> the video frame is transported from avformat to core
> using struct vid_frame. this type has no orientation info.
>
> your best option is probably to manually
> rotate the frame, +/- 90 degrees.

I don't know much about video. Where would I need to place that code?

Juha Heinanen

unread,
Dec 6, 2020, 8:35:42 AM12/6/20
to baresip
I tested this again now that we have /dialdir and /video_dir menu
commands.

If selfview is in pip mode, selfview shows OK when video starts in
sendrecv mode. If I then change video to be sendonly, selfview video
stops, but window that contains the selfview is still there.

Is there some way to keep showing selfview when remote is not sending
video? Perhaps somehow faking the incoming video stream?

-- Juha

Juha Heinanen

unread,
Jan 5, 2021, 11:06:59 AM1/5/21
to baresip
I'm still struggling with this. I made a test using config line:

video_selfview window

Then when Android user 'bar' answers call

/dialdir bar audio=sendrecv video=sendonly

from Linux user 'test', bar's selfview is properly shown on Android
screen, but no video frames are sent to 'test'.

Debug of the call (with audio lines removed) is below. There is no
errors, but when I during the call make video_debug() call, it shows
that video tx stream is not started although video source is started.
Any ideas why tx stream is not started and no video frames are sent to
'test'?

-- Juha

01-05 17:35:51.451 13000 13078 D Baresip Lib: call: answering call on line 1 from sip:te...@test.tutpro.com with 200
01-05 17:35:51.452 13000 13078 D Baresip Lib: stream: update 'video'
01-05 17:35:51.453 13000 13078 D Baresip Lib: stream: video: starting RTCP with remote 192.168.43.159:13625
01-05 17:35:51.599 13000 13078 D Baresip Lib: video: update
01-05 17:35:51.599 13000 13078 D Baresip Lib: Set video encoder: VP9 (500000 bit/s, 25.00 fps)
01-05 17:35:51.599 13000 13078 D Baresip Lib: video: start source
01-05 17:35:51.599 13000 13078 D Baresip Lib: avformat: video: alloc dev='android_camera,1'
01-05 17:35:51.599 13000 13078 D Baresip Lib: avformat: using format 'android_camera' ()
01-05 17:35:51.639 13000 13078 D Baresip Lib: [android_camera @ 0x7a5fdac400] Requested framerate 25 not available, falling back to min: 15 and max: 15 fps
01-05 17:35:51.646 13000 13078 D Baresip Lib: [android_camera @ 0x7a5fdac400] Android camera capture session is active.
01-05 17:35:52.115 13000 13078 D Baresip Lib: avformat: 'video' using decoder 'rawvideo' ()
01-05 17:35:52.115 13000 13078 D Baresip Lib: video: stopping video display ..
01-05 17:35:52.124 13000 13077 D Baresip Lib: ua event (CALL_RTCP) video
01-05 17:35:52.158 13000 13078 D Baresip Lib: call: stream start (active=1)
01-05 17:35:52.158 13000 13078 D Baresip Lib: video: update
01-05 17:35:52.158 13000 13078 D Baresip Lib: video: stopping video display ..
01-05 17:35:57.141 13000 13077 D Baresip Lib: ua event (CALL_RTCP) video
01-05 17:35:59.756 13000 13000 D Baresip Lib:
01-05 17:35:59.756 13000 13000 D Baresip Lib: --- Video stream ---
01-05 17:35:59.756 13000 13000 D Baresip Lib: source started: yes
01-05 17:35:59.756 13000 13000 D Baresip Lib: display started: no
01-05 17:35:59.756 13000 13000 D Baresip Lib: tx: encode: VP9 ???
01-05 17:35:59.756 13000 13000 D Baresip Lib: source: avformat 800 x 600, fps=25.00 frames=115
01-05 17:35:59.756 13000 13000 D Baresip Lib: skipc=0 sendq=0
01-05 17:35:59.756 13000 13000 D Baresip Lib: time = (not started)
01-05 17:35:59.756 13000 13000 D Baresip Lib: rx: decode: none ???
01-05 17:35:59.756 13000 13000 D Baresip Lib: vidisp: none 0 x 0 frames=0
01-05 17:35:59.756 13000 13000 D Baresip Lib: n_keyframes=0, n_picup=0
01-05 17:35:59.756 13000 13000 D Baresip Lib: time = (not started)
01-05 17:35:59.756 13000 13000 D Baresip Lib: video tx pipeline: avformat ---> selfview_window ---> VP9
01-05 17:35:59.756 13000 13000 D Baresip Lib: video rx pipeline: disp <--- decoder
01-05 17:35:59.756 13000 13000 D Baresip Lib: video dir=sendonly pt_enc=96
01-05 17:35:59.756 13000 13000 D Baresip Lib: local: 0.0.0.0:21080, remote: 192.168.43.159:13624/192.168.43.159:13625
01-05 17:35:59.756 13000 13000 D Baresip Lib: mnat: (none) (connected=no)
01-05 17:35:59.756 13000 13000 D Baresip Lib: menc: (none) (secure=no)
01-05 17:35:59.756 13000 13000 D Baresip Lib: RTP debug:
01-05 17:35:59.756 13000 13000 D Baresip Lib: Encode: seq=6425 ssrc=0xcb0bedd6
01-05 17:35:59.756 13000 13000 D Baresip Lib: ----- RTCP Session: -----
01-05 17:35:59.756 13000 13000 D Baresip Lib: cname=sip:b...@test.tutpro.com SSRC=0xcb0bedd6/3406556630 rx=90000Hz
01-05 17:35:59.756 13000 13000 D Baresip Lib: member 0xcee0742d: lost=0 Jitter=0.0ms RTT=0.0ms
01-05 17:35:59.756 13000 13000 D Baresip Lib: IP=192.168.43.159:13624 psent=2 rcvd=2
01-05 17:35:59.756 13000 13000 D Baresip Lib: TX: packets=0, octets=0
01-05 17:35:59.756 13000 13000 D Baresip Lib: --- jitter buffer debug---
01-05 17:35:59.756 13000 13000 D Baresip Lib: running=0 min=5 cur=0 max=10 [frames]
01-05 17:35:59.756 13000 13000 D Baresip Lib: seq_put=0

Juha Heinanen

unread,
Jan 5, 2021, 11:23:01 AM1/5/21
to baresip
'Juha Heinanen' via baresip writes:

> Then when Android user 'bar' answers call
>
> /dialdir bar audio=sendrecv video=sendonly

There was typo in the above. Video direction in the call to 'bar' call
was video=recvonly:

/dialdir bar audio=sendrecv video=recvonly

which is sendonly at 'bar'.

-- Juha

j...@tutpro.com

unread,
Jan 6, 2021, 3:42:37 AM1/6/21
to baresip
I made another test where Linux app dialdir'ed  Android app with video=recvonly.  This time I had commented out `module selfview.so` from Android app  config.  Then video frames were sent OK from Android app to Linux app.

Then I again enabled selfview module with `video_selfview window` in Android app and made another call.  As before, selfview showed up on Android screen, but no video frames were sent out.   The difference is that in the second test, video debug shows:

01-06 09:28:50.912 29324 29324 D Baresip Lib: --- Video stream ---
01-06 09:28:50.912 29324 29324 D Baresip Lib:  source started: yes
01-06 09:28:50.912 29324 29324 D Baresip Lib:  display started: no
01-06 09:28:50.912 29324 29324 D Baresip Lib:  tx: encode: VP9 ???
01-06 09:28:50.912 29324 29324 D Baresip Lib:      source: avformat 800 x 600, fps=25.00 frames=99
01-06 09:28:50.912 29324 29324 D Baresip Lib:      skipc=0 sendq=0
01-06 09:28:50.912 29324 29324 D Baresip Lib:      time = (not started)

i.e., encoding format is `???` when it in the first test is `yuv420p`.  In both tests there is line `videoenc_format yuv420p` in the config.

Log of both tests is below.

-- Juha

---------------- first test
09:20:16.203 28733 28805 D : ua event (CALL_INCOMING) sip:te...@test.tutpro.com
09:20:16.204 28733 28806 D : ua: sipsess connect via TCP 192.168.43.159:5060 --> 192.168.43.36:45162
09:20:16.204 28733 28806 D : ua: using AF from sdp offer: af=AF_INET
09:20:16.204 28733 28806 D : call: alloc with params laddr=109:28:42.160 29324 29417 D : ua event (CALL_INCOMING) sip:te...@test.tutpro.com
09:28:43.697 29324 29418 D : call: answering call on line 1 from sip:te...@test.tutpro.com with 200
09:28:43.697 29324 29418 D : call: update media
09:28:43.697 29324 29324 D : ua event (CALL_REMOTE_SDP) offer
09:28:43.698 29324 29418 D : stream: update 'video'
09:28:43.698 29324 29418 D : stream: video: starting RTCP with remote 192.168.43.159:14395
09:28:43.847 29324 29418 D : video: update
09:28:43.847 29324 29418 D : Set video encoder: VP9  (500000 bit/s, 25.00 fps)
09:28:43.847 29324 29418 D : video: start source
09:28:43.847 29324 29418 D : avformat: video: alloc dev='android_camera,1'
09:28:43.847 29324 29418 D : avformat: using format 'android_camera' ()
09:28:43.887 29324 29418 D : [android_camera @ 0x7a61f68e00] Requested framerate 25 not available, falling back to min: 15 and max: 15 fps
09:28:43.894 29324 29418 D : [android_camera @ 0x7a61f68e00] Android camera capture session is active.
09:28:44.363 29324 29418 D : avformat: 'video' using decoder 'rawvideo' ()
09:28:44.363 29324 29418 D : video: stopping video display ..
09:28:44.363 29324 29324 D : ua event (CALL_LOCAL_SDP) answer
09:28:44.371 29324 29517 D Baresip vidisp: At opengles_alloc() on thread 525592046928
09:28:44.372 29324 29417 D : ua event (CALL_RTCP) audio
09:28:44.372 29324 29417 D : ua event (CALL_RTCP) video
09:28:44.375 29324 29517 D Baresip vidisp: Render buffer w/h = 720/1370
09:28:44.378 29324 29517 D Baresip vidisp: Rendered context initialized
09:28:44.386 29324 29517 D Baresip vidisp: video frame width/height = 800/600
09:28:44.391 29324 29418 D : call: stream start (active=1)
09:28:44.391 29324 29418 D : video: update
09:28:44.403 29324 29417 D : ua event (CALL_ESTABLISHED) sip:te...@test.tutpro.com
09:28:44.404 29324 29418 D : video: stopping video display ..
09:28:44.404 29324 29418 D : b...@test.tutpro.com: Call established: sip:te...@test.tutpro.com
09:28:49.393 29324 29417 D : ua event (CALL_RTCP) audio
09:28:49.393 29324 29417 D : ua event (CALL_RTCP) video
09:28:50.912 29324 29324 D : 
09:28:50.912 29324 29324 D : --- Video stream ---
09:28:50.912 29324 29324 D :  source started: yes
09:28:50.912 29324 29324 D :  display started: no
09:28:50.912 29324 29324 D :  tx: encode: VP9 ???
09:28:50.912 29324 29324 D :      source: avformat 800 x 600, fps=25.00 frames=99
09:28:50.912 29324 29324 D :      skipc=0 sendq=0
09:28:50.912 29324 29324 D :      time = (not started)
09:28:50.912 29324 29324 D :  rx: decode: none ???
09:28:50.912 29324 29324 D :      vidisp: none 0 x 0 frames=0
09:28:50.912 29324 29324 D :      n_keyframes=0, n_picup=0
09:28:50.912 29324 29324 D :      time = (not started)
09:28:50.912 29324 29324 D : video tx pipeline:   avformat ---> selfview_window ---> VP9
09:28:50.912 29324 29324 D : video rx pipeline:       disp <--- decoder
09:28:50.912 29324 29324 D :  video dir=sendonly pt_enc=96
09:28:50.912 29324 29324 D :  local: 0.0.0.0:44112, remote: 192.168.43.159:14394/192.168.43.159:14395
09:28:50.912 29324 29324 D :  mnat: (none) (connected=no)
09:28:50.912 29324 29324 D :  menc: (none) (secure=no)
09:28:50.912 29324 29324 D : RTP debug:
09:28:50.912 29324 29324 D :  Encode: seq=22753 ssrc=0xf67f3bec
09:28:50.912 29324 29324 D : ----- RTCP Session: -----
09:28:50.912 29324 29324 D :   cname=sip:b...@test.tutpro.com SSRC=0xf67f3bec/4135533548 rx=90000Hz
09:28:50.912 29324 29324 D :   member 0x2a8cd172: lost=0 Jitter=0.0ms RTT=0.0ms
09:28:50.912 29324 29324 D :                  IP=192.168.43.159:14394 psent=2 rcvd=2
09:28:50.912 29324 29324 D :   TX: packets=0, octets=0
09:28:50.912 29324 29324 D : --- jitter buffer debug---
09:28:50.912 29324 29324 D :  running=0 min=5 cur=0 max=10 [frames]
09:28:50.912 29324 29324 D :  seq_put=0
09:28:42.160 29324 29417 D : ua event (CALL_INCOMING) sip:te...@test.tutpro.com
09:28:43.697 29324 29418 D : call: answering call on line 1 from sip:te...@test.tutpro.com with 200
09:28:43.697 29324 29418 D : call: update media
09:28:43.697 29324 29324 D : ua event (CALL_REMOTE_SDP) offer
09:28:43.698 29324 29418 D : stream: update 'video'
09:28:43.698 29324 29418 D : stream: video: starting RTCP with remote 192.168.43.159:14395
09:28:43.847 29324 29418 D : video: update
09:28:43.847 29324 29418 D : Set video encoder: VP9  (500000 bit/s, 25.00 fps)
09:28:43.847 29324 29418 D : video: start source
09:28:43.847 29324 29418 D : avformat: video: alloc dev='android_camera,1'
09:28:43.847 29324 29418 D : avformat: using format 'android_camera' ()
09:28:43.887 29324 29418 D : [android_camera @ 0x7a61f68e00] Requested framerate 25 not available, falling back to min: 15 and max: 15 fps
09:28:43.894 29324 29418 D : [android_camera @ 0x7a61f68e00] Android camera capture session is active.
09:28:44.363 29324 29418 D : avformat: 'video' using decoder 'rawvideo' ()
09:28:44.363 29324 29418 D : video: stopping video display ..
09:28:44.363 29324 29324 D : ua event (CALL_LOCAL_SDP) answer
09:28:44.371 29324 29517 D Baresip vidisp: At opengles_alloc() on thread 525592046928
09:28:44.372 29324 29417 D : ua event (CALL_RTCP) audio
09:28:44.372 29324 29417 D : ua event (CALL_RTCP) video
09:28:44.375 29324 29517 D Baresip vidisp: Render buffer w/h = 720/1370
09:28:44.378 29324 29517 D Baresip vidisp: Rendered context initialized
09:28:44.386 29324 29517 D Baresip vidisp: video frame width/height = 800/600
09:28:44.391 29324 29418 D : call: stream start (active=1)
09:28:44.391 29324 29418 D : video: update
09:28:44.403 29324 29417 D : ua event (CALL_ESTABLISHED) sip:te...@test.tutpro.com
09:28:44.404 29324 29418 D : video: stopping video display ..
09:28:44.404 29324 29418 D : b...@test.tutpro.com: Call established: sip:te...@test.tutpro.com
09:28:49.393 29324 29417 D : ua event (CALL_RTCP) audio
09:28:49.393 29324 29417 D : ua event (CALL_RTCP) video
09:28:50.912 29324 29324 D : 
09:28:50.912 29324 29324 D : --- Video stream ---
09:28:50.912 29324 29324 D :  source started: yes
09:28:50.912 29324 29324 D :  display started: no
09:28:50.912 29324 29324 D :  tx: encode: VP9 ???
09:28:50.912 29324 29324 D :      source: avformat 800 x 600, fps=25.00 frames=99
09:28:50.912 29324 29324 D :      skipc=0 sendq=0
09:28:50.912 29324 29324 D :      time = (not started)
09:28:50.912 29324 29324 D :  rx: decode: none ???
09:28:50.912 29324 29324 D :      vidisp: none 0 x 0 frames=0
09:28:50.912 29324 29324 D :      n_keyframes=0, n_picup=0
09:28:50.912 29324 29324 D :      time = (not started)
09:28:50.912 29324 29324 D : video tx pipeline:   avformat ---> selfview_window ---> VP9
09:28:50.912 29324 29324 D : video rx pipeline:       disp <--- decoder
09:28:50.912 29324 29324 D :  video dir=sendonly pt_enc=96
09:28:50.912 29324 29324 D :  local: 0.0.0.0:44112, remote: 192.168.43.159:14394/192.168.43.159:14395
09:28:50.912 29324 29324 D :  mnat: (none) (connected=no)
09:28:50.912 29324 29324 D :  menc: (none) (secure=no)
09:28:50.912 29324 29324 D : RTP debug:
09:28:50.912 29324 29324 D :  Encode: seq=22753 ssrc=0xf67f3bec
09:28:50.912 29324 29324 D : ----- RTCP Session: -----
09:28:50.912 29324 29324 D :   cname=sip:b...@test.tutpro.com SSRC=0xf67f3bec/4135533548 rx=90000Hz
09:28:50.912 29324 29324 D :   member 0x2a8cd172: lost=0 Jitter=0.0ms RTT=0.0ms
09:28:50.912 29324 29324 D :                  IP=192.168.43.159:14394 psent=2 rcvd=2
09:28:50.912 29324 29324 D :   TX: packets=0, octets=0
09:28:50.912 29324 29324 D : --- jitter buffer debug---
09:28:50.912 29324 29324 D :  running=0 min=5 cur=0 max=10 [frames]
09:28:50.912 29324 29324 D :  seq_put=0
92.168.43.36, af=AF_INET, use_rtp=1
09:20:16.204 28733 28806 D : call: use_video=1
09:20:17.391 28733 28806 D : call: answering call on line 1 from sip:te...@test.tutpro.com with 200
09:20:17.391 28733 28806 D : call: update media
09:20:17.391 28733 28733 D : ua event (CALL_REMOTE_SDP) offer
09:20:17.392 28733 28806 D : stream: update 'video'
09:20:17.392 28733 28806 D : stream: video: starting RTCP with remote 192.168.43.159:14349
09:20:17.511 28733 28806 D : video: update
09:20:17.511 28733 28806 D : Set video encoder: VP9  (500000 bit/s, 25.00 fps)
09:20:17.512 28733 28806 D : video: start source
09:20:17.512 28733 28806 D : avformat: video: alloc dev='android_camera,1'
09:20:17.512 28733 28806 D : avformat: using format 'android_camera' ()
09:20:17.552 28733 28806 D : [android_camera @ 0x7a61f7d200] Requested framerate 25 not available, falling back to min: 15 and max: 15 fps
09:20:17.558 28733 28806 D : [android_camera @ 0x7a61f7d200] Android camera capture session is active.
09:20:18.024 28733 28733 D : ua event (CALL_LOCAL_SDP) answer
09:20:18.024 28733 28806 D : avformat: 'video' using decoder 'rawvideo' ()
09:20:18.024 28733 28806 D : video: stopping video display ..
09:20:18.035 28733 28805 D : ua event (CALL_RTCP) video
09:20:18.060 28733 28806 D : call: stream start (active=1)
09:20:18.060 28733 28806 D : video: update
09:20:18.065 28733 28806 D : vp9: encoder opened, picture size 800 x 600
09:20:18.107 28733 28805 D : ua event (CALL_ESTABLISHED) sip:te...@test.tutpro.com
09:20:18.108 28733 28806 D : video: stopping video display ..
09:20:18.108 28733 28806 D : b...@test.tutpro.com: Call established: sip:te...@test.tutpro.com
09:20:18.771 28733 28805 D : ua event (CALL_RTPESTAB) audio
09:20:23.102 28733 28805 D : ua event (CALL_RTCP) audio
09:20:23.102 28733 28805 D : ua event (CALL_RTCP) video
09:20:24.059 28733 28733 D : 
09:20:24.059 28733 28733 D : --- Video stream ---
09:20:24.059 28733 28733 D :  source started: yes
09:20:24.059 28733 28733 D :  display started: no
09:20:24.059 28733 28733 D :  tx: encode: VP9 yuv420p
09:20:24.059 28733 28733 D :      source: avformat 800 x 600, fps=25.00 frames=91
09:20:24.059 28733 28733 D :      skipc=23 sendq=0
09:20:24.059 28733 28733 D :      time = 5.918 sec
09:20:24.059 28733 28733 D :  rx: decode: none ???
09:20:24.059 28733 28733 D :      vidisp: none 0 x 0 frames=0
09:20:24.059 28733 28733 D :      n_keyframes=0, n_picup=0
09:20:24.059 28733 28733 D :      time = (not started)
09:20:24.059 28733 28733 D :  video dir=sendonly pt_enc=96
09:20:24.059 28733 28733 D :  local: 0.0.0.0:7422, remote: 192.168.43.159:14348/192.168.43.159:14349
09:20:24.059 28733 28733 D :  mnat: (none) (connected=no)
09:20:24.059 28733 28733 D :  menc: (none) (secure=no)
09:20:24.059 28733 28733 D : RTP debug:
09:20:24.059 28733 28733 D :  Encode: seq=6688 ssrc=0xe8b24948
09:20:24.059 28733 28733 D : ----- RTCP Session: -----
09:20:24.059 28733 28733 D :   cname=sip:b...@test.tutpro.com SSRC=0xe8b24948/3903998280 rx=90000Hz
09:20:24.059 28733 28733 D :   member 0xba453ae7: lost=0 Jitter=11.8ms RTT=83.7ms
09:20:24.059 28733 28733 D :                  IP=192.168.43.159:14348 psent=2 rcvd=2
09:20:24.059 28733 28733 D :   TX: packets=158, octets=132117
09:20:24.059 28733 28733 D : --- jitter buffer debug---
09:20:24.059 28733 28733 D :  running=0 min=5 cur=0 max=10 [frames]
09:20:24.059 28733 28733 D :  seq_put=0

---------------- second test
09:28:42.160 29324 29417 D : ua event (CALL_INCOMING) sip:te...@test.tutpro.com
09:28:43.697 29324 29418 D : call: answering call on line 1 from sip:te...@test.tutpro.com with 200
09:28:43.697 29324 29418 D : call: update media
09:28:43.697 29324 29324 D : ua event (CALL_REMOTE_SDP) offer
09:28:43.698 29324 29418 D : stream: update 'video'
09:28:43.698 29324 29418 D : stream: video: starting RTCP with remote 192.168.43.159:14395
09:28:43.847 29324 29418 D : video: update
09:28:43.847 29324 29418 D : Set video encoder: VP9  (500000 bit/s, 25.00 fps)
09:28:43.847 29324 29418 D : video: start source
09:28:43.847 29324 29418 D : avformat: video: alloc dev='android_camera,1'
09:28:43.847 29324 29418 D : avformat: using format 'android_camera' ()
09:28:43.887 29324 29418 D : [android_camera @ 0x7a61f68e00] Requested framerate 25 not available, falling back to min: 15 and max: 15 fps
09:28:43.894 29324 29418 D : [android_camera @ 0x7a61f68e00] Android camera capture session is active.
09:28:44.363 29324 29418 D : avformat: 'video' using decoder 'rawvideo' ()
09:28:44.363 29324 29418 D : video: stopping video display ..
09:28:44.363 29324 29324 D : ua event (CALL_LOCAL_SDP) answer
09:28:44.371 29324 29517 D Baresip vidisp: At opengles_alloc() on thread 525592046928
09:28:44.372 29324 29417 D : ua event (CALL_RTCP) audio
09:28:44.372 29324 29417 D : ua event (CALL_RTCP) video
09:28:44.375 29324 29517 D Baresip vidisp: Render buffer w/h = 720/1370
09:28:44.378 29324 29517 D Baresip vidisp: Rendered context initialized
09:28:44.386 29324 29517 D Baresip vidisp: video frame width/height = 800/600
09:28:44.391 29324 29418 D : call: stream start (active=1)
09:28:44.391 29324 29418 D : video: update
09:28:44.403 29324 29417 D : ua event (CALL_ESTABLISHED) sip:te...@test.tutpro.com
09:28:44.404 29324 29418 D : video: stopping video display ..
09:28:44.404 29324 29418 D : b...@test.tutpro.com: Call established: sip:te...@test.tutpro.com
09:28:49.393 29324 29417 D : ua event (CALL_RTCP) audio
09:28:49.393 29324 29417 D : ua event (CALL_RTCP) video
09:28:50.912 29324 29324 D : 
09:28:50.912 29324 29324 D : --- Video stream ---
09:28:50.912 29324 29324 D :  source started: yes
09:28:50.912 29324 29324 D :  display started: no
09:28:50.912 29324 29324 D :  tx: encode: VP9 ???
09:28:50.912 29324 29324 D :      source: avformat 800 x 600, fps=25.00 frames=99
09:28:50.912 29324 29324 D :      skipc=0 sendq=0
09:28:50.912 29324 29324 D :      time = (not started)
09:28:50.912 29324 29324 D :  rx: decode: none ???
09:28:50.912 29324 29324 D :      vidisp: none 0 x 0 frames=0
09:28:50.912 29324 29324 D :      n_keyframes=0, n_picup=0
09:28:50.912 29324 29324 D :      time = (not started)
09:28:50.912 29324 29324 D : video tx pipeline:   avformat ---> selfview_window ---> VP9
09:28:50.912 29324 29324 D : video rx pipeline:       disp <--- decoder
09:28:50.912 29324 29324 D :  video dir=sendonly pt_enc=96
09:28:50.912 29324 29324 D :  local: 0.0.0.0:44112, remote: 192.168.43.159:14394/192.168.43.159:14395
09:28:50.912 29324 29324 D :  mnat: (none) (connected=no)
09:28:50.912 29324 29324 D :  menc: (none) (secure=no)
09:28:50.912 29324 29324 D : RTP debug:
09:28:50.912 29324 29324 D :  Encode: seq=22753 ssrc=0xf67f3bec
09:28:50.912 29324 29324 D : ----- RTCP Session: -----
09:28:50.912 29324 29324 D :   cname=sip:b...@test.tutpro.com SSRC=0xf67f3bec/4135533548 rx=90000Hz
09:28:50.912 29324 29324 D :   member 0x2a8cd172: lost=0 Jitter=0.0ms RTT=0.0ms
09:28:50.912 29324 29324 D :                  IP=192.168.43.159:14394 psent=2 rcvd=2
09:28:50.912 29324 29324 D :   TX: packets=0, octets=0
09:28:50.912 29324 29324 D : --- jitter buffer debug---
09:28:50.912 29324 29324 D :  running=0 min=5 cur=0 max=10 [frames]
09:28:50.912 29324 29324 D :  seq_put=0


Message has been deleted
Message has been deleted

Alfred E. Heggestad

unread,
Apr 25, 2021, 7:43:01 AM4/25/21
to Juha Heinanen, baresip


On 21/04/2021 17:24, 'Juha Heinanen' via baresip wrote:
> I have configured in an account
>
> ;medianat=stun;stunserver="stun:stun.l.google.com:19302"
>
> When I start baresip, I get to console:
>
> using stunserver: 'stun:stun.l.google.com:19302'
> te...@test.tutpro.com: Using sipnat: 'outbound'
> te...@test.tutpro.com: Using medianat 'stun'
>
> But when the account registers, I don't see with wireshark any packets
> sent to port 19302 and Contact URI has local IP address.
>
> How should stun be activated? What is it that I'm doing wrong?
>

hi,


We dont support STUN for the SIP traffic. this is an old-school
way of solving NAT-traversal for SIP, and it is not stable.
the recommended way is using SIP Outbound or Kamailio/Nathelper.

# ;sipnat={outbound}
# ;medianat={stun,turn,ice}


STUN for medianat is also not stable, I am wondering if we should
remove it. TURN and ICE is stable.




/alfred

Juha Heinanen

unread,
Apr 25, 2021, 7:53:24 AM4/25/21
to Alfred E. Heggestad, baresip
Alfred E. Heggestad writes:

> We dont support STUN for the SIP traffic. this is an old-school
> way of solving NAT-traversal for SIP, and it is not stable.

Yes, I figured that out too.

> the recommended way is using SIP Outbound or Kamailio/Nathelper.
>
> # ;sipnat={outbound}
> # ;medianat={stun,turn,ice}
>
> STUN for medianat is also not stable, I am wondering if we should
> remove it. TURN and ICE is stable.

Based on what I have learned from my baresip Android app users,
;medianat=stun is still being used. So I would prefer to keep it until
some fatal issue shows up.

-- Juha


Reply all
Reply to author
Forward
0 new messages