
Advanced search
Other articles (67)
-
La sauvegarde automatique de canaux SPIP
1 April 2010, byDans 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 April 2011, byAfin 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 April 2011, byTo 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 (...)
On other websites (6219)
-
Continuously Scan Directory and Perform Script on New Items
5 January 2021, by Jeff WeeseFirst, please forgive me and be easy on me if this question seems easy; the first time I tried posting a question about another subject, I didn't provide enough information a few months ago. My apologies.


I'm trying to scan my incoming media folder for new audio files and convert them to my preferred format into another folder, without removing the originals.


I've written the script below and while it seems to work for one-offs, I can't seem to get it to create the destination directory name based off the source directory name; and I can't seem to figure out how to keep it looping, "scanning", for new media to arrive without processing what it's already processed.


I hope this makes sense...


#! /bin/bash

srcExt=$1
destExt=$2

srcDir=$3
destDir=$4

opts=$5

# Creating the directory name - not currently working
# dirName="$(basename "$srcDir")"
# mkdir "$destDir"/"$dirName"

for filename in "$srcDir"/*.flac; do

 basePath=${filename%.*}
 baseName=${basePath##*/}
 
 ffmpeg -i "$filename" $opts "$destDir"/"$baseName"."$destExt"

done

for filename in "$srcDir"/*.mp3; do

 basePath=${filename%.*} 
 baseName=${basePath##*/}

 ffmpeg -i "$filename" $opts "$destDir"/"$baseName"."$destExt"

done



-
how to make the script re-ask for the input again after failure?
6 April 2022, by Rami Magdithis some script for ffmpeg that i added to windows context menu
so i just copy paste what i want done
when this .bat fails [wrong argument for instance ] it closes and i have to restart it
how to make the script re-ask for the input again after failure?


@echo off
echo -------------------------------------------------------------
echo FILTERS
echo -------------------------------------------------------------
echo,
echo VERTICAL FLIP= -lavfi vflip
echo HORIZONTAL FLIP= -lavfi hflip
echo NEGAT COLORS= -lavfi Enegate
echo NEGATE LUMINANCE= -lavfi lutyuv=y=negval
echo GRAYSCALE= -lavfi hue=s=0
echo ISOLATE COLOR= -lavfi colorhold=color="orange":similarity=0.29:blend=0
echo PS CURVES PRESET= -lavfi curves=psfile='MyCurvesPresets/purple.acv'
echo VIGNETTE EFFECT= -lavfi vignette=PI/4
echo LOOKUP TABLE= -lavfi lut3d=c\\:/nnn/ggg.cube
echo SPEED UP OR SLOW DOWN= -lavfi setpts=PTS/2
echo SPEED UP VIDEOS, AUDIOS= -lavfi "[0:v]setpts=PTS/2[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]"
echo REVERSE= -lavfi reverse
echo POSTERIZE= -lavfi elbg=l=8:n=1
echo MOTION BLUR= -lavfi tmix=frames=20:weights="10 1 1"
echo HARD SUB= -lavfi subtitles=s.ass
echo SOFT SUB= -scodec mov_text -metadata:s:s:0 language=eng
echo ONE IMAGE= -lavfi -frames 1
echo AN IMAGE EVERY 60 SEC= -lavfi fps=1/60
echo ONLY IFRAMES= -skip_frame nokey
echo GIF= -lavfi "fps=10,scale=320:-2:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0
echo STACKS= -lavfi "[0:v][1:v][2:v][3:v]xstack=inputs=4:layout=0_0|w0_0|0_h0|w0_h0[v]" -map "[v]"
echo EMBED THUMBNAIL = -i 1.jpg -map 0:0 -map 0:1 -map 1 -c:0 copy -c:v:1 png -disposition:v:1 attached_pic
ECHO,
echo -------------------------------------------------------------
echo CODEC OPTIONS
echo -------------------------------------------------------------
echo,
echo -lavfi "[0:v]scale=-2:720,setpts=PTS/1.5[v];[0:a]atempo=1.5[a]" -map "[v]" -map "[a]" -crf 40 -preset ultrafast
echo -map 0 -codec copy
echo -acodec copy -vcodec libx264 -vsync cfr -crf 20 -pix_fmt yuv420p -tune film -preset veryfast -movflags +faststart
echo -acodec aac -ac 2 -ab 128k -ar 44100 / -acodec libmp3lame -ab 320k -ar 44100 -id3v2_version 3 
echo -qscale:v 2
echo,



the main part:


set /P extra="ENTER CODEC OPTIONS="

echo,
echo Processing "%~nx1"
echo Output will be "%~n1"_output.mp4"
ffmpeg -v error -stats -y -i "%~1" %extra% "%~n1"_output.mp4
pause



-
Recursive ffmpeg batch script within Windows
30 September 2013, by TischComplete change to the question!
I now have the following script:
@echo off
REM keep a counter for files converted
set /A nfile=0
REM do not copy empty folders or any files
@echo Copying directory structure from %0 to %1 ...
xcopy /T %1 %2
REM walk directory structure and convert each file in quiet mode
for /R %1 %%v in (*.mp4, *.aac, *.flv, *.m4a, *.mp3) do (
echo converting "%%~nxv" ...
ffmpeg -v quiet -i "%%v" -vcodec libx264 "%2\%%~nv-converted.mp4"
set /A nfile+=1
)
echo Done! Converted %nfile% file(s)The videos are converting as expected when I run the following command:
convert ..\..\folder ..\..\converted\
However, the converted files end up in "converted" and not in their respective sub-folders.
Any ideas?