deepch / RTSPtoWeb

RTSP Stream to WebBrowser
MIT License
1.17k stars 284 forks source link

Windows - Setting Audio = True causes high cpu #409

Open t3therdev opened 7 months ago

t3therdev commented 7 months ago

When using rtsptoweb built on windows 10/11, it works fine and uses minimal cpu.

When enabling audio (setting audio=true) and using mse , the cpu goes to 45-50% for a single stream. audio works but cpu goes very high.

the source stream video/audio format is

Duration: N/A, start: 0.014188, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuvj420p(pc, smpte170m/smpte170m/bt709, progressive), 704x480 [SAR 10:11 DAR 4:3], 29.97 fps, 29.97 tbr, 90k tbn
  Stream #0:1: Audio: aac (LC), 16000 Hz, mono, fltp
t3therdev commented 7 months ago

Seems to be some interaction between the source stream (if it has audio or not) and the setting in RTSPtoweb. Sometime a restart helps to reduce cpu back to normal.

If the source rtsp stream has an aac audio track, it also uses higher cpu, even if audio is not enabled. enabling audio on some streams seems to have lower cpu than not enabling it. setting audio = false when stream has audio puts cpu usage to 43%. Setting to true actually has it lower.

Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 640x436 [SAR 1:1 DAR 160:109], 29 fps, 29 tbr, 90k tbn Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp

deepch commented 6 months ago

create cpu profile