In general you can programmatically read any container’s logs from any device using the resin SDK - https://github.com/resin-io/resin-sdk - but that won’t actually work for your case, since it goes via the Resin API, so fails as soon as the device’s internet connection does down.
You could directly talk to Docker (really, Balena) on the device to get the logs. You can mount the Balena socket with the
io.resin.features.balena-socket label, which will expose the socket for the device’s Balena instance at
/var/run/balena.sock in the container. One of our getting started examples for multicontainer users this to monitor & expose Docker metrics from within a container itself: https://github.com/resin-io-playground/multicontainer-metrics. You can use that to directly read the logs through Docker, and then parse them however you’d like.
I wouldn’t go for either of those approaches though. Instead, I’d pipe the ffmpeg process in your containers through another process in the same container that can parse the output and check for this, and then expose that information to other containers in a more manageable & flexible way. Perhaps that could ping a webhook in another container, expose that info via a status endpoint from the ffmpeg container, or use any other mechanism you like. That gives you a clear interface, rather than coupling one container to the exact log format of another, which will make this all a little more maintainable in future.