Commit 3b03bfb3 authored by d.basulto's avatar d.basulto

all files updated with the server dir structure

parent fd68d5ce
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
#!/bin/bash
# Kill all the stream recorder processes
for pid in `pgrep -f streamRecorder && pgrep -f record.sh`
do
echo "killing " $pid
kill $pid
done
\ No newline at end of file
#!/bin/sh
#$1 stream name
#$2 stream uri
#$3
#$3 record time
#===============================================================================
year=$(date +%Y)
month=$(date +%m)
day=$(date +%d)
if [ ! -d "$1" ]; then
mkdir $1
fi
......@@ -22,5 +25,6 @@ if [ ! -d "$day" ]; then
mkdir $day
fi
cd $day
$HOME/m3/bin/streamRecorder $2 3000
$HOME/GStreamer_audioRecorder/streamRecorder $2 $3
#!/bin/sh
#$1 record time
#!/bin/sh
#$1 Record time
#===============================================================================
if [ $# -ne 1 ]; then
echo 'Example: ./startRecord.sh 60'
else
# crontab -l > $HOME/GStreamer_audioRecorder/crontab.txt
cd $HOME/GStreamer_audioRecorder/
/usr/bin/python streamsManager.py $1
fi
\ No newline at end of file
[
{
"publisher" : "RadioFormula", "url" : "http://streamingmovil.radioformula.com:8000/m1041"
}
]
\ No newline at end of file
import sys
import os
from json import load as jsonDec
# File config
executeAppCommand = './record.sh'
appName = 'record'
# Streams owners file
streamPublishersFile = 'streamPublishers.json'
# Child
def startStream(publisher_name,publisher_url, record_time):
os.execl(executeAppCommand, appName, publisher_name, publisher_url, record_time)
os._exit(0)
# Parent
def streamsInitializer(record_time):
with open(streamPublishersFile) as data:
publishers_data = jsonDec(data)
for i in range(len(publishers_data)):
new_pid = os.fork()
if(new_pid == 0):
startStream(publishers_data[i]["publisher"], publishers_data[i]["url"], record_time)
else:
pids = (os.getpid(), new_pid)
print("parent: %d, child: %d\n" % pids)
def main():
if(len(sys.argv) < 2):
print("Record time required - eg. python startRecorders.py 60")
else:
record_time = sys.argv[1]
streamsInitializer(record_time)
if __name__ == '__main__':
main()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment