| View previous topic :: View next topic |
| Author |
Message |
haribda
Joined: 31 Aug 2010 Posts: 9
|
Posted: Thu Sep 02, 2010 5:40 pm Post subject: Archiving stream 24/7 on the fly |
|
|
Hi everybody, I am running one feed that stream a VHF signal 24/7. I use icecast and edcast. THe edcast has a nice option archive stream but it doesn't separate it, it waits until the connection is disconnected or feed stopped to separate the file. This makes huge files and I have no idea of the time they were recorded.
I would like to have a 1 or 2 hours long files automatically made as the stream is going.
I haven't been able to do this, but I think the solution would be to set the icecast to disconnect the connection with the source each 1 or 2 hours and the source client to be set to reconnect in 0 or 1 seconds. This way, every hour or 2 hours there will be 1 or less than a second stoppage but at least there will be an archive consisted 24 hours that can be reviewed.
Im open to any suggestions how to achieve this. Thanks in advance. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Sep 02, 2010 8:19 pm Post subject: |
|
|
you can set up a cron job each hour to kick off a command like
curl -o saved-`date`.ogg -m 3600 -s http://server:port/mount.ogg
karl. |
|
| Back to top |
|
 |
haribda
Joined: 31 Aug 2010 Posts: 9
|
Posted: Thu Sep 02, 2010 9:02 pm Post subject: |
|
|
Thank you, how can I implement this?
Just write it in the cofig file?
Will it interrupt the transmission for a second or no? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Sep 03, 2010 6:29 pm Post subject: |
|
|
As already indicated, you can use a cron to run this but you may decide to use something else after all it does not even have to be on the same machine. All it says is save the stream to a file and disconnect after 1 hour. As it looks like a listener, there will be no interruptions.
karl. |
|
| Back to top |
|
 |
haribda
Joined: 31 Aug 2010 Posts: 9
|
Posted: Fri Sep 03, 2010 8:45 pm Post subject: |
|
|
OK, I don't seem to follow you since Im not that advanced. I'm using Win XP for the icecast and I don't think you can set up a cron job on Win.
What would be a great is to be able to set up the icecast to disconnect the sources each hour so the stream could be archived and saved on the local computer.
Thank you for the effort, it's really appreciated. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Sep 03, 2010 9:08 pm Post subject: |
|
|
You'll have to check on what downloader options you have on Windows but any web downloading app will suffice, you just want one that will stop after a certain period of time, you may even get a build of curl for windows. There are cron like facilities on windows but as I don't use windows generally I would not know what is the best approach to use.
karl. |
|
| Back to top |
|
 |
haribda
Joined: 31 Aug 2010 Posts: 9
|
Posted: Fri Sep 03, 2010 9:46 pm Post subject: |
|
|
OK I see. I don't think an extra software will be good for me since I'd like to be stable.
I think what will be the best for me, if I could manage to give a certain command/option in icecast configuration file that each hour will disconnect the connected sources.
Any idea of this? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Sep 03, 2010 11:00 pm Post subject: |
|
|
I don't think you can do this in 2.3.2 without external software. The dump-file expansion in the kh tree could be used to do this automatically but it's not straightforward to actually trigger a file changed over automatically but possible.
Certain clients can be time limited, but the sources are not without auth currently. You can use a double relay though with something like the following. Assuming 192.168.1.1:8000/stream is the stream your listeners go to then you would have something like
<relay>
<server>192.168.1.1</server>
<port>8000</port>
<mount>/stream</mount>
<local-mount>/_reserved</local-mount>
</relay>
<mount>
<mount-name>/_reserved</mount-name>
<max-listener-duration>3600</max-listener-duration>
</mount>
<relay>
<server>127.0.0.1</server>
<port>8000</port>
<mount>/_reserved</mount>
<local-mount>/savefile</local-mount>
</relay>
<mount>
<mount-name>/savefile</mount-name>
<dump-file>/path/to/savefile-%Y-%m-%d</dump-file>
</mount>
This should work with the kh tree now, the extra relay (/_reserved) is just because the /savefile stream has no time limit capability setting on it yet.
karl
Last edited by karlH on Sat Sep 04, 2010 3:30 pm; edited 1 time in total |
|
| Back to top |
|
 |
haribda
Joined: 31 Aug 2010 Posts: 9
|
Posted: Sat Sep 04, 2010 2:35 pm Post subject: |
|
|
| karlH wrote: |
Assuming 192.168.1.1:8000/streamis the stream your listeners go to then you would have something like
|
When I go http://localhost:8000/streamis all I get is
The file you requested could not be found |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Sat Sep 04, 2010 3:34 pm Post subject: |
|
|
the /stream mountpoint is the one you want to archive fed from the source client (edcast), you may of called it something else.
The trick here is that icecast uses a couple of relays to simulate a listener that is kicked off every hour but because it is a relay then it starts up immediately and creates a new dump file.
karl. |
|
| Back to top |
|
 |
haribda
Joined: 31 Aug 2010 Posts: 9
|
Posted: Sat Sep 04, 2010 4:12 pm Post subject: |
|
|
There is no such thing.
What I think will be sufficient, is a regular disconnect on the server so the files are archived on the source's computer since the archive is run there.
All I want the icecast to do is to refresh the connection simple disconnect on the sources and they will reconnect in 1 second so the dump file will be automatically created on the source's PC. |
|
| Back to top |
|
 |
|