launch_avfeed(3)
π launch_avfeed(3) β the Arcan Lua API glow-up β¨
okay so bestie, welcome to launch_avfeed(3) from the Arcan Lua API π«Ά this page is literally about launching a customized frameserver, and it's giving main-character energy. no cap. π
π NAME π
launch_avfeed β launch a customized frameserver π«
π¦ SYNOPSIS π¦
vid:newvid, aid:newaid, string:guid, int:cookie
launch_avfeed( string:argument )
launch_avfeed( string:argument, string:mode )
launch_avfeed( string:argument, string:mode, func:callback )
π DESCRIPTION π
Okay so launch_avfeed is the function for launching authoritative frameservers for the 'decode', 'terminal' and 'avfeed' archetypes. π The 'decode' archetype is used for providing streaming audio and video decoding of some input source defined by the argument string. The 'terminal' archetype is used for spawning an interactive command-line interface, and the 'avfeed' one is for unspecified custom input providers, typically for binding to other media frameworks. Support for these archetypes is probed at engine startup and set in the global variable FRAMESERVER_MODES. If you don't pass a mode argument, it will default to 'avfeed'. The possible values for argument depend on the frameserver implementation, where the defaults can be probed by running the respective binaries standalone with the ARCAN_ARG =help environment set, though this can vary slightly with the underlying OS. The argument uses a special key1:key2=value with a tab character acting as element separator, and the tab character itself is forbidden. If avmode is not specified, it defaults to 'avfeed'. As with other frameserver-related management functions, it is advised that you provide a handler callback function directly or via the target_updatehandler call. The contents and behavior of this callback function is described in detail in launch_target. If successful, new audio and video reference identifiers are returned, along with a per-instance unique uid (base-64 encoded), intended to be used to regain tracking should a connection be lost, by accident or voluntary. π¦
π¨ NOTES π¨
- The reason
argumentcomes beforemodeis for historical reasons β the function name previously held a different behavior and use. π°οΈ - SECURITY - alert: allowing the
_terminalframeserver is currently a possible scriptable way of running arbitrary programs within the context of the terminal, partly through the possibleexec=argument, but also by manually inputting commands throughtarget_input. This can be hardened in multiple ways: by interceptingtarget_inputand only allow if it is visible (appl specific solution), by interceptinglaunch_avfeedand filteringargstr, or by simply not allowing the terminal frameserver (disable at buildtime or specify a different set ofafsrv_binaries using the--binpathargument). π¨
π EXAMPLE π
function launch_avfeed0()
local vid, _, guid = launch_avfeed("", "terminal",
function(source, status)
print("[new event]");
for k,v in pairs(status) do
print("", k, v);
end
if (status.kind == "resized") then
resize_image(source, status.width, status.height);
end
end
);
show_image(vid);
print("launched as", vid, guid);
end
π SEE ALSO π
mwah π β source/version: targetcontrol, date: October 2026; catch u later in launch_avfeed(3) β¨
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms