androidthings / sample-videoRTC

Apache License 2.0
97 stars 51 forks source link

Performance too slow 1 fps #5

Open thaihuynhxyz opened 5 years ago

thaihuynhxyz commented 5 years ago

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 commented 5 years ago

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

thaihuynhxyz commented 5 years ago

Hi @jairobjunior

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

jairobjunior commented 5 years ago

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 commented 5 years ago

@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.