Is zoneminder able to read files from an FTP server and display them?

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
Vivek Sanagari
Posts: 2
Joined: Fri Mar 20, 2020 9:15 am

Is zoneminder able to read files from an FTP server and display them?

Post by Vivek Sanagari »

Hello,
This is Vivek.

I saw that zoneminder is able to upload the contents to a remote FTP server.
However, I wanted to know if I can attach an FTP server to the Zoneminder to be able to read the files from that FTP server and display on zoneminder Instead?

I want to read the files from a remote FTP server and display them on the zoneminder somehow. Is that possible at all?

Could you kindly let me know, Thank you.
/Vivek
User avatar
kitkat
Posts: 193
Joined: Sun Jan 27, 2019 5:17 pm

Re: Is zoneminder able to read files from an FTP server and display them?

Post by kitkat »

I'm very late to this but I think the answer is "sort of"...

FFmpeg can read its input from FTP sources and you can enter ftp://... in ZM's Source Path box without any complaints, but it'll try to read and output the remote file as fast as it can if it doesn't have the -re parameter before the input file, and there's no way to do that.

However, you can probably proxy the requests locally with a couple of lines of PHP in a file on the ZM host, use that as the Source, and have that launch FFmpeg and pass the output back to ZM...

Code: Select all

<?PHP

header("Content-type: video/mp4");
passthru("/usr/bin/ffmpeg -re -fflags +genpts -i ftp://user:pass@host/path/to/file,mp4 -vcodec copy -an -sn -vsync 0 -map_metadata -1 -f mp4 -movflags frag_keyframe+empty_moov - 2>/dev/null");

?>
I don't know how trying to play back at real-time speed will work over FTP but that's pretty much the approach I took when trying to play back local files, which I then wrapped up to handle URL parameters and event IDs: viewtopic.php?f=11&t=31355


e2a: Or, as @burger has pointed out, you could manually set the frame rate in the Options box on the Source tab. That could perhaps lead to dropped or duplicated frames though and although that probably won't make a lot of difference, doing it at the input with -re and using vsync 0 on the output might lead to a more faithful version being presented.
Post Reply