Dentricky73
Dentricky73

Reputation: 31

FFMPEG loop breaks all the time asking pessing Q

I have a sh script using FFMPEG to take one picture from RTSP streams. There is a timeout -stimeout to kill the connection if the connection takes too long. (-timout is not possible). most IP list the -stimeout works without any problems. But sometimes the script stops asking the user pressing -Q and the loop is broken until keypress Q. I already tried adding -q in the code. but this doesn't work at all. any suggestions?

for IP in $IPS;          
do  

FFM="$(ffmpeg -y  -stimeout 8000000 -rtsp_transport tcp -ss 0.5  -i "rtsp://$IP:554/12" -vframes 1 -s 640x480 -f image2 images/$IP.jpg) >/dev/null"

done

Error

[rtsp @ 0000000000457c40] Could not find codec parameters for stream 0 (Video: h264, none, 640x352): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://123.456.789.101:554/12':
  Metadata:
    title           : 11
  Duration: N/A, start: 0.000000, bitrate: 64 kb/s
  Stream #0:0: Video: h264, none, 640x352, 90k tbr, 90k tbn, 180k tbc
  Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help

ignore the dev/null I got it wrong on purpose to see the output.

Upvotes: 3

Views: 1201

Answers (1)

Gyan
Gyan

Reputation: 92928

Press [q] to stop, [?] for help

is a standard message produced by ffmpeg when it detects stdin interactivity is possible. It is disabled in two circumstances: with the option -nostdin or one of the inputs is piped over stdin.

Upvotes: 3

Related Questions