
Recherche avancée
Autres articles (106)
-
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras. -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...)
Sur d’autres sites (5933)
-
ffmpeg, stretch audio to x seconds
7 janvier, par Max DoumitI am trying to make an audio file be exactly x second.


So far i tried using the
atempo
filter by doing the following calculation

Audio length / desired length = atempo.


But this is not accurate, and I am having to tweak the tempo manually to get it to an exact fit.


Are there any other solutions to get this work ? Or am I doing this incorrectly ?


My original file is a wav file, and my output in an mp3


Here is a sample command


ffmpeg -i input.wav -codec:a libmp3lame -filter:a "atempo=0.9992323" -b:a 320K output.mp3



UPDATE :


I was able to correctly calculate the tempo by changing the way I am receiving the audio length.


I am now calculating the current audio length using the actual file size and the sample rate.


Audio Length = file size / (sample rate * 2)



Sample rate is something like 16000 Hz. You can get that by using ffprob or ffmpeg.


-
Run 2 exec command in for loop with time interval of 30 seconds using TCL and FFMPEG
29 novembre 2017, par M. D. Pi want to Run 2 exec command in for loop with time interval of 30 seconds using TCL and FFMPEG
my exec command for image is :
exec ffmpeg -f dshow -benchmark -i video="Integrated Webcam" -s 1280x720 c:/test/sample_image%d.jpg
my exec command for video is :
exec ffmpeg -f dshow -benchmark -i video="Integrated Webcam" -s 1280x720 c:/test/sample_video%d.avi
i want my code to be like this :
proc a {} {
set a 1
while {$a < 10} {
after 3000
exec ffmpeg -f dshow -benchmark -i "video=Integrated Webcam" -s 1280x720 c:/test/sample_image.avi
after 3000
exec ffmpeg -f dshow -t 00:00:30 -benchmark -i "video=Integrated Webcam" -s 1280x720 c:/test/sample_video.avi
incr a
}
}
aproblem here is, after completion of first exec command, it stops its execution. that is it captures the image and stops its execution.
I also want that this process of capturing image and video should work in loop (while or foreach).
i have my present working code which execute only one exec command, that to only one. so i want this two exec command to run after one another in loop.
error report for above program :
% source c:/other/a/d.tcl
ffmpeg version N-89212-ga60b2425c3 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
libavutil 56. 2.100 / 56. 2.100
libavcodec 58. 3.105 / 58. 3.105
libavformat 58. 2.102 / 58. 2.102
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 2.102 / 7. 2.102
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, dshow, from 'video=Logitech HD Webcam C525':
Duration: N/A, start: 90055.057000, bitrate: N/A
Stream #0:0: Video: rawvideo, bgr24, 1280x720, 30 fps, 30 tbr, 10000k tbn, 10000k tbc
File 'c:/test/sample_20171128_111245.jpg' already exists. Overwrite ? [y/N] [dshow @ 052d4ac0] real-time buffer [Logitech HD Webcam C525] [video input] too full or near too full (181% of size: 3041280 [rtbufsize parameter])! frame dropped!
Last message repeated 886 times
Not overwriting - exiting
bench: maxrss=50856kB
[dshow @ 052d4ac0] real-time buffer [Logitech HD Webcam C525] [video input] too full or near too full (181% of size: 3041280 [rtbufsize parameter])! frame dropped!
Last message repeated 1 times
%please provide me the code as answer which will work for above problem.
-
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 ?