1

I have 4 noname ip-cams and have troubles with capturing rtsp streams. Randomly output file not even created. I'm capturing stream via ffmpeg. Tried on Ubuntu Server 18.04 with snap ffmpeg and Debian 7 with ordinary ffmpeg. The same touble.

(/snap/bin/ffmpeg -y -use_wallclock_as_timestamps 1 -hide_banner -loglevel trace -i rtsp://192.168.0.16$1:554/11 -c:v copy -an -flags +global_header $VIDEO_FILE  2> $LOG_FOLDER/cam$1 ) &

Tried -loglevel debug but it show only successful RTSP connection and that's all. With -loglevel trace I have noticed difference between successful and failed process.

Error: unable to open display 
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-use_wallclock_as_timestamps' ... matched as AVOption 'use_wallclock_as_timestamps' with argument '1'.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'trace'.
Reading option '-i' ... matched as input url with argument 'rtsp://192.168.0.161:554/11'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option '-flags' ... matched as AVOption 'flags' with argument '+global_header'.
Reading option '/home/melo/samba/video/19-03-07/cam1/16-06-11.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option hide_banner (do not show program banner) with argument 1.
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://192.168.0.161:554/11.
Successfully parsed a group of options.
Opening an input file: rtsp://192.168.0.161:554/11.
Probing rtsp score:100 size:0
[tcp @ 0x1b5cc40] No default whitelist set
[tcp @ 0x1b5cc40] Original list of addresses:
[tcp @ 0x1b5cc40] Address 192.168.0.161 port 554
[tcp @ 0x1b5cc40] Interleaved list of addresses:
[tcp @ 0x1b5cc40] Address 192.168.0.161 port 554
[tcp @ 0x1b5cc40] Starting connection attempt to 192.168.0.161 port 554
[tcp @ 0x1b5cc40] Successfully connected to 192.168.0.161 port 554
[rtsp @ 0x1b5abc0] Sending:
OPTIONS rtsp://192.168.0.161:554/11 RTSP/1.0
CSeq: 1
User-Agent: Lavf58.20.100

--
[rtsp @ 0x1b5abc0] ret=1 c=52 [R]
[rtsp @ 0x1b5abc0] ret=1 c=54 [T]
[rtsp @ 0x1b5abc0] ret=1 c=53 [S]
[rtsp @ 0x1b5abc0] ret=1 c=50 [P]
[rtsp @ 0x1b5abc0] ret=1 c=2f [/]
[rtsp @ 0x1b5abc0] ret=1 c=31 [1]
[rtsp @ 0x1b5abc0] ret=1 c=2e [.]
[rtsp @ 0x1b5abc0] ret=1 c=30 [0]
[rtsp @ 0x1b5abc0] ret=1 c=20 [ ]
[rtsp @ 0x1b5abc0] ret=1 c=32 [2]
[rtsp @ 0x1b5abc0] ret=1 c=30 [0]
    Last message repeated 1 times
[rtsp @ 0x1b5abc0] ret=1 c=20 [ ]
[rtsp @ 0x1b5abc0] ret=1 c=4f [O]
[rtsp @ 0x1b5abc0] ret=1 c=4b [K]
[rtsp @ 0x1b5abc0] ret=1 c=0d [
]
[rtsp @ 0x1b5abc0] ret=1 c=0a [
]
[rtsp @ 0x1b5abc0] line='RTSP/1.0 200 OK'
[rtsp @ 0x1b5abc0] ret=1 c=43 [C]
[rtsp @ 0x1b5abc0] ret=1 c=53 [S]
[rtsp @ 0x1b5abc0] ret=1 c=65 [e]
[rtsp @ 0x1b5abc0] ret=1 c=71 [q]
[rtsp @ 0x1b5abc0] ret=1 c=3a [:]
[rtsp @ 0x1b5abc0] ret=1 c=20 [ ]
[rtsp @ 0x1b5abc0] ret=1 c=31 [1]
[rtsp @ 0x1b5abc0] ret=1 c=0d [
]
[rtsp @ 0x1b5abc0] ret=1 c=0a [
]

Good coding and everithing clear in successful process.

Error: unable to open display 
Splitting the commandline.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-use_wallclock_as_timestamps' ... matched as AVOption 'use_wallclock_as_timestamps' with argument '1'.
Reading option '-hide_banner' ... matched as option 'hide_banner' (do not show program banner) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'trace'.
Reading option '-i' ... matched as input url with argument 'rtsp://192.168.0.163:554/11'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'copy'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option '-flags' ... matched as AVOption 'flags' with argument '+global_header'.
Reading option '/home/melo/samba/video/19-03-07/cam3/16-06-11.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option y (overwrite output files) with argument 1.
Applying option hide_banner (do not show program banner) with argument 1.
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://192.168.0.163:554/11.
Successfully parsed a group of options.
Opening an input file: rtsp://192.168.0.163:554/11.
Probing rtsp score:100 size:0
[tcp @ 0x18eec40] No default whitelist set
[tcp @ 0x18eec40] Original list of addresses:
[tcp @ 0x18eec40] Address 192.168.0.163 port 554
[tcp @ 0x18eec40] Interleaved list of addresses:
[tcp @ 0x18eec40] Address 192.168.0.163 port 554
[tcp @ 0x18eec40] Starting connection attempt to 192.168.0.163 port 554
[tcp @ 0x18eec40] Successfully connected to 192.168.0.163 port 554
[rtsp @ 0x18ecbc0] Sending:
OPTIONS rtsp://192.168.0.163:554/11 RTSP/1.0
CSeq: 1
User-Agent: Lavf58.20.100

--
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=08 []
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=04 [?]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=01 [?]
[rtsp @ 0x18ecbc0] ret=1 c=48 [H]
[rtsp @ 0x18ecbc0] ret=1 c=02 [?]
[rtsp @ 0x18ecbc0] ret=1 c=2a [*]
[rtsp @ 0x18ecbc0] ret=1 c=e0 [à]
[rtsp @ 0x18ecbc0] ret=1 c=bc [Œ]
[rtsp @ 0x18ecbc0] ret=1 c=84 []
[rtsp @ 0x18ecbc0] ret=1 c=c0 [À]
[rtsp @ 0x18ecbc0] ret=1 c=a8 [š]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=a3 [£]
[rtsp @ 0x18ecbc0] ret=1 c=ff [ÿ]
    Last message repeated 9 times
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=08 []
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=04 [?]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=01 [?]
[rtsp @ 0x18ecbc0] ret=1 c=48 [H]
[rtsp @ 0x18ecbc0] ret=1 c=02 [?]
[rtsp @ 0x18ecbc0] ret=1 c=2a [*]
[rtsp @ 0x18ecbc0] ret=1 c=e0 [à]
[rtsp @ 0x18ecbc0] ret=1 c=bc [Œ]
[rtsp @ 0x18ecbc0] ret=1 c=84 []
[rtsp @ 0x18ecbc0] ret=1 c=c0 [À]
[rtsp @ 0x18ecbc0] ret=1 c=a8 [š]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=a3 [£]
[rtsp @ 0x18ecbc0] ret=1 c=ff [ÿ]
    Last message repeated 9 times
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=08 []
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=04 [?]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=01 [?]
[rtsp @ 0x18ecbc0] ret=1 c=48 [H]
[rtsp @ 0x18ecbc0] ret=1 c=02 [?]
[rtsp @ 0x18ecbc0] ret=1 c=2a [*]
[rtsp @ 0x18ecbc0] ret=1 c=e0 [à]
[rtsp @ 0x18ecbc0] ret=1 c=bc [Œ]
[rtsp @ 0x18ecbc0] ret=1 c=84 []
[rtsp @ 0x18ecbc0] ret=1 c=c0 [À]
[rtsp @ 0x18ecbc0] ret=1 c=a8 [š]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=a3 [£]
[rtsp @ 0x18ecbc0] ret=1 c=ff [ÿ]
    Last message repeated 9 times
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=08 []
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=04 [?]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=01 [?]
[rtsp @ 0x18ecbc0] ret=1 c=48 [H]
[rtsp @ 0x18ecbc0] ret=1 c=02 [?]
[rtsp @ 0x18ecbc0] ret=1 c=2a [*]
[rtsp @ 0x18ecbc0] ret=1 c=e0 [à]
[rtsp @ 0x18ecbc0] ret=1 c=bc [Œ]
[rtsp @ 0x18ecbc0] ret=1 c=84 []
[rtsp @ 0x18ecbc0] ret=1 c=c0 [À]
[rtsp @ 0x18ecbc0] ret=1 c=a8 [š]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=a3 [£]
[rtsp @ 0x18ecbc0] ret=1 c=ff [ÿ]
    Last message repeated 9 times
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=08 []
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=04 [?]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=01 [?]
[rtsp @ 0x18ecbc0] ret=1 c=48 [H]
[rtsp @ 0x18ecbc0] ret=1 c=02 [?]
[rtsp @ 0x18ecbc0] ret=1 c=2a [*]
[rtsp @ 0x18ecbc0] ret=1 c=e0 [à]
[rtsp @ 0x18ecbc0] ret=1 c=bc [Œ]
[rtsp @ 0x18ecbc0] ret=1 c=84 []
[rtsp @ 0x18ecbc0] ret=1 c=c0 [À]
[rtsp @ 0x18ecbc0] ret=1 c=a8 [š]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=a3 [£]
[rtsp @ 0x18ecbc0] ret=1 c=ff [ÿ]
    Last message repeated 9 times
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=08 []
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=06 [?]
[rtsp @ 0x18ecbc0] ret=1 c=04 [?]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=01 [?]
[rtsp @ 0x18ecbc0] ret=1 c=48 [H]
[rtsp @ 0x18ecbc0] ret=1 c=02 [?]
[rtsp @ 0x18ecbc0] ret=1 c=2a [*]
[rtsp @ 0x18ecbc0] ret=1 c=e0 [à]
[rtsp @ 0x18ecbc0] ret=1 c=bc [Œ]
[rtsp @ 0x18ecbc0] ret=1 c=84 []
[rtsp @ 0x18ecbc0] ret=1 c=c0 [À]
[rtsp @ 0x18ecbc0] ret=1 c=a8 [š]
[rtsp @ 0x18ecbc0] ret=1 c=00 [[rtsp @ 0x18ecbc0] ret=1 c=a3 [£]
[rtsp @ 0x18ecbc0] ret=1 c=ff [ÿ]
    Last message repeated 9 times

Looks like a sh*t.
Log files aren't full, but I think it's enough. That appears randomly with random cams.
How to fix it?

1 Answer 1

1

I've found solution myself. I've got that problem was with packet authenticity. I've tried to add forced tcp connection flag (-rtsp_transport tcp) and it works. No problem anymore.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .