
Recherche avancée
Autres articles (104)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (23977)
-
Tailing a logfile and processing each line is missing data when converting a file with ffmpeg
8 avril 2014, par Chris.DI am running a script to tail a log file as per the code snippet below. I am running into a problem where by the line passed into $line is missing a number amount of bytes from the beginning when several lines are written to the log file at nearly the same time.
I can check the file afterwards and see that the offending line is complete in the file so why is it incomplete in the script. Some kind of buffering issue perhaps ?
The processing can sometimes take several seconds to complete would that make a difference ?
#!/bin/bash
tail -F /var/log/mylog.log | while read line
do
log "$line"
ffmpeg -i "from.wav" "to.mp3"
doneFull line in file
"12","","765467657","56753763","test"
example logged $line
657","56753763","test"
Update
I have done some more debugging of my code and it seems the processing that is causing the problem is a call to ffmpeg used to convert a wav to mp3. If I swap that with just a sleep then the problem goes away. Could ffmpeg effect the buffer somehow ? -
Run a function from while read line
2 octobre 2013, par user2783132I'm trying to run a function from while read line, the function contains ffmpeg commands to marge two files. but for some reason it's running the first
$line
and than breaks from loop."$filesList" contains three lines. I'm not sure what's wrong, but i can confirm with echo "$OFILE" that opener function runs three times if I
comment out
the ffmpeg commands, and only oncewith
ffmpeg commands.opener(){
OFILE="$1"
echo "$OFILE"
ffmpeg -i $opener_path -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i $OFILE -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc merge_$OFILE
mv merge_$OFILE $OFILE
rm intermediate1.ts intermediate2.ts
}
while read line; do
if [ -e "$line" ]; then
opener "$line"
fi
done <<< "$filesList" -
Running PHP from command line
9 juin 2014, par Kit CarrauI am trying to manage a queue of files waiting to be processed by ffmpeg. A page is run using CRON that runs through a database of files waiting to be processed. The page then builds the commands and sends them to the command line using
exec()
.However, when the PHP page is run from the command line or CRON, it runs the
exec()
OK, but does not return to the PHP page to continue updating the database and other functions.Example :
<?php
$cmd = "ffmpeg inpupt.mpg output.m4v";
exec($cmd . ' 2>&1', $output, $return);
//Page continues...but not executed
$update = mysql_query("UPDATE.....");
?>When this page is run from the command line, the command is run using
exec()
but then the rest of the page is not executed. I think the problem may be that I am running a command usingexec()
in a page run from the command line.Is it possible to run a PHP page in full from the command line which includes
exec()
?Or is there a better way of doing this ?
Thank you.