Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Performance too slow 1 fps #5

Open
thaihuynhxyz opened this issue Oct 24, 2018 · 4 comments
Open

Performance too slow 1 fps #5

thaihuynhxyz opened this issue Oct 24, 2018 · 4 comments

Comments

@thaihuynhxyz
Copy link

Raspberry Pi 3 Model B V1.2
Android version: 8.1.0
Android Things version: 1.0.5
Raspberry Pi Camera Rev 1.3

CameraStatistics: CameraStatistics: Camera fps: 1.

If I gone SurfaceViewRenderer view in layout. I got log:
CameraStatistics: CameraStatistics: Camera fps: 30.
I assume the cost to render view too much.

After another client connect to room:

libjingle: (rtp_video_stream_receiver.cc:287): Packet received on SSRC: 1778618134 with payload type: 100, timestamp: 2951056785, sequence number: 21127, arrival time: 1540374348420
libjingle: (webrtcvideoengine.cc:2056): VideoSendStream stats: 1339369, {input_fps: 1, encode_fps: 1, encode_ms: 1792, encode_usage_perc: 64, target_bps: 1700000, media_bps: 820184, preferred_media_bitrate_bps: 1700000, suspended: false, bw_adapted: false} {ssrc: 2090405752, width: 1280, height: 720, key: 2, delta: 6, total_bps: 838312, retransmit_bps: 0, avg_delay_ms: 1835, max_delay_ms: 1905, cum_loss: 0, max_ext_seq: 12970, nack: 0, fir: 0, pli: 1}
libjingle: (webrtcvideoengine.cc:2521): VideoReceiveStream stats: 1339369, {ssrc: 1778618134, total_bps: 62016, width: 1280, height: 720, key: 4, delta: 601, network_fps: 30, decode_fps: 20, render_fps: 20, decode_ms: 61, max_decode_ms: 72, cur_delay_ms: 118, targ_delay_ms: 118, jb_delay_ms: 36, min_playout_delay_ms: 34, discarded: 0, sync_offset_ms: 5047, cum_loss: 0, max_ext_seq: 21105, nack: 0, fir: 0, pli: 0}
libjingle: (webrtcvideoengine.cc:1382): Call stats: 1339369, {send_bw_bps: 2126724, recv_bw_bps: 0, max_pad_bps: 0, pacer_delay_ms: 0, rtt_ms: 2}
libjingle: (remote_ntp_time_estimator.cc:74): RTP timestamp: 1812570972 in NTP clock: 3749363148643 estimated time in receiver clock: 1339542 converted to NTP clock: 3749363148654
CameraStatistics: CameraStatistics: Camera fps: 1.

Should I upgrade hardware that stronger than Raspberry Pi 3 to make a streaming device?

@jairobjunior
Copy link

jairobjunior commented Oct 28, 2018

@thaihuynhxyz, a few insights/questions that might help you:

  • What is the FPS you get using just the Camera 2 to display the viewfinder/preview?
  • Connect the ethernet cable, while you are live-streaming, to see if it's a wifi issue or if it's distant to the router;
  • 1 FPS is really bad, but changing the resolution + bitrate will help in general;
  • Disable any post-processing if there is any;

@thaihuynhxyz
Copy link
Author

Hi @jairobjunior

  • The FPS when use Camera 2 to display is 1. I think due to I connect with Big display (PC Monitor :D). If I hide SurfaceViewRenderer in layout to ignore render on display. The FPS will be 30
  • I use cable.
  • I have to change resolution to 320x240 to increase it to ~4fps (still slow with bad resolution) and 17
  • What's post-processing you want to mention?

Please tell me if you have any idea? I'd like to improve the performance and the resolution.

@jairobjunior
Copy link

I meant to say have you tested using an off-the-shelf Camera 2 app without Webrtc implementation and no live-streaming? Just a Camera2Basic app?

I don't have that camera hardware/module so I am trying to understand what FPS you get when you don't use Webrtc at all. But I do have an USB camera (Webcam) that works fine.

Post-processing would be any extra implementation you add on top of the frames, things like: face detection, filters, AR, CV etc

@thaihuynhxyz
Copy link
Author

@jairobjunior Sorry for late response. I install Camera2Basic but cannot start because ANR. I don't use any post-processing, just install this sample. From log I see decode_ms: 61 but encode_ms: 1792, I think that's why it slow.

Before streaming (another client connect, I receive 30fps from camera
com.example.androidthings.videortc I/CameraStatistics: CameraStatistics: Camera fps: 30.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants