
Recherche avancée
Autres articles (19)
-
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 (...) -
Utilisation et configuration du script
19 janvier 2011, parInformations spécifiques à la distribution Debian
Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
Récupération du script
Le script d’installation peut être récupéré de deux manières différentes.
Via svn en utilisant la commande pour récupérer le code source à jour :
svn co (...) -
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 (...)
Sur d’autres sites (2061)
-
Checking for files in a directory with bash script ? what is wrong with this code ?
14 mars 2018, par A SahraI have written this code to check for video files in a directory and convert them with ffmpeg.
while running this script i get out put as "[ERROR] File Not Found" which i have it in else block.what is wrong with the script that i don’t get the files.#!/bin/bash
# set PATH to check existance of video file in this directory
checkfiles='/home/webuser/public_html/shareportal/convertedUp_videos/'
#format of output video file
webm='webm'
for f in checkfiles
do
fullfilename="$f"
filenamewithpath=$(basename "$fullfilename")
filewithoutext="${filename%.*}"
fileextention="${filename##*.}"
changeextension=mv --"$f" "${f%.$fileextention}.$webm"
outputfilename="/home/webuser/public_html/shareportal/converted_videos/$changeextension"
echo "File FUll NAME : $fullfilename"
echo "File name with full path : $filenamewithpath"
echo "File name without extention : $filewithoutext"
echo "File extention : $fileextention"
echo '1 File Converted'
if (ffmpeg -i "$f" "$outputfilename")
then
confullfilename="$outputfilename"
confilenamewithpath=$(basename "$confullfilename")
confilewithoutext="${filename%.*}"
confileextention="${filename##*.}"
echo "File FUll NAME : $confullfilename"
echo "File name with full path : $confilenamewithpath"
echo "File name without extention : $confilewithoutext"
echo "File extention : $confileextention"
echo '1 File Converted'
else
echo "Could Not Convert File"
fi
#get Image of video file on provided time stamp
image_path='/home/webuser/public_html/shareportal/video_images/$filewithoutext.png'
if (ffmpeg -ss 00:00:03 -i "$f" -vframes:v 1 "$image_path")
then
echo "Image Extracted"
else
echo "Could not Extract Image"
fi
done
rm -r f -
Improve bash script for checking when ffmpeg hangs streaming IP cam rtsp to youtube
15 octobre 2022, par shakespeareBackground



I have a garden IP cam id like to stream live to youtube, so i decided to use ffmpeg to achieve this.



The problem



Whenever my IP cam restarts or loses connection ; ffmpeg will get stuck on the same frame and not resume once the IP cam is back online.



My solution



I have the ffmpeg output logged to a file, then have a script fetch the last line of the log every few seconds and compares frame numbers. If the frame numbers match, it kills ffmpeg process and starts another ffmpeg process.



My question



Is there a better way more efficient way ?



logchecker.sh



#/bin/bash
while true
do
 frameA=$(tail /home/daniel/output.txt -n 1 | sed -nr 's/.*frame=(.*)fps.*/\1/p')
 echo "$frameA"
 sleep 3
 frameB=$(tail /home/daniel/output.txt -n 1 | sed -nr 's/.*frame=(.*)fps.*/\1/p')
 echo "$frameB"

 if [ "$frameA" = "$frameB" ]
 then
 echo "Camera has hung"
 pkill ffmpeg
 echo "killed ffmpeg..."
 echo "Waiting 30 secs"
 sleep 30
 bash /home/daniel/ffmpeg.sh &
 echo "started ffpmeg.."
 echo "Waiting 30 secs"
 sleep 30
 else 
 echo "proceed"
 fi

 sleep 2
done




ffmpeg.sh



#!bin/bash
sleep 30
ffmpeg -f lavfi -i anullsrc -rtsp_transport udp -i rtsp://user:password@url:5544/live0.264 -bufsize 5000k -c:v copy -c:a mp3 -b:a 1 -f flv rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx 2> /home/daniel/output.txt



-
How to simplify the script for ffmpeg ?
27 mars 2018, par Pravesh KumarI want this script to be simplified
I am having this given simple script ; I would like to simplify this script can anyone help me to add text with the proper time interval and fade in and out effect.
ffmpeg -y -i video.mp4 -filter_complex \
"[0]split[base][text];[text] \
drawtext=fontfile=gvr.otf:text='Which of these is not an event listener adapter defined in the java.awt.event package?': fontcolor=white: fontsize=40: x=100:y=200, \
format=yuva444p,fade=t=in:st=1:d=1:alpha=1,fade=t=out:st=8:d=1:alpha=1[subtitles]; \
[base][subtitles]overlay" test_out.mp4
ffmpeg -y -i test_out.mp4 -filter_complex \
"[0]split[base][text];[text] \
drawtext=fontfile=gvr.otf:text='a) public void apple(String s, int i) {}': fontcolor=white: fontsize=40: x=100:y=(200) + 50 * 2, \
format=yuva444p,fade=t=in:st=3:d=1:alpha=1,fade=t=out:st=8:d=1:alpha=1[subtitles]; \
[base][subtitles]overlay" test_out1.mp4
ffmpeg -y -i test_out1.mp4 -filter_complex \
"[0]split[base][text];[text] \
drawtext=fontfile=gvr.otf:text='b) public int apple(int i, String s) {}': fontcolor=white: fontsize=40: x=100:y=(200) + 50 * 3, \
format=yuva444p,fade=t=in:st=4:d=1:alpha=1,fade=t=out:st=8:d=1:alpha=1[subtitles]; \
[base][subtitles]overlay" test_out2.mp4
ffmpeg -y -i test_out2.mp4 -filter_complex \
"[0]split[base][text];[text] \
drawtext=fontfile=gvr.otf:text='c) public void apple(int i, String mystring) {}': fontcolor=white: fontsize=40: x=100:y=(200) + 50 * 4, \
format=yuva444p,fade=t=in:st=5:d=1:alpha=1,fade=t=out:st=8:d=1:alpha=1[subtitles]; \
[base][subtitles]overlay" test_out3.mp4
ffmpeg -y -i test_out3.mp4 -filter_complex \
"[0]split[base][text];[text] \
drawtext=fontfile=gvr.otf:text='d) public void Apple(int i, String s) {}': fontcolor=white: fontsize=40: x=100:y=(200) + 50 * 5, \
format=yuva444p,fade=t=in:st=6:d=1:alpha=1,fade=t=out:st=8:d=1:alpha=1[subtitles]; \
[base][subtitles]overlay" test_out4.mp4