
Recherche avancée
Autres articles (15)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...)
Sur d’autres sites (1970)
-
Python - check subprocess activity every n seconds
22 novembre 2017, par hlaborI’m trying to make python script (currently on windows) which will open some sub-processes (which will run infinitely) and script should periodically check do all of opened sub-processes still work correctly. So it should be done with while loop, I guess.
The sub-processes are about FFMPEG livestreaming.
The problem is when I do
time.sleep(n)
in my loop, because then every FFMPEG livestream stops, so I supposetime.sleep
affect on all of child subprocesses.I have no idea how to make it work.
Here is my python code :
import os, time, sys, datetime, smtplib, configparser, logging, subprocess, psutil
import subprocess
def forwardudpstream(channel_number, ip_input, ip_output):
try:
ffmpeg_command = 'ffmpeg -i udp://' + ip_input + ' -vcodec copy -acodec copy -f mpegts "udp://' + ip_output + '?pkt_size=1316"'
ffmpeg_output = subprocess.Popen(ffmpeg_command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False)
return str(ffmpeg_output.pid)
except:
print ("Exception!")
return '0'
while True:
configuration = 'config.ini'
channel_list_file = 'CHANNEL_LIST.conf'
pid_folder = "D:\\Forward_UDP_Stream\\pids\\"
channel_list = [line.rstrip('\n') for line in open(channel_list_file)]
for line in channel_list:
if not line.startswith('#') and ('|' in line):
channel_number, ip_input, ip_output = line.split('|')
print('----------')
print("Channel number = ", channel_number)
print("IP Input = ", ip_input)
print("IP Output = ", ip_output)
pid_file_found = False
print("Checking if pid file exists...")
for pidfile in os.listdir(pid_folder):
if pidfile.startswith(channel_number + '-'):
print("Pid file is found for this channel.")
pid_file_found = True
pid = int(pidfile.split('-')[1].split('.')[0])
print("PID = ", str(pid))
print("Checking if corresponding process is active...")
if not psutil.pid_exists(pid):
print("Process is not active.")
print("Removing old pid file.")
os.remove(pid_folder + pidfile)
print("Starting a new process...")
pid_filename = channel_number + '-' + forwardudpstream(channel_number, ip_input, ip_output) + '.pid'
pid_file = open(pid_folder + pid_filename, "a")
pid_file.write("Process is running.")
pid_file.close()
else:
print("Process is active!")
break
if pid_file_found == False:
print("Pid file is not found. Starting a new process and creating pid file...")
pid_filename = channel_number + '-' + forwardudpstream(channel_number, ip_input, ip_output) + '.pid'
pid_file = open(pid_folder + pid_filename, "a")
pid_file.write("Process is running.")
pid_file.close()
time.sleep(10)Here is my CHANNEL_LIST.conf file example :
1|239.1.1.1:10000|239.1.1.2:10000
2|239.1.1.3:10000|239.1.1.4:10000Perhaps there is some other solution to put waiting and sub-processes to work together. Does anyone have an idea ?
UPDATE :
I finally make it work when I removedstdout=subprocess.PIPE
part from the subprocess command.
Now it looks like this :ffmpeg_output = subprocess.Popen(ffmpeg_command, stderr=subprocess.STDOUT, shell=False)
So now I’m confused why previous command was making a problem...?
Any explanation ? -
NodeJs : How to pipe two streams into one spawned process stdin (i.e. ffmpeg) resulting in a single output
20 juin 2018, par Keyne VianaIn order to convert PCM audio to MP3 I’m using the following :
function spawnFfmpeg() {
var args = [
'-f', 's16le',
'-ar', '48000',
'-ac', '1',
'-i', 'pipe:0',
'-acodec', 'libmp3lame',
'-f', 'mp3',
'pipe:1'
];
var ffmpeg = spawn('ffmpeg', args);
console.log('Spawning ffmpeg ' + args.join(' '));
ffmpeg.on('exit', function (code) {
console.log('FFMPEG child process exited with code ' + code);
});
ffmpeg.stderr.on('data', function (data) {
console.log('Incoming data: ' + data);
});
return ffmpeg;
}Then I pipe everything together :
writeStream = fs.createWriteStream( "live.mp3" );
var ffmpeg = spawnFfmpeg();
stream.pipe(ffmpeg.stdin);
ffmpeg.stdout.pipe(/* destination */);The thing is... Now I want to merge (overlay) two streams into one. I already found how to do it with ffmpeg : How to overlay two audio files using ffmpeg
But, the ffmpeg command expects two inputs and so far I’m only able to pipe one input stream into the
pipe:0
argument. How do I pipe two streams in the spawned command ? Would something likeffmpeg -i pipe:0 -i pipe:0...
work ? How would I pipe the two incoming streams with PCM data (since the command expects two inputs) ? -
FFmpeg Capture remote screen
29 août 2018, par ricardoI am trying capture a remote screen via ffmpeg and x11grab, I run in my machine this command
xpra start-desktop :20 --start-child=fluxbox
this machine have the ip
192.168.1.15
and in the remote capture I try run this
/usr/local/bin/ffmpeg -f pulse -server 192.168.1.15 -i tarjeta01.monitor -f x11grab -framerate 25 -r 25 -i 192.168.1.15:20.0 -fflags nobuffer -f rtp -c:v h264_nvenc -preset llhp -profile:v baseline -level 4 -delay 0 -b:v 1500k -threads 4 -cbr 1 -r 25 -an udp://:5008 -f rtp -vn -c:a libopus -ar 48000 -ac 2 -ab 96k -application lowdelay -compression_level 0 -frame_duration 2.5 -cutoff 20000 -vbr constrained udp://localhost:5006
I make xhost + and xhost + 192.168.1.16 in the machine where run xpra but always receive this error
[x11grab @ 0x23e4ea0] Cannot open display 192.168.1.15:20, error 1.
192.168.1.15:20: Input/output errorI try xpra, Xephyr and xfvb but always get the same error
Thanks for all best regards