0

The command I am using is this one.

It takes an MJPEG stream and saves it to WEBM for one output and another output is straight to stdout as I use it for something else.

ffmpeg -loglevel warning -reconnect 1 -f mjpeg -r 5 -i http://MJPEGURL/ -vcodec libvpx -r 5 -q:v 1 filename.webm -vf fps=1 -s 640x480 -f image2pipe pipe:1

It works great. The only issue is that when connection drops to the camera it just stitches together from where it reconnects.

I would like to add blank frames in between where it disconnects. Is there an option or a way to detect it? Then maybe i can push some data with stdin?

The purpose for adding blank frames is so that is has the proper length even if its "missing frames" from the actual stream itself.

moeiscool
  • 1,318
  • 11
  • 14
  • What you could try is create a blank canvas of same resolution and framerate and overlay the feed onto it. – Gyan Dec 07 '16 at 05:23
  • you mean like making it into a pipe in then using another function to get the data from the MJPEG? if it drops then just use black frames? Im not sure i follow. sorry, noob with ffmpeg – moeiscool Dec 07 '16 at 05:43
  • is it possible to use multiple inputs? the first input being the blank frame. Second being the stream. Whenever it has the stream overlay on top of the first input. is that possible with ffmpeg? – moeiscool Dec 07 '16 at 18:13
  • Yes. `ffmpeg -loglevel warning -f lavfi -i color=1280x720:r=5 -reconnect 1 -f mjpeg -r 5 -i http://MJPEGURL/ -filter_complex overlay -vcodec libvpx...` – Gyan Dec 07 '16 at 18:24

0 Answers0