obsuser101
New Member
when you do an Add Source - suggest to user the checkbox "resize output (source size)"
I saw this before creating the messageRight-click menu over the source has some additional options.
it will be quite difficult to implementthe canvas resolution parameter could also be changed in the program window using sliders.
local obs = obslua
local hotkey_id = obs.OBS_INVALID_HOTKEY_ID
----------------------------------------------------------
function get_selected_final_source_size()
local width = 0
local height = 0
-- Get selected source
local current_scene = obs.obs_frontend_get_current_scene()
local scene_ctx = obs.obs_scene_from_source(current_scene)
local items = obs.obs_scene_enum_items(scene_ctx)
if items ~= nil then
for _, item in ipairs(items) do
if obs.obs_sceneitem_selected(item) then
local source = obs.obs_sceneitem_get_source(item)
local scale = obs.vec2()
local crop = obs.obs_sceneitem_crop()
obs.obs_sceneitem_get_scale(item, scale)
obs.obs_sceneitem_get_crop(item, crop)
-- Calculate final (filtered) size
width = scale.x * (obs.obs_source_get_width(source) - crop.left - crop.right)
height = scale.y * (obs.obs_source_get_height(source) - crop.top - crop.bottom)
end
end
end
obs.obs_scene_release(scene_ctx)
obs.sceneitem_list_release(items)
return width, height
end
-- The "Log final size of the Source" hotkey callback
function log_source_size(pressed)
if not pressed then
return
end
-- Print "WidthxHeight"
print(string.format("Selected source size: %dx%d", get_selected_final_source_size()))
end
----------------------------------------------------------
-- A function named script_description returns the description shown to the user
function script_description()
return "On 'Log final size of the Source' hotkey press prints to the log-file the final size of the selected source."
end
-- A function named script_load will be called on startup
function script_load(settings)
hotkey_id = obs.obs_hotkey_register_frontend("log_source_size", "Log final size of the Source", log_source_size)
local hotkey_save_array = obs.obs_data_get_array(settings, "log_source_size.trigger")
obs.obs_hotkey_load(hotkey_id, hotkey_save_array)
obs.obs_data_array_release(hotkey_save_array)
end
-- A function named script_save will be called when the script is saved
--
-- NOTE: This function is usually used for saving extra data (such as in this
-- case, a hotkey's save data). Settings set via the properties are saved
-- automatically.
function script_save(settings)
local hotkey_save_array = obs.obs_hotkey_save(hotkey_id)
obs.obs_data_set_array(settings, "log_source_size.trigger", hotkey_save_array)
obs.obs_data_array_release(hotkey_save_array)
end
That specific example - fitting a video player exactly in OBS's capture - is a common way to steal copyrighted works. For that reason, a number of people who would have helped, will ignore you instead.it will be quite difficult to implement
It is easier to make an additional fitting function, comparable to "resize output (source size)"
Make a new function the"resize output (fit canvas to crop)"
Steps:
one:
View attachment 107985
two: adjust with sliders
View attachment 107990
three: apply the "resize output (fit canvas to crop)"
View attachment 107989
result (output file):
Videotrack and window fragment have same resolution. No "black frames".
View attachment 107988
it's true for OBS.It's rare and niche use case.
in that case, screencast software should be forbidden?That specific example - fitting a video player exactly in OBS's capture - is a common way to steal copyrighted works. For that reason, a number of people who would have helped, will ignore you instead.
interesting idea. Although in practice it turned out to be more convenient to use Bandicam for measurement of an arbitrary random rectangle on the screen.You can use "get_selected_source_final_size.lua" helper script (main menu Tools > Scripts) that writes to the log-file final (filtered) source size:
a few pixels can be neglected:Also, output can't be "any" size, there are restrictions
If what's on the screen is yours - your original content that you yourself created, and didn't sell or legally give away so that you no longer own it - then it's fine. Same if you have permission from the owner.in that case, screencast software should be forbidden?
Case in point. See Jukin Media vs. MxR Plays.personally, I need this to share with friends short scenes from various memes and movies.
Each dev team decides for themselves what they want to do. Part of that decision is coding convenience, part is a small team with a big backlog, and part is legal risk. If other teams are okay with being accused of facilitating illegal activity, that's on them. Whether that accusation sticks is a different question.we have already concluded that it is possible to set necessary resolution of output file in OBS. It is just not as convenient as in some other programs.
Do you want to say that such inconvenience is done on purpose?
Maybe I missed something, but that's the first time I've seen you claim that.I am trying to point out that my proposal is not at all aimed at violating copyright.
Technical alone, encourages people who only see the technical threads and don't know anything else, to violate everything. Like all of engineering and communication, ethics and responsibility must be baked into ALL of it. Those who can't or don't know to restrain their own power, should not have it to start with.But you still lead me into the topic of copyright. For what?
The ethical aspects should be discussed in other threads. This thread is about the technical side. Am I wrong?
Yes.In my examples (screenshots), I should not have used material related to copyright. I would have taken any other material with a freely distributed license (for example) and we would have avoided the ethical and legal routine.
>>If you don't offer that proof right up front