How to control the rendering only in the video area?

chfeizy

New Member
I'm currently developing a facial tracking plugin, and I'm encountering an issue where the filter is rendering over the entire main preview area instead of just the video area. How can I solve this issue so that the filter preview and main preview can both be properly adapted to the video area?

When dragging the video area in the main preview area, the position of the facial tracking plugin is fixed and doesn't move along with the video
 

chfeizy

New Member
obs_source_t *target = obs_frontend_get_current_scene();
obs_scene_t* scene = obs_scene_from_source(target);
obs_sceneitem_t *item = obs_scene_find_source(scene, TEXT_SCENEITEM_NAME);
x = item->pos.x;
y = item->pos.y;
pointScale = item->box_scale.x / (float)base_width;

Human: Using the above method, I can obtain the offset and zoom factor of the video area, which can solve the problem of dragging the video area in the main preview. However, in the filter preview, the obtained information is still based on the main preview area, and it's difficult to distinguish whether the current video is in the filter preview or not. As a result, the position of the facial tracking plugin still remains offset in the filter preview.
 
Top