juha-h / baresip-studio

baresip library based SIP client for Android
BSD 3-Clause "New" or "Revised" License
276 stars 70 forks source link

Input format not found (android_camera) #86

Closed snachmsm closed 4 years ago

snachmsm commented 4 years ago

First of all: thank you for your efforts and this whole project!

I'm testing video branch on Nokia 8 (Android 9) and Pixel 3 (Android 10). Audio is working fine for me (also on master ofc), but I've never transmitted single frame of video in any direction with any codec nor resolution (portrait and landscape)...

Some log when pressing icon in bottom left corner:

2020-06-10 15:06:41.821 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: avformat: video: alloc dev='android_camera,1' 2020-06-10 15:06:41.821 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: avformat: input format not found (android_camera) 2020-06-10 15:06:41.821 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: avformat: avformat_open_input(1) failed (ret=Protocol not found) 2020-06-10 15:06:41.821 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: video: could not set source to [640 x 480] No such file or directory 2020-06-10 15:06:41.821 25394-25394/com.tutpro.baresip.plus D/Baresip vidisp: At opengles_alloc() on thread 513155874512 2020-06-10 15:06:41.821 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: call: modify 2020-06-10 15:06:41.876 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: call: got SDP answer (427 bytes) 2020-06-10 15:06:41.876 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: call: update media 2020-06-10 15:06:41.876 25394-25428/com.tutpro.baresip.plus D/Baresip Lib: ua event (CALL_REMOTE_SDP) answer 2020-06-10 15:06:41.876 25394-25428/com.tutpro.baresip.plus D/Baresip Lib: sending ua/call 510704874960/509185922064 event remote call answered 2020-06-10 15:06:41.876 25394-25428/com.tutpro.baresip.plus D/Baresip Service: got uaEvent remote call answered/sip:2173@192.168.100.103/509185922064 2020-06-10 15:06:41.877 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: stream: update 'audio' 2020-06-10 15:06:41.877 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: stream: audio: starting RTCP with remote 192.168.100.221:17009 2020-06-10 15:06:41.877 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: stream: update 'video' 2020-06-10 15:06:41.878 25394-25394/com.tutpro.baresip.plus D/Baresip: Omit service event 'call update' for task -1 2020-06-10 15:06:41.880 25394-25394/com.tutpro.baresip.plus D/Baresip: Omit service event 'call update' for task -1 2020-06-10 15:06:41.880 25394-25394/com.tutpro.baresip.plus D/Baresip: Handling service event 'call update' for 510704874960 2020-06-10 15:06:41.880 25394-25394/com.tutpro.baresip.plus D/Baresip: Call does not have video stream

after "video +" icon press sometimes accept-video-dialog isn't showing on the other side, but then I can pick same icon on the other side - this will cause video streaming layout pops out automatically without any dialog on any side (but also without video like above) with some "audio glitch" (I'm seeing re-invite in logs)

as a bonus: log when I pick front cam icon during (no)video call

2020-06-10 15:35:47.355 25394-25394/com.tutpro.baresip.plus W/Baresip: Failed to set video source 2020-06-10 15:35:47.355 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: avformat: video: alloc dev='android_camera,0' avformat: input format not found (android_camera) avformat: avforma 2020-06-10 15:35:47.355 25394-25429/com.tutpro.baresip.plus D/Baresip Lib: t_open_input(0) failed (ret=Protocol not found) 2020-06-10 15:35:47.915 25394-25428/com.tutpro.baresip.plus D/Baresip Lib: ua event (CALL_RTCP) video

juha-h commented 4 years ago

Have you tried with baresip+ from F-Droid or Google Play? Are you sure that your devices support Camera2 API LEVEL3?

snachmsm commented 4 years ago

Well, I admit that I've started with building from your video branch today, never tested Play/F-droid baresip+ version. I've just tried and is working, kind of... Video is centered and small (not fitting width/height), very glitchy, oftenly hangs on start (on Pixel only?) and getting violet color filtering (wrong color encoding?). I've assumed that your app is checking camera API, it is showing no-camera-found dialog on my two other test devices. Pixel is "made by Google" so I bet it supports proper API level...

Few weeks ago I was testing master version built from sources (17.x) and from stores, was working well. Maybe I've messed up some native libs builds (at first I've accidentally put master-natives for video-baresip, causing no ffmpeg ninja error), will try build from scratch next week.

I think this issue may be closed for now. Thanks for suggestions and work :)

juha-h commented 4 years ago

You can check Camera2 API level with Camera2 Probe app. I have done my testing with Nokia 4.2 (Android 10) and don't have any other devices with Camera2 API LEVEL3.

snachmsm commented 4 years ago

Nokia 8 have two back and one front cam. Report from probe by ids: 0 - BACK - LEVEL_3 1 - FRONT - LEVEL_3

Pixel 3 have one back and two front cam. Report from probe by ids: 0 - BACK - LEVEL_3 1 - FRONT - FULL 2 - FRONT - LEVEL 3 3 - FRONT - LEVEL 3

I've just made fresh pulls on both repos (Android and native libs, ndk 21) building debug app "from scratch". Result similar like I've described in my second post... (so I've messed smth when building earlier, problably mixed some native libs/versions, so topic and first post isn't related to current issues).

Pixel calling to Nokia => small, glitchy, violet/pink preview on Nokia, Pixel is black. Nokia calling to Pixel => Nokia gets snapshot of first frame and thats all, Pixel still black... This is most often case, sometimes black screen on both sides, also sometimes second side won't show video-accept dialog (after that pressing "video +" will work then as auto-accept)

Have to go, will back to tests next week. Cheers!

juha-h commented 4 years ago

snachmsm writes:

Have to go, will back to tests next week. Cheers!

Try also with F-Droid or Google Play version.

snachmsm commented 4 years ago

My first post was about own-built version, which was malfomed as I see. After your response I've installed GP/F-droid version and my second post was about "production" version - glitches, wrong color encoding or even not working video at all (black layout). Third post - own-built version from fresh repo pulls - have similar issues. I will investigate this a bit more, but not earlier than tuesday, and put in here some logs and screenshots.

juha-h commented 4 years ago

I only have one LEVEL3 Android device and have been using Linphone on an older device to test video calling.

I just install latest baresip+ from Play Store to my LEVEL3 device (Nokia 4.2) and tested video against Linphone on the older device. It worked OK and I didn't notice the issue you mentioned.

I'm afraid that I'm not able to help if I cannot reproduce your issues using my own LEVEL3 device.

snachmsm commented 4 years ago

Screenshot from Nokia video-calling to Pixel. Pixel screen is black, not receiving video, no own preview.

https://i.imgur.com/VEgspiL.jpg

Opposite direction - both devices without single frame/pic/preview.

Linphone tests:

Sadly, Linphone won't connect using TCP (no matter of TLS on/off state), I've tested only with UDP. Baresip is working well on TCP. Also only baresip have proper two-side audio, Linphone is muted on both...

All above are tests on opensips local server. I've assumed some problems with routing, so I've just tried with public-IP iptel.org accounts:

I can provide you some logs from any of these scenarios/devices if you want/need.

SIP is a mess... :(

juha-h commented 4 years ago

snachmsm writes:

Screenshot from Nokia video-calling to Pixel. Pixel screen is black, not receiving video, no own preview.

Is this with latest baresip+ from F-Droid or Google Play?

Linphone tests:

  • Pixel-baresip to Nokia-Linphone - Nokia is receiving wrong-colored, laggy video, Pixel is black
  • Nokia-baresip to Pixel-Linphone - both no video/black
  • Linphone to baresip - connection always breaks just after video requesting
  • Linphone to Linphone - initiating call side won't get any video, called side is receiving properly

I don't have any video issues between latest Google Play Linphone on Nokia 3.1 and latest F-Droid baresip+ on Nokia 4.2. It is difficult to figure out/fix issues that I cannot reproduce myself.

All above are tests on opensips local server. I've assumed some problems with routing, so I've just tried with public-IP iptel.org accounts:

  • Linphone to Linphone - video working well video
  • baresip to baresip - no video on any side
  • Linphone-Pixel to baresip-Nokia and opposite - no video on any side
  • Linphone-Nokia to baresip-Pixel and opposite - Pixel receiving proper video, Nokia receiving laggy/blinking/violet

I can provide you some logs from any of these scenarios/devices if you want/need.

I'll add to next baresip+ version video debug when call ends. It tells if video frames were sent/received.

You could also try video calls between baresip+ and regular Linux baresip. That too works fine in my tests and Linux baresip shows you video frame stats real time.

juha-h commented 4 years ago

Closed due to inactivity. Reopen if more info is available.