
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (40)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
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 (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (5858)
-
FFmpeg script skips files
23 janvier 2020, par ucq52oseI wrote a shell script to convert many video files and save them with something appended to the file name. The script works, but it seems to randomly skip files, and a lot of them.
When I re-run the script, it will convert files it skipped before. How can I get it to stop skipping files ?
workingDir=/home/user/Videos
# get list of files to convert
find /video/folder -iname "*.mp4" > $workingDir/file_list
# convert files
cat $workingDir/file_list | while read LINE; do
# FFmpeg often cuts off the beginning of this line
echo "$(dirname "$LINE")/$(basename "$LINE")"
if /usr/bin/ffmpeg -n -loglevel panic -v quiet -stats -i "$LINE" \
-c:v libx264 -vf scale="trunc(oh*a/2)*2:320" \
-pix_fmt yuv420p -preset:v slow -profile:v main -tune:v animation -crf 23 \
"$(dirname "$LINE")/$(basename "$LINE" \.mp4)"_reencoded.mp4 2>/dev/null; then
echo "Success: $(dirname "$LINE")/$(basename "$LINE")" >> $workingDir/results
else
echo "Failed: $(dirname "$LINE")/$(basename "$LINE")" >> $workingDir/results
fi
doneOne problem seems to be that FFmpeg interferes with the script. The FFmpeg output often cuts off the beginning of the next command, even if the output is not shown. This is demonstrated by the echo line before the if statement, which is often cut off. But even for lines that aren’t cut off, most of them will be skipped for no apparent reason.
-
FFmpeg script skips files
15 avril 2014, par ucq52oseI wrote a shell script to convert many video files and save them with something appended to the file name. The script works, but it seems to randomly skip files, and a lot of them.
When I re-run the script, it will convert files it skipped before. How can I get it to stop skipping files ?
workingDir=/home/user/Videos
# get list of files to convert
find /video/folder -iname "*.mp4" > $workingDir/file_list
# convert files
cat $workingDir/file_list | while read LINE; do
# FFmpeg often cuts off the beginning of this line
echo "$(dirname "$LINE")/$(basename "$LINE")"
if /usr/bin/ffmpeg -n -loglevel panic -v quiet -stats -i "$LINE" \
-c:v libx264 -vf scale="trunc(oh*a/2)*2:320" \
-pix_fmt yuv420p -preset:v slow -profile:v main -tune:v animation -crf 23 \
"$(dirname "$LINE")/$(basename "$LINE" \.mp4)"_reencoded.mp4 2>/dev/null; then
echo "Success: $(dirname "$LINE")/$(basename "$LINE")" >> $workingDir/results
else
echo "Failed: $(dirname "$LINE")/$(basename "$LINE")" >> $workingDir/results
fi
doneOne problem seems to be that FFmpeg interferes with the script. The FFmpeg output often cuts off the beginning of the next command, even if the output is not shown. This is demonstrated by the echo line before the if statement, which is often cut off. But even for lines that aren't cut off, most of them will be skipped for no apparent reason.
-
pipe youtube-dl to ffmpeg within a script
28 février 2016, par user556068This is an expansion to an earlier question I asked which you can find here. I have been piping youtube-dl into a script via
youtube-dl -iga /path/to/myFile.txt | myscript.sh
which reads a text file of urls and extracts another set of urls to the actual video content being downloaded. Everything works great but there is much room for improvement.Instead of piping youtube-dl into the script I would like to include the youtube-dl command within the script itself. Here is the full script I have up to this point.
#!/bin/bash
inArgs='-i'
outArgs='-c copy -y'
dir="$HOME/Movies/fftest/"
outFile="fftest_${count}"
ext='.mp4'
#### not sure about following 2 lines
youtube-dl -iga /path/to/myFile.txt > /path/to/myFile2.txt
exec 0to/myFile2.txt
count=0
if [ ! -d "${dir}" ];
then
mkdir -p "${dir}"
fi
cd || "${HOME}"
while read lineIn
do
{
(( count ++ ))
echo ffmpeg $inArgs $lineIn $outArgs "$dir$outFile$count$ext" &
sleep 1
}
doneAfter playing around with it a little I added the following lines. Code has been edited to reflect these changes.
youtube-dl -iga /path/to/myFile.txt > /path/to/myFile2.txt
exec 0to/myFile2.txtThis does work but it’s also throwing up some new error from ffmpeg that I haven’t yet encountered until now. I test by placing echo before the ffmpeg command. Everything looks fine doing that so I’m not really sure what the issue is at this point.
So there are a couple things i would like to accomplish that I haven’t been able to figure out.
-
Have I properly redirected the input and do I need to do anything later in the script to put things back as they were before the script was called or will that occur naturally on its own when exiting the script ?
-
As it currently is, the script will overwrite any files previously created every time it is called. This is fine for testing purposes but not ideal beyond that. What I am looking for is a way to start writing the next file in the number sequence based on the last file in the directory. So if one time it creates 8 files named fftest_1.mpr - fftest_8.mp4 the second time when it is called to create 14 new files, it will know to start writing a file labeled fftest_9.mp4 - fftest_22.mp4. This is however beyond my abilities at the moment. Is there a way to do this ?
-
Another issue I’ve had is when trying kill the script as it runs in the background. Ctrl C doesn’t have any effect as far as I can tell. Is there an alternative kill command or key press I can use to ensure an immediate exit if necessary. Or a way to assign such within the script itself ?
-
Also any critiques, suggestions, alternatives or additions to any part of this script are very much welcomed and appreciated. This is all very new for me and I’m trying to learn more everyday. If any part of what I said didn’t make sense I will be happy to clarify.
-