Weird ffmpeg restriction

Forum for questions and support relating to 1.33.x development only.
Locked
zmeggyesi
Posts: 19
Joined: Mon Mar 05, 2018 12:10 pm

Weird ffmpeg restriction

Post by zmeggyesi »

I recently swapped out a previous camera to a new one that is identical to the already-added two TP-Link NC450s. After a firmware upgrade, I found that the RTSP stream not requires the username, giving me a bit of a headache, but I got past that.

Now, however, I'm finding that ffmpeg doesn't seem to support more than two cameras: the first two that ZM tries to connect to are primed and capturing just fine, but the third one, whichever it happens to be, fails with the same repeating log message:

Code: Select all

01/14/19 05:53:47.567357 zmc_m7[2916].INF-zmc.cpp/223 [Starting Capture version 1.33.0]
01/14/19 05:53:47.578049 zmc_m7[2916].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp]
01/14/19 05:53:56.650223 zmc_m7[2916].ERR-zm_ffmpeg_camera.cpp/357 [Unable to open input rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp due to: Interrupted system call]
01/14/19 05:53:56.661153 zmc_m7[2916].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
01/14/19 05:54:36.630840 zmc_m7[2937].INF-zmc.cpp/223 [Starting Capture version 1.33.0]
01/14/19 05:54:38.497406 zmc_m7[2937].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp]
01/14/19 05:54:40.272797 zmc_m7[2937].WAR-zm_ffmpeg_camera.cpp/372 [Option threads not recognized by ffmpeg]
01/14/19 05:54:40.489438 zmc_m7[2937].INF-zm_ffmpeg_camera.cpp/378 [Stream open rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp, parsing streams...]
01/14/19 05:54:43.339033 zmc_m7[2937].ERR-zm_ffmpeg_camera.cpp/528 [Unable to open codec for video stream from rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp]
01/14/19 05:54:43.580838 zmc_m7[2937].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
01/14/19 05:54:48.330732 zmc_m7[2945].INF-zmc.cpp/223 [Starting Capture version 1.33.0]
01/14/19 05:54:48.339879 zmc_m7[2945].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp]
01/14/19 05:54:48.847637 zmc_m7[2945].WAR-zm_ffmpeg_camera.cpp/372 [Option threads not recognized by ffmpeg]
01/14/19 05:54:48.869304 zmc_m7[2945].INF-zm_ffmpeg_camera.cpp/378 [Stream open rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp, parsing streams...]
01/14/19 05:54:51.892895 zmc_m7[2945].ERR-zm_ffmpeg_camera.cpp/528 [Unable to open codec for video stream from rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp]
01/14/19 05:54:51.903210 zmc_m7[2945].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
01/14/19 05:55:03.374489 zmc_m7[2957].INF-zmc.cpp/223 [Starting Capture version 1.33.0]
01/14/19 05:55:03.393731 zmc_m7[2957].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp]
01/14/19 05:55:03.517524 zmc_m7[2957].WAR-zm_ffmpeg_camera.cpp/372 [Option threads not recognized by ffmpeg]
01/14/19 05:55:03.636896 zmc_m7[2957].INF-zm_ffmpeg_camera.cpp/378 [Stream open rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp, parsing streams...]
01/14/19 05:55:06.241464 zmc_m7[2957].INF-zm_ffmpeg.cpp/64 [DTS discontinuity in stream 0: packet 23 with DTS 207549, packet 24 with DTS 16500357599
]
01/14/19 05:55:06.552669 zmc_m7[2957].ERR-zm_ffmpeg_camera.cpp/528 [Unable to open codec for video stream from rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp]
01/14/19 05:55:06.564464 zmc_m7[2957].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
01/14/19 05:55:16.572760 zmc_m7[2957].INF-zm_ffmpeg_camera.cpp/163 [Priming capture from rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp]
01/14/19 05:55:16.697744 zmc_m7[2957].WAR-zm_ffmpeg_camera.cpp/372 [Option threads not recognized by ffmpeg]
01/14/19 05:55:16.705774 zmc_m7[2957].INF-zm_ffmpeg_camera.cpp/378 [Stream open rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp, parsing streams...]
01/14/19 05:55:22.030561 zmc_m7[2957].ERR-zm_ffmpeg_camera.cpp/528 [Unable to open codec for video stream from rtsp://admin:xxxxxxxx@192.168.0.16:554/h264_hd.sdp]
01/14/19 05:55:22.039195 zmc_m7[2957].ERR-zmc.cpp/253 [Failed to prime capture of initial monitor]
The reason I'm finding this exceedingly strange is that the third camera was created by cloning an already-working one, and all three cameras share the exact same configuration (one was made to work previously, its configuration was exported, then used to overwrite the other two).

Does anyone have any ideas as to what I might be doing wrong?
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Weird ffmpeg restriction

Post by rockedge »

check your memory! what does /dev/shm show?
zmeggyesi
Posts: 19
Joined: Mon Mar 05, 2018 12:10 pm

Re: Weird ffmpeg restriction

Post by zmeggyesi »

Good point, I checked it just now

Code: Select all

pi@observer:~ $ df -h /dev/shm
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           2.0G  660M  1.4G  33% /dev/shm
free shows that I still have 7GB of my 8GB swap file free, so memory should not be a concern. I think. Or does ffmpeg always require physical memory and wont't do with swap?
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Weird ffmpeg restriction

Post by rockedge »

yes definitely avoid using the swap file or partition and use tmpfs
the /dev/shm should be the best choice. start with the cameras at lower resolutions and get the 3rd camera going.
zmeggyesi
Posts: 19
Joined: Mon Mar 05, 2018 12:10 pm

Re: Weird ffmpeg restriction

Post by zmeggyesi »

This is a RasPi we're talking about, so physical memory is pretty scarce - hence my 8GB swap pendrive.

I'll try extending the shared memory space, though, see if that gets me anywhere.
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: Weird ffmpeg restriction

Post by rockedge »

reduce the camera resolutions and frame rates radically. See if the 3rd camera starts. If this is the case, you will be sure it is
a physical RAM shortage. There is a way to alter the /dev/shm usage ratio but there are side effects imp[acting the operating system.

try lowering the cameras to 320x240 and 3-5 FPS
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Weird ffmpeg restriction

Post by iconnor »

If it using the hardware decoder, you need to up the gpu ram as well.
Locked