
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (40)
-
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 (...) -
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 (5791)
-
bash script for ffmpeg conversion does not loop
12 septembre 2015, par Alex MonthyI have this bash script for a batch conversion of some mp4 files :
#!/bin/bash
ls dr*.mp4 | grep -v -E "\.[^\.]+\." | sed "s/.mp4//g" | while read f
do
TARGET="$f.ffmpeg.mp4"
if ! [ -f $TARGET ]
then
echo $TARGET
ffmpeg -nostdin -i $f.mp4 -s 320x180 -vc h264 -acodec copy -f mp4 -y $TARGET
fi
TARGET="$f.ffmpeg.flv"
if ! [ -f $TARGET ]
then
echo $TARGET
ffmpeg -nostdin -i $f.mp4 -s 320x180 -acodec copy -y $TARGET
fi
TARGET="$f.jpg"
if ! [ -f $TARGET ]
then
echo $TARGET
ffmpeg -nostdin -i $f.ffmpeg.mp4 -ss 0 -vframes 1 -f image2 $TARGET
fi
TARGET="$f.ffmpeg.ogv"
if ! [ -f $TARGET ]
then
echo $TARGET
ffmpeg -nostdin -i $f.mp4 -s 320x176 -ar 11025 -acodec libvorbis -y $TARGET
fi
doneIt runs once but does and converts the input file name to 4 different formats, but does not loop to the next input file name.
I tried to shuffle the order of the various conversions, but still the script runs exactly once for one file name.
I tried to run ffmpeg with the -nostdin flag, but it says"Unrecognized option 'nostdin'"
The ffmpeg version is ffmpeg version 0.10.6-6:0.10.6-0ubuntu0jon1 lucid2 - I just update the ffmpeg package from http://ppa.launchpad.net/jon-severinsson/ffmpeg/ubuntu and cannot find an newer version. The base system is
Distributor ID: Ubuntu
Description: Ubuntu 10.04.1 LTS
Release: 10.04
Codename: lucid -
ffmpeg not using wildcard properly from batch script
20 mars 2013, par Paul GreenWhat I want to do is actually super simple and is working just fine if executed from within the cmd window, though it does not work when used within a batch script. The following command would normally get all .png files with the pattern anim_xxxx.png (%04d stands for 4 numbers in ffmpeg).
ffmpeg -f image2 -i anim_%04d.png -vcodec mjpeg -q:v 0 -r 25 foo.avi
Now the error I get is with the wildcard for my image sequence and I have no clue what the problem is. Using another wildcard like * gives me the same error.
[image2 @ 000000000033e8c0] Could find no file with with path
'anim_render.bat4d.png' and index in the range 0-4
anim_render.bat4d.png : No such file or directorydoes %04d resemble any variable in a batch file that does not exist outside of batch files ? I could not find any similar cases so far.
-
bash script to handle 9000 lines of text by groups of 25
6 février 2023, par Robert DioI have an input file with 9095 lines of text. I need to take this list of filenames and use them as input to an ffmpeg command. I really would like to avoid running it all at once (line by line until end of file).


Is there a way in a bash script to take the first 25 lines, execute the ffmpeg command on them, then continue to the next 25 lines and execute the same command, until the end of the input file ?


Input file (example.txt) has list of 9095 filenames to be processed.


I have tried the following :


#!/bin/bash

while mapfile -n 25 convert < example.txt do
while read -r line || [[ -n "$line" ]]; do fn_out="w$line"; (/path/to/file/ffmpeg -report -nostdin -i /path/to/file/watermark.png -i /path/to/file/"$line" -filter_complex "scale2ref[a][b];[b][a]overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2" /path/to/file/"$fn_out" -c:v libx265); done < $convert >> script.txt
done




This only gets me the first 25 files. How to account for all 9095 files in example.txt ?


Also, is there any way to "pause" the script in between each set of 25 filenames ? I am not familiar enough with mapfile and bash scripting to know how to handle this kind of iteration.


Basically, the output needs to be as follows :


- 

- Read first 25 lines of example.txt
- Run the ffmpeg command on those 25 files (some files are over 2GB. Will take time to do the ffmpeg command.
- Pause for about a minute or two. Let server rest/catch up/recover resources.
- Get the next 25 names from example.txt
- Run the ffmpeg conversion loop again in step 2
- Continue until EOF of example.txt














Any direction on this would be greatly appreciated !


Running CentOS 7 with bash 5.0.17.