
Recherche avancée
Médias (91)
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Lights in the Sky
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Head Down
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Echoplex
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Discipline
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Letting You
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (22)
-
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...) -
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)
Sur d’autres sites (3788)
-
How to configure proc_open "pipes" for ffmpeg stdin/stderr on Windows ?
10 septembre 2018, par GDPFirstly, I’ve spent the week googling and trying variations of dozens and dozens of answers for Unix, but it’s been a complete bust, I need an answer for Windows, so this is not a duplicate question of the Unix equivalents.
We’re trying to create a scheduled task that will process a queue of tasks in PHP, and maintain an array of up to 10 ffmpeg instances at a time. I’ve tried
exec
,shell_exec
andproc_open
, coupled with/withoutstart /B
without any "complete" luck.
I’m also quite certain that it has to do with setting up the descriptorspec and pipes (which I’m completely unfamiliar with), and here’s why :Per https://trac.ffmpeg.org/wiki/PHP,
The part that says ">/dev/null" will redirect the standard OUTPUT
(stdout) of the ffmpeg instance to /dev/null (effectively ignoring the
output) and "2>/dev/null" will redirect the standard ERROR (stderr) to
/dev/null (effectively ignoring any error log messages). These two can
be combined into a shorter representation : ">/dev/null 2>&1". If you
like, you can ?read more about I/O Redirection.An important note should be mentioned here. The ffmpeg command-line
tool uses stderr for output of error log messages and stdout is
reserved for possible use of pipes (to redirect the output media
stream generated from ffmpeg to some other command line tool). That
being said, if you run your ffmpeg in the background, you’ll most
probably want to redirect the stderr to a log file, to be able to
check it later.One more thing to take care about is the standard INPUT (stdin).
Command-line ffmpeg tool is designed as an interactive utility that
accepts user’s input (usually from keyboard) and reports the error log
on the user’s current screen/terminal. When we run ffmpeg in the
background, we want to tell ffmpeg that no input should be accepted
(nor waited for) from the stdin. We can tell this to ffmpeg, using I/O
redirection again "echo "Starting ffmpeg...\n\n";
echo shell_exec("ffmpeg -y -i input.avi output.avi null >/dev/null 2>/var/log/ffmpeg.log &");
echo "Done.\n";This example actually uses
shell_exec
, though we want to use proc_open so that we can use a loop to check if the process has completed or not.Here’s a basic sample loop of what I’ve tried. The problem in executing this is that the actual ffmpeg processing completes, but the process is hung "waiting for something". When I use debugging, and step out of the loop and terminate the process after a few minutes, the ffmpeg output is written and the script carries on. (From the command line, ffmpeg takes less than a minute to complete)
$descriptorspec = array(
array('pipe', 'r'),
array('pipe', 'w'),
array('pipe', 'w'),
);
$pipes = null;
$cwd = null;
$env = null;
$process = proc_open('start /B ffmpeg.exe -i input.mov output.mp4 -nostdin', $descriptorspec, $pipes, $cwd, $env);
$status = proc_get_status($process);
while($status['running']) {
sleep (60);
$status = proc_get_status($process);
}
proc_terminate($process);Also, as documented at ffmpeg Main-options :
Enable interaction on standard input. On by default unless standard
input is used as an input. To explicitly disable interaction you need
to specify-nostdin
.The
-nostdin
option seems to indicate that it addresses my problem, but it has no apparent affect. In all solutions for Unix that I’ve found, it appears to still require some form of this this unix added :null
or2>&1
.So, with that somewhat exhaustive prologue, can someone explain how to properly configure the
proc_open
function to satisfy howffmpeg.exe
interacts with I/O ? If there is a better or more appropriate approach, I’m happy to do that, but the important thing is to be able to loop thru an array of processes to check if they’re complete, so that other faster processes can complete in the meantime.UPDATE
After exhaustive R&D, it seems that the I/O is not the issue in making this happen (the -nostdin
option seems to work as advertised). The premise of my design was to useproc_get_status()
to determine whenffmpeg
was finished. The flaw in that approach is that apparently that does NOT return the actual PID of the ffmpeg process...it returns the parent PID. So, whenproc_get_status()
returned that the video conversion was complete, it was in fact still running, not hung. This was further complicated by testing on larger video files. The larger the video, the longer the "residual" time was that it took to actually finish — the I/O wasn’t the issue - watching the Parent PID instead of the child PID was the problem. So, without getting into much lower level system internals with Windows, this doesn’t appear to be possible with PHP directly. I’ve decided to abandon this approach, but hopefully this discovery will save someone else some time and trouble. -
Revision 112320 : Afficher_si : - pouvoir enchaîner plusieurs @checkbox_1@ IN - ...
4 novembre 2018, par maieul@… — LogAfficher_si :
- pouvoir enchaîner plusieurs @checkbox_1@ IN
- exemple (@checkbox_1@ IN "vendredi" && @checkbox_1@ !IN "samedi") || (@checkbox_1@ !IN "vendredi" && @checkbox_1@ IN "samedi") (sur une seule ligne)
- pour mémoire, le problème était dans le point d’interro sur (.* ?).
Par défaut, ce point d’interro rendait la recherche non gourmande, (la
plus petite quantité possible). Mais comme la recherche était déjà
rendu globalement non gourmande (via le flag U), alors le ? rendait la
recherche gourmande sur ce quantificateur.
Cf http://php.net/manual/fr/regexp.reference.repetition.php -
Replace Special Characters In Batch-File Variable Feeding FFMPEG Programme
6 janvier 2019, par whereswallerI am attempting to write a batch-file that leverages the FFMPEG programme to convert all files in a folder structure to mp3 format (specifically 128kbps).
My batch-file is presently unable to process filenames (constructed by concatenating the %_SOURCE% and %% F variables) containing certain special characters, for example :
’
"
öHow can I modify my script so that the %% F variable escapes these characters correctly ?
Example current filename input : "C :\Users\Test\Documents\Input\Peter Bjorn And John - I Know You Don’t Love Me.mp3"
Example desired filename input : "C :\Users\Test\Documents\Input\Peter Bjorn And John - I Know You Don"^’"t Love Me.mp3"
Script (see line beginning "C :\ffmpeg\bin\ffmpeg.exe") :
@echo off
setlocal EnableExtensions DisableDelayedExpansion
rem // Define constants here:
set "_SOURCE=C:\Users\Test\Documents\Input" & rem // (absolute source path)
set "_TARGET=C:\Users\Test\Documents\Output" & rem // (absolute target path)
set "_PATTERN=*.*" & rem // (pure file pattern for input files)
set "_FILEEXT=.mp3" & rem // (pure file extension of output files)
pushd "%_TARGET%" || exit /B 1
for /F "delims=" %%F in ('
cd /D "%_SOURCE%" ^&^& ^(rem/ list but do not copy: ^
^& xcopy /L /S /Y /I ".\%_PATTERN%" "%_TARGET%" ^
^| find ".\" ^& rem/ remove summary line;
^)
') do (
2> nul mkdir "%%~dpF.
rem // Set up the correct `ffmpeg` command line here:
set "FFREPORT=file=C\:\\Users\\Test\\Documents\\Output\\ffreport-%%~F.log:level=32"
"C:\ffmpeg\bin\ffmpeg.exe" -report -n -i "%_SOURCE%\%%~F" -vn -c:a libmp3lame -b:a 128k "%%~dpnF%_FILEEXT%"
if not errorlevel 1 if exist "%%~dpnF%_FILEEXT%" del /f /q "%_SOURCE%\%%~F"
)
popd
endlocal
pause