Page 1 of 1

Get OSC message on surface playback end/loop

Posted: Tue Oct 29, 2024 10:50 am
by amongconsequently
Hello,
I have a setup where I switch the media playing on multiple surfaces through OSC and I need some way to get notified when the media finishes playing or loops.
I googled a bit and it seems possible to attach a control to specific media content to get an OSC message on playback end, but I'd have to attach the control to every single media item - is there any way to attach it to the surfaces instead, so that i can dynamically load any number of media?

Re: Get OSC message on surface playback end/loop

Posted: Tue Oct 29, 2024 11:29 am
by mad-matt
You can get the values of any parameter with OSC Query (https://github.com/Vidvox/OSCQueryProposal)
You can request visual name for a surface from address "/surfaces/Quad-1/visual/name"
Then request the playhead position of a visual with "/visuals/VISUAL_NAME/position_sec" (with OSC query you can get the address range and value, so if value == range max and the movie is set to play once (not looping) then it finished. If it's set to loop, you can just check is position_sec is less than previous value.
There's no way to get this information directly from surface

Re: Get OSC message on surface playback end/loop

Posted: Tue Oct 29, 2024 4:14 pm
by amongconsequently
OSCQuery is just what i needed, thanks!
Additionally, I was experimenting in changing the source file for a media using

Code: Select all

/medias/NAME/replace_file
and passing the absolute path of the source video as string argument, but this doesn't seem to be working. Is there something else I should be doing? I am also wondering on the performance hit when changing the source file instead of changing the media by

Code: Select all

/surfaces/SURF_NAME/visual/name