
Recherche avancée
Autres articles (75)
-
Monitoring de fermes de MediaSPIP (et de SPIP tant qu’à faire)
31 mai 2013, parLorsque l’on gère plusieurs (voir plusieurs dizaines) de MediaSPIP sur la même installation, il peut être très pratique d’obtenir d’un coup d’oeil certaines informations.
Cet article a pour but de documenter les scripts de monitoring Munin développés avec l’aide d’Infini.
Ces scripts sont installés automatiquement par le script d’installation automatique si une installation de munin est détectée.
Description des scripts
Trois scripts Munin ont été développés :
1. mediaspip_medias
Un script de (...) -
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 ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (10179)
-
More efficient way to assign multiple variables in a FOR loop ?
9 juin 2020, par TomI'm trying to capture the output of ffprobe to assign to two variables - currently I just run the loop twice to captue the
encoder
andcodec_name
tag. Is there a more effcient way to do this from within a single loop ?


for /F "delims=" %%i in ('ffprobe -v error -show_entries format_tags^=encoder -of default^=nw^=1:nk^=1 %%a 2^>^&1') do set "encoder=%%i"
echo !encoder!

for /F "delims=" %%j in ('ffprobe -v error -show_entries stream^=codec_name -of default^=nw^=1:nk^=1 %%a 2^>^&1') do set "codec_name=%%j"
echo !codec_name! 




Here's the full code for info - it's a batch reverse function in FFMPEG.



@echo off
md "%cd%\_reversedFiles"

for %%a in (*.wav) do (
 SETLOCAL enabledelayedexpansion
 for /F "delims=" %%i in ('ffprobe -v error -show_entries format_tags^=encoder -of default^=nw^=1:nk^=1 %%a 2^>^&1') do set "encoder=%%i"
 echo !encoder!

 for /F "delims=" %%j in ('ffprobe -v error -show_entries stream^=codec_name -of default^=nw^=1:nk^=1 %%a 2^>^&1') do set "codec_name=%%j"
 echo !codec_name!

 ffmpeg -i %%a -af areverse -c:a !codec_name! "\_reversedFiles\%%~na.wav" 
 bwfmetaedit "\_reversedFiles\%%a" -a --ISFT="!encoder!"
)




For ease of sharing it needs to be in a batch file.


-
ffmpeg bitrate error when trying to capture frames at intervals from a video
25 octobre 2011, par TheShaggyBeardHere is the error I get from running this script :
[mjpeg @ 0x8559710]bitrate tolerance too small for bitrate
Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or heightSo here is what I am trying to do - I want to automate creating animated gif previews from a video file (in this case I know they will always be a specific format being mp4). Here is what I have :
echo 'Save the file-name and make a folder named "filenamemp4"'
fileName=$(find . -type f -name "*.mp4")
folderName=$( cat $fileName | grep -o [[:alnum:]] | tr -d '\n' | cat)
echo 'Grab the frame rate and total number of frames and put them into xaa and xab'
qtinfo asa.mp4 | awk 'NR = 1 { print $2 }' | grep -o "^[0-9]*" | split -l 1
echo 'Assign values to variable'
frameRate=$(cat xaa)
frameTotal=$(cat xab)
videoLength=$(expr $frameTotal / $frameRate)
echo 'Take a screenshot at 10% intervals - this is the part that gives me a bitrate error. It says that the -r option has an invalid input being 1 / value of videoLength'
ffmpeg -i $fileName -y -ss $videoLength -an -sameq -f image2 -s 'qcif' -r $(expr 1/$videoLength) preview%02d.jpg
echo 'Take the jpgs and mash them into an animated gif'
convert -delay 50 -loop 10 preview*.jpg preview.gif
echo 'Move the gif to the specified folder'
mv preview.gif $folderName/preview.gif
echo 'Clean Up'
find . -type f -name "*.jpg" -exec rm -rf {} \;So perhaps there is a better way of doing this, or I am understanding how to use the -r option of ffmpeg wrong. In the tutorial I read on ffmpeg for a similar scenario, they used -r 1/5 to produce frames with a 5 second interval. My assumption is that for the desired interval you want, you just slap it in the denominator for the -r option.
-
ffmpeg fails with a wall of red hex output but only when in a bash loop
2 avril 2016, par jozxyqkSimilar question here, but no solution : https://www.reddit.com/r/linuxquestions/comments/m00f0/hex_output_from_ffmpeg_when_run_in_a_loop/
I’m trying to batch encode some video. I have a list of filenames in a text file and read each one in a bash loop. This is it :
OUT=./out
mkdir -p $OUT
while read inputfile; do
b=$(basename "$inputfile")
outputfile="$OUT/$b"
echo
echo
echo "$inputfile"
echo "$outputfile"
echo
ffmpeg -i "$inputfile" "$outputfile" || exit
done < files.txtWhen I run it, the ffmpeg command seems to start OK, then spits out a massive wall of red hex dump like text (as below). It does finish without error, but the file is only a few hundred frames long.
[libx264 @ 0x1b68d60] frame= 537 QP=31.44 NAL=0 Slice:B Poc:70 I:2 P:239 SKIP:987 size=516 bytes
stream #1:
keyframe=1
duration=0.024
dts=25.992 pts=25.992
size=336
00000000 ff fb 84 64 1a 0e d3 21 3f d4 93 18 6a e6 33 a4 ...d...!?...j.3.
00000010 6a 63 25 22 4a 0c d1 1d 52 6c bd ab c0 bf 23 69 jc%"J...Rl....#i
... LOTS MOREThe other really weird thing is that the next
inputfile
in the bash loop is broken and has only the last few characters, which does not happen if I simply comment out theffmpeg
line.What could ffmpeg be doing to interfere with the bash loop like this ?
(ffmpeg 2.8.6, bash 4.3.42(1), fedora 23)