info-beamer icon indicating copy to clipboard operation
info-beamer copied to clipboard

video in root-node not working correct, better in child node. but doku says use root-node

Open ozett opened this issue 7 years ago • 2 comments

hi, as i follow the dokumentation, i would stick to one root-node.

zwischenablage01

i try to display a videostream, but as i try this like

video01 = resource.load_video("rtsp://192.168.14.98/4")
util.draw_correct(video01,10,10,362,298,1)

it shows getting rtsp-data, but no image on screen.

if i put this into a child-node and call the child from the root with,

util.draw_correct(resource.render_child("cam-hof2"),10,10,362,298,0.7)

and this is the child:

gl.setup(480, 800)
local video = util.videoplayer("rtsp://192.168.14.98/4")

function node.render()
    video:draw( 0, 0, 352, 288, 1)
end

it is working fine 😵


as the doku advises me to stay into root,

zwischenablage01

but it runs better in child. Some advise for best practice this? 🤝

ozett avatar Feb 06 '17 10:02 ozett

Just to make sure: You don't literally use this code, right?

video01 = resource.load_video("rtsp://192.168.14.98/4")
util.draw_correct(video01,10,10,362,298,1)

but something like:

local video01 = resource.load_video("rtsp://192.168.14.98/4")
function node.render()
    util.draw_correct(video01,10,10,362,298,1)
end

dividuum avatar Feb 06 '17 11:02 dividuum

you hit me 👊

as i am a coding illiterate, but love to see thinks happen (these stupids are sometimes called "makers") 😁 , i literally used the code like i showed it above. 😵

you pointed me with the nose to my mistake 👃 , and i now defined the video resource before the node.render(), means outside the main loop (i guess), ▶️ and as used your code architecture. boom, 💥
it works...

but you ever tried my example? there is not really a syntax check, or somekind of logic-code-check. nor really an error on the cmd-line. i runs, on the cmd-line there is only error of getting the rtsp-stream... and it stucks after a while. i now think i now know why... 😁

ozett avatar Feb 06 '17 19:02 ozett