picam icon indicating copy to clipboard operation
picam copied to clipboard

Picam does not stop/give error when the tcp stream is closed

Open macsimc opened this issue 8 years ago • 1 comments

When tcpout is selected, there is an error if the remote host/port is not listening, thats great. If the remote host ffmpeg is listening, the streaming starts, and continues even if the ffmpeg instance is stopped on the remote end, that's bad because we need extra checks in order to know that picam should be restarted. Any ideea how to fix this?

macsimc avatar Jan 21 '17 07:01 macsimc

This can be probably achieved by checking the result code of av_write_frame function (code sample form FFMPEG: https://ffmpeg.org/doxygen/2.8/transcode_aac_8c-example.html#a91)

But I do not see what the outcome of writing frame error should be:

  • shutting down picam might not be desirable, because all other functionalities will stop altogether (eg. writing to file, etc.) - we can always add --tcp-exit-on-error option :)
  • maybe the better solution would be to retry opening the failed connection from time to time, but this would mean we need to support dynamically opening/closing TCP output during runtime (that would require more changes in the code)
  • but: the error might be just temporary (network problem, no place in output TCP buffers), the stream will drop some frames, but will still be operating - how to detect that?

I'm just providing some (hopefuly useful) info, as I don't have expertise in MPEG-TS streaming - the eventual code changes will have to come from somebody else :)

nalajcie avatar Jan 21 '17 15:01 nalajcie