mysql> select * from users_rec limit 10\G
*************************** 1. row ***************************
id: 15
ch_id: 30
program: Семейное сафари (Слонофобия) (12+)
program_id: 0
uid: 4
file_id: 12
t_start: 2015-01-17 14:59:56
t_stop: 2015-01-17 15:02:38
end_record: 0000-00-00 00:00:00
atrack:
vtrack:
length: 162
last_play: 0000-00-00 00:00:00
ended: 1
started: 1
program_real_id:
local: 0
file:
internal_id:
*************************** 2. row ***************************
id: 22
ch_id: 30
program: В дебрях Африки (Намибия) (12+)
program_id: 29041
uid: 4
file_id: 19
t_start: 2015-01-17 18:15:00
t_stop: 2015-01-17 19:10:00
end_record: 0000-00-00 00:00:00
atrack:
vtrack:
length: 3300
last_play: 0000-00-00 00:00:00
ended: 0
started: 0
program_real_id: 30_1421507700
local: 0
file:
internal_id:
2 rows in set (0.05 sec)if ((strpos($link['url'], 'rtp://') !== false || strpos($link['url'], 'udp://') !== false) && preg_match("/(\S+:\/\/\S+)/", $link['url'], $match)){
заменить на:
if ((strpos($link['url'], 'rtp://') !== false || strpos($link['url'], 'udp://') !== false || strpos($link['url'], 'http://') !== false) && preg_match("/(\S+:\/\/\S+)/", $link['url'], $match)){
и
if (eventObject.currentTarget.value.indexOf('rtp://') != -1 || eventObject.currentTarget.value.indexOf('udp://') != -1){
заменить на:
if (eventObject.currentTarget.value.indexOf('rtp://') != -1 || eventObject.currentTarget.value.indexOf('udp://') != -1 || eventObject.currentTarget.value.indexOf('http://') != -1){Чтобы посмотреть обсуждение на веб-странице, перейдите по ссылке https://groups.google.com/d/msgid/stalker-middleware/d90f57c9-d099-4343-859c-6341de3883a9%40googlegroups.com.--
Вы получили это сообщение, поскольку подписаны на одну из тем в группе "Stalker Middleware".
Чтобы отменить подписку на эту тему, перейдите по ссылке https://groups.google.com/d/topic/stalker-middleware/l75jQBKtZYQ/unsubscribe.
Чтобы отменить подписку на эту группу и все ее темы, отправьте письмо на электронный адрес stalker-middlew...@googlegroups.com.
Чтобы отправлять сообщения в эту группу, отправьте письмо на электронный адрес stalker-m...@googlegroups.com.
Evaldas S, see logs from storage in web-interface, and watch in console astra process.To All: После обновления 3 файлов вообще не запускается процесс астры... видимо проблема где-то в php файлах, т.к. в логах хранилища никаких ошибок теперь нет.
20 января 2015 г., 10:53 пользователь Evaldas S, Stalker Middleware <stalker-middleware+APn2wQdzNk7J1As2dhsty2_T-R3qsFTgjB1x3FlhOKkY6@googlegroups.com> написал:
Чтобы отменить подписку на эту группу и все ее темы, отправьте письмо на электронный адрес stalker-middleware+unsub...@googlegroups.com.
Чтобы отправлять сообщения в эту группу, отправьте письмо на электронный адрес stalker-m...@googlegroups.com.
if (strpos($url, 'rtp://') !== false || strpos($url, 'udp://') !== false){
На:
if (strpos($url, 'rtp://') !== false ||
strpos($url, 'udp://') !== false ||
strpos($url, 'http://') !== false)
{Fatal error: Uncaught exception 'RESTClientRemoteError' with message 'URL wrong format' in /var/www/html/stalker_portal/server/lib/restclient.class.php:132 Stack trace: #0 /var/www/html/stalker_portal/server/lib/restclient.class.php(32): RESTClient->execute() #1 /var/www/html/stalker_portal/server/lib/tvarchive.class.php(540): RESTClient->create(Array) #2 /var/www/html/stalker_portal/server/lib/tvarchive.class.php(488): TvArchive->createTask(9, 'bb3') #3 /var/www/html/stalker_portal/server/administrator/add_itv.php(464): TvArchive->createTasks(9, Array) #4 {main} thrown in /var/www/html/stalker_portal/server/lib/restclient.class.php on line 132
http://iptv2.ziuri.lt:1234/TV1
if (strpos($url, 'rtp://') !== false ||
strpos($url, 'udp://') !== false ||
strpos($url, 'http://') !== false)
{
$path = $this->getRecordsPath($task);
if ($path && is_dir($path)){
exec('astra '.PROJECT_PATH.'/dumpstream.lua'
.' -A '.$url
.' -d '.$path
.' -n '.intval($task['parts_number'])
.' > /dev/null 2>&1 & echo $!'
, $out);
...
...
| <?php | |
| class TvArchiveRecorder extends Storage | |
| { | |
| /** | |
| * Start stream recording | |
| * | |
| * @param array $task | |
| * @return bool | |
| * @throws Exception | |
| */ | |
| public function start($task){ | |
| $url = $task['cmd']; | |
| if (!preg_match('/:\/\//', $url, $arr)){ | |
| throw new Exception('URL wrong format'); | |
| } | |
| $ip = $arr[1]; | |
| $port = $arr[2]; | |
| $task['ch_id'] = (int) $task['ch_id']; | |
| $pid_file = $this->getRecPidFile($task['ch_id']); | |
| if (file_exists($pid_file)){ | |
| if ($this->processExist($pid_file)){ | |
| return false; | |
| }else{ | |
| unlink($pid_file); |
| } | |
| } | |
| if (strpos($url, 'rtp://') !== false || strpos($url, 'udp://') !== false){ | |
| $path = $this->getRecordsPath($task); | |
| if ($path && is_dir($path)){ |
| if (defined("ASTRA_RECORDER") && ASTRA_RECORDER){ |
| exec('astra '.PROJECT_PATH.'/dumpstream.lua' | |
| .' -A '.$url | |
| .' -d '.$path | |
| .' -n '.intval($task['parts_number']) | |
| .' > /dev/null 2>&1 & echo $!' | |
| , $out); |
| }else{ | |
| exec('nohup python '.PROJECT_PATH.'/dumpstream' | |
| .' -a'.$ip | |
| .' -p'.$port |
| .' -d'.$path | |
| .' -n'.intval($task['parts_number']) | |
| .' > /dev/null 2>&1 & echo $!' | |
| , $out); | |
| } |
| }else{ | |
| throw new Exception('Wrong archive path or permission denied for new folder'); | |
| } | |
| }else{ | |
| throw new DomainException('Not supported protocol'); | |
| } | |
| if (intval($out[0]) == 0){ | |
| $arr = explode(' ', $out[0]); | |
| $pid = intval($arr[1]); | |
| }else{ | |
| $pid = intval($out[0]); | |
| } | |
| if (empty($pid)){ | |
| throw new OutOfRangeException('Not possible to get pid'); | |
| } | |
| if (!file_put_contents($pid_file, $pid)){ | |
| posix_kill($pid, 15); | |
| throw new IOException('PID file is not created'); | |
| } | |
| $archive = new TvArchiveTasks(); | |
| $archive->add($task); | |
| return true; | |
| } | |
| /** | |
| * Start all tasks | |
| * | |
| * @param array $tasks | |
| * @return bool | |
| */ | |
| public function startAll($tasks){ | |
| if (!is_array($tasks)){ | |
| return false; | |
| } | |
| foreach($tasks as $task){ | |
| $this->start($task); | |
| } | |
| return true; | |
| } | |
| /** | |
| * Stop stream recording | |
| * | |
| * @param int|string $ch_id | |
| * @return bool | |
| */ | |
| public function stop($ch_id){ | |
| $pid_file = $this->getRecPidFile($ch_id); | |
| if (!is_file($pid_file)){ | |
| return true; | |
| } | |
| $pid = intval(file_get_contents($pid_file)); | |
| unlink($pid_file); | |
| $archive = new TvArchiveTasks(); | |
| $archive->del($ch_id); | |
| return posix_kill($pid, 9); | |
| } | |
| /** | |
| * Construct pid filename | |
| * | |
| * @param int $ch_id | |
| * @return string | |
| */ | |
| private function getRecPidFile($ch_id){ | |
| return '/tmp/rec_archive_'.STORAGE_NAME.'_'.$ch_id.'.pid'; | |
| } | |
| /** | |
| * Return save dir for records | |
| * | |
| * @param array $task | |
| * @return string|false | |
| */ | |
| private function getRecordsPath($task){ | |
| $dir = RECORDS_DIR.'/archive/'.$task['ch_id'].'/'; | |
| if (!is_dir($dir)){ | |
| umask(0); | |
| if (!mkdir($dir, 0777, true)){ | |
| return false; | |
| } | |
| } | |
| return $dir; | |
| } | |
| private function processExist($pid_file){ | |
| $pid = trim(file_get_contents($pid_file)); | |
| return posix_kill($pid, 0); | |
| } | |
| } | |
| ?> |
<?php
class TvArchiveRecorder extends Storage{
/** * Start stream recording * * @param array $task * @return bool * @throws Exception */ public function start($task){
$url = $task['cmd'];
$task['ch_id'] = (int) $task['ch_id'];
$pid_file = $this->getRecPidFile($task['ch_id']);
if (file_exists($pid_file)){ if ($this->processExist($pid_file)){ return false; }else{ unlink($pid_file); } }
if (strpos($url, 'rtp://') !== false || strpos($url, 'udp://') !== false || strpos($url, 'http://') !== false) { $path = $this->getRecordsPath($task);
if ($path && is_dir($path)){ exec('astra '.PROJECT_PATH.'/dumpstream.lua' .' -A '.$url .' -d '.$path .' -n '.intval($task['parts_number']) .' > /dev/null 2>&1 & echo $!' , $out); }else{ throw new Exception('Wrong archive path or permission denied for new folder'); }
}else{ throw new DomainException('Not supported protocol'); }
if (intval($out[0]) == 0){ $arr = explode(' ', $out[0]); $pid = intval($arr[1]); }else{ $pid = intval($out[0]); }
if (empty($pid)){ throw new OutOfRangeException('Not possible to get pid'); }
if (!file_put_contents($pid_file, $pid)){ posix_kill($pid, 15); throw new IOException('PID file is not created'); }
$archive = new TvArchiveTasks(); $archive->add($task);
return true; }
/** * Start all tasks * * @param array $tasks * @return bool */ public function startAll($tasks){
if (!is_array($tasks)){ return false; }
foreach($tasks as $task){ $this->start($task); }
return true; }
/** * Stop stream recording * * @param int|string $ch_id * @return bool */ public function stop($ch_id){
$pid_file = $this->getRecPidFile($ch_id);
if (!is_file($pid_file)){ return true; }
$pid = intval(file_get_contents($pid_file));
unlink($pid_file);
$archive = new TvArchiveTasks(); $archive->del($ch_id);
return posix_kill($pid, 9); }
/** * Construct pid filename * * @param int $ch_id * @return string */ private function getRecPidFile($ch_id){
return '/tmp/rec_archive_'.STORAGE_NAME.'_'.$ch_id.'.pid'; }
/** * Return save dir for records * * @param array $task * @return string|false */ private function getRecordsPath($task){
$dir = RECORDS_DIR.'/archive/'.$task['ch_id'].'/';
if (!is_dir($dir)){ umask(0);
if (!mkdir($dir, 0777, true)){ return false; } }
return $dir; }
private function processExist($pid_file){
$pid = trim(file_get_contents($pid_file));
return posix_kill($pid, 0); }}
?>define('ASTRA_RECORDER', true);<?php
define('VIDEO_STORAGE_DIR', '/media/storage/');define('KARAOKE_STORAGE_DIR', '/media/karaoke/');define('RECORDS_DIR', '/media/records/');define('NFS_HOME_PATH', '/media/mac/');// Use login and password from the configuration file. (api_auth_login and api_auth_password in server/custom.ini)define('API_URL', 'http://test:te...@89.163.00.00:88/stalker_portal/api/');define('PORTAL_URL', 'http://89.163.00.00:88/stalker_portal/');define('STORAGE_NAME', 'bb3');define('ASTRA_RECORDER', true);...
Fatal error: Uncaught exception 'RESTClientRemoteError' with message 'Not supported protocol' in /var/www/html/stalker_portal/server/lib/restclient.class.php:132 Stack trace: #0 /var/www/html/stalker_portal/server/lib/restclient.class.php(32): RESTClient->execute() #1 /var/www/html/stalker_portal/server/lib/tvarchive.class.php(550): RESTClient->create(Array) #2 /var/www/html/stalker_portal/server/lib/tvarchive.class.php(494): TvArchive->createTask(3, 'bb3') #3 /var/www/html/stalker_portal/server/administrator/add_itv.php(87): TvArchive->createTasks(3, Array) #4 {main} thrown in /var/www/html/stalker_portal/server/lib/restclient.class.php on line 132 $mc_cmd = @$_POST['mc_cmd'];
if (empty($mc_cmd)){
foreach ($links as $link){
if ((strpos($link['url'], 'rtp://') !== false || strpos($link['url'], 'udp://') !== false || strpos($link['url'], 'http://') !== false) && preg_match("/(\S+:\/\/\S+)/", $link['url'], $match)){
$mc_cmd = $match[1];
break;
}
}
}
$('#mc_cmd').on('input', null, null, function(eventObject){
if (eventObject.currentTarget.value.indexOf('rtp://') != -1 || eventObject.currentTarget.value.indexOf('udp://') != -1){
$('#enable_tv_archive').removeAttr('disabled');
$('#allow_pvr').removeAttr('disabled');
}else{
$('#enable_tv_archive').attr('disabled', 'disabled');
$('#allow_pvr').attr('disabled', 'disabled');
}
});
if ($('#mc_cmd').val().indexOf('rtp://') != -1 || $('#mc_cmd').val().indexOf('udp://') != -1){
$('#enable_tv_archive').removeAttr('disabled');
$('#allow_pvr').removeAttr('disabled');
}else{
$('#enable_tv_archive').attr('disabled', 'disabled');
$('#allow_pvr').attr('disabled', 'disabled');
}I have setup Astra as I have approx 30 TVs channels for archive. I want to use Astra as udp streams clogg up my network and I have been told to change Astra from false to true in /storage/config.php after installing Astra and downloading dump stream.lua.
I have also changed the URL in tv channel from udp to http (http://8.8.8.8:8888) and I get the frescoes file created in /media/records/archive/1/ but it does it grow in size. It remains 0kb but each hour a new file is created.
Can anyone help please
define('ASTRA_RECORDER', true);
При установке в config.php на хранилищеdefine('ASTRA_RECORDER', false);для архива и nPVR будет запускаться dumpstream.lua вместо родного dumpstream
Hi friends
I use ASTRA dumpstream.lua for tv archive and records.
TV Archive works fine.
But have issue with play records.
Record are correctly set in /media/raid0/records/ folder (see log -2-) but missing symlinks to them in
/media/raid0/mac/00\:1A\:79\:14\:8F\:B6/ (see
log -3-)
What can be reason for missing symlinks?
Who script should make symlinks?
root@dvb-stalker:~# tailf /var/log/apache2/access.log |grep rec
127.0.0.1 - - [06/Jul/2017:07:32:33 +0300] "PUT
/stalker_portal/storage/rest.php?q=recorder/267 HTTP/1.0" 200 224
"-" "-"
127.0.0.1 - - [06/Jul/2017:07:32:33 +0300] "GET
/stalker_portal/server/load.php?type=remote_pvr&action=stop_rec&rec_id=523&JsHttpRequest=1-xml
HTTP/1.0" 200 472 "http://dtv.leaderbg.net/stalker_portal/c/index.html"
"Mozilla/5.0 (QtEmbedded; U; Linux; C) AppleWebKit/533.3 (KHTML, like
Gecko) MAG200 stbapp ver: 4 rev: 2721 Mobile Safari/533.3"
127.0.0.1 - stalker [06/Jul/2017:07:32:33 +0300] "PUT
/stalker_portal/api/stream_recorder/267 HTTP/1.0" 200 224
"-" "Astra"
---1-----
root@dvb-stalker:~# ps ax |grep astra
8896 ?
S 0:00 astra /var/www/stalker_portal/storage/dumpstream.lua
-A udp://239.255.0.2:3000
-s 0 -l 6918 -c http://stalker:secret_pass@IP/stalker_portal/api/stream_recorder/265
-o /media/raid0/records/265_20170706071224.mpg
---2----
root@dvb-stalker:~# ls -la /media/raid0/records/
загалом 967320
drwxrwxrwx 3 root
root 4096 лип 6
07:12 ./
drwxrwxrwx 6 root
root 4096 лип 3
21:25 ../
-rw-r--r-- 1 www-data www-data 12688872 лип 5 00:53
259_20170705005327.mpg
-rw-r--r-- 1 www-data www-data 5077128 лип 5 00:54
260_20170705005434.mpg
-rw-r--r-- 1 www-data www-data 33443508 лип 5 00:58
261_20170705005656.mpg
-rw-r--r-- 1 www-data www-data 893952220 лип 5 01:37
262_20170705010100.mpg
-rw-r--r-- 1 www-data www-data 12825736 лип 5 17:09
263_20170705170845.mpg
-rw-r--r-- 1 www-data www-data 26779284 лип 5 18:17 264_20170705181605.mpg
-rw-r--r-- 1 www-data www-data
5740392 лип 6 07:12 265_20170706071224.mpg
drwxrwxrwx 3 root
root 4096 кві 7
21:05 archive/
---3-----
root@dvb-stalker:~# ls -la /media/raid0/mac/00\:1A\:79\:14\:8F\:B6/
загалом 16
drwxrwxrwx 2 www-data www-data 4096 лип 5 01:02 ./
drwxrwxrwx 3 root root 4096
лип 5 00:44 ../
lrwxrwxrwx 1 www-data www-data 97 лип 5 01:02 15.avi ->
/media/raid0/storage/TheAssignment2016HDRipXviDAC3-EVO/The.Assignment.2016.HDRip.XviD.AC3-EVO.avi*
lrwxrwxrwx 1 www-data www-data 97 лип 5 01:02
The.Assignment.2016.HDRip.XviD.AC3-EVO.sub -> /media/raid0/storage/TheAssignment2016HDRipXviDAC3-EVO/The.Assignment.2016.HDRip.XviD.AC3-EVO.sub*