You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When enable this filter, sometimes it causes dropped frame for main streaming and recording.
Current status of investigation
Profile
Checking rendering time with adding profile.
ajaof_render: min=2.579 ms, median=4.488 ms, max=10.32 ms, 99th percentile=9.094 ms
Trial 1 - Separate stage-surface
With separating staging (until gs_stage_texture) and mapping (gs_stagesurface_map and later) into different iteration, rendering time is reduced and the number of dropped frame looks reduced. (I had 3 runs and the numbers are slightly different.)
The code is 2ac4699.
ajaof_render: min=0.017 ms, median=0.602 ms, max=19.639 ms, 99th percentile=17.333 ms
ajaof_render_render: min=0.017 ms, median=0.272 ms, max=5.12 ms, 99th percentile=0.861 ms
ajaof_render_output: min=0.565 ms, median=0.92 ms, max=19.637 ms, 99th percentile=17.748 ms
ajaof_render: min=0.055 ms, median=0.584 ms, max=15.644 ms, 99th percentile=10.016 ms
ajaof_render_render: min=0.054 ms, median=0.259 ms, max=4.331 ms, 99th percentile=0.64 ms
ajaof_render_output: min=0.565 ms, median=0.693 ms, max=15.644 ms, 99th percentile=12.179 ms
ajaof_render: min=0.029 ms, median=0.669 ms, max=19.953 ms, 99th percentile=16.839 ms
ajaof_render_render: min=0.028 ms, median=0.285 ms, max=3.744 ms, 99th percentile=0.788 ms
ajaof_render_output: min=0.61 ms, median=1.297 ms, max=19.952 ms, 99th percentile=17.677 ms
Trial 2 - Breakdown profile more
It is not clear which is actually slow. Maybe gs_stagesurface_map or video_output_lock_frame. If later, prepare a new thread to call video_output_lock_frame.
Trial 3 - Run stage-surface as the graphics task
The graphics tasks are executed after all other rendering while the rendering routine ajaof_render is called at very beginning of rendering the main texture. Assuming gs_stage_texture is actually executed in pipeline, this approach might improve performance without slowing the output.
If Trial 2 reveals the necessity to have another thread, another idea is call gs_stagesurface_map from the new thread. The call will be automatically delayed by obs_enter_graphics().
Misc - memcpy
If linesize == video_linesize, call just one memcpy.
On i7-7700, This improve time of copying 1920x1080 frame data from 1.122 ms to 0.607 ms
The text was updated successfully, but these errors were encountered:
Issue description
When enable this filter, sometimes it causes dropped frame for main streaming and recording.
Current status of investigation
Profile
Checking rendering time with adding profile.
With separating staging (until
gs_stage_texture
) and mapping (gs_stagesurface_map
and later) into different iteration, rendering time is reduced and the number of dropped frame looks reduced. (I had 3 runs and the numbers are slightly different.)The code is 2ac4699.
It is not clear which is actually slow. Maybe
gs_stagesurface_map
orvideo_output_lock_frame
. If later, prepare a new thread to callvideo_output_lock_frame
.The graphics tasks are executed after all other rendering while the rendering routine
ajaof_render
is called at very beginning of rendering the main texture. Assuminggs_stage_texture
is actually executed in pipeline, this approach might improve performance without slowing the output.If Trial 2 reveals the necessity to have another thread, another idea is call
gs_stagesurface_map
from the new thread. The call will be automatically delayed byobs_enter_graphics()
.If
linesize
==video_linesize
, call just onememcpy
.On i7-7700, This improve time of copying 1920x1080 frame data from 1.122 ms to 0.607 ms
The text was updated successfully, but these errors were encountered: