D
D
digam2015-09-07 10:52:59
linux
digam, 2015-09-07 10:52:59

How to burn an online rtmp stream to disk, compress it and split it into files by time - a la a DVR?

Task: There is a site with streaming rtmp broadcasting ksalfa.ru/projects/32/3. It is necessary to make a video recorder from a computer with Ubuntu OS, that is, to have a compressed recording on a local HDD with a file size of 30 seconds. (time taken as an example). All I got was this:
Python script (using system commands and rtmpdump installed)
name_file = [1,2,3]
for nf in name_file:
os.system ('timeout 30 rtmpdump --rtmp "rtmp://78.37.48.133" - -playpath "novosel15" -o h_' + str(nf) + '.ts')
creates three (the same number for example) files h_1.ts, h_2.ts, h_3.ts each 30 seconds long. (ts or flash - I think it doesn't matter)
I got the address of the rtmp stream from the page code.
The script works, files are created and they can be viewed without problems by mplayer. But if you write for days, then the size is very large. Question: is it possible to somehow compress all this on the go? Those. redirect stream to ffmpeg? Or after creating each file, run the script to encode it and then delete the original? Or maybe there are ready-made solutions a la video recorder for linux?
PS With VLC, nothing happened to me, he did not see this stream.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Armenian Radio, 2015-09-07
@digam

ffmpeg can eat what rtmpdump spits out.

E
Ed Sky, 2015-09-17
@addsky

If the cameras support rtsp stream, then you can easily write through VLC. Command example:
Where:
1) admin - camera login
2) 123456 - camera password
3) 192.168.0.10 - camera IP
4) mnt/sdb1/10/ - video
share 5) --run-time=3600 - recording time. We put in cron for every hour.

A
Anton, 2015-09-16
@jimmyjonezz

I advise you to look here . Your question is solved using ffmpeg and Bash.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question