Today's thoughts... how to tell when a clip has finished (or stopped) playing without scraping the log file for events.
For video clips--
You can issue periodic INFO commands to the channel/layer and look at status=playing or =stopped. (This may not reflect a mid-clip failure; haven't tested that, probably OK.) Seems like a kludge.
You can look at the OSC messages /channel/#/stage/layer/#/file/frame and see if the frame number is increasing; that stops when it runs out of frames to display. You'll still get OSC messages but the numbers won't change.
For audio-only clips (i.e. mp3's)--
The status in the INFO command output will show as 'playing' past the end of that clip (the layer is still playing) and the frame number keeps increasing. One can look at frames-left to see it go negative, but I'm not sure how reliable the total frame count is. (Is the source of that metadata or stream timestamps from the end of the file? I've had trouble getting TRT on video clips.)
There are no OSC /channel/#/stage/layer... messages for audio-only clips.
You can look at the audio level in OSC message /channel/#/mixer/audio/#/dBFS (channel is audio channel, not playout channel); silence is -192.66. This however appears to look at -all- audio output, not just a specific channel/layer. Somewhat kludge-y, but not so bad.
I haven't looked at other producers (html, flash, image, etc).
My current methods use frame-count for video and audio level for audio, but at least the latter seems like a kludge. Is there a better way? (And have I missed anything?)
Two follow-on questions-
Why are there no OSC stage/layer messages for audio-only? Does that code hang on the visual stream processing?
Why doesn't the channel/layer status go from playing to stopped at the end of an audio-only clip? Same reason?
(Are these bugs or "features"? :) )
who hasn't gone sniffing around in the server code looking for answers. yet.