
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)
-
MP4 to DASH (bash script)
18 mars 2019, par Francesco GalganiI have a web site in which users can upload video files. I want to stream all of them using DASH to obtain an adaptive bitrate streaming. So I wrote a bash script (to run by cron) that converts all mp4 files to DASH, but it doesn’t work properly : what is wrong ?
For example, using the following script, I obtained :
https://www.informatica-libera.net/dash_faq/stream.mpdIt validates, but it doesn’t play. I tested it on :
http://dash-mse-test.appspot.com/dash-player.html?url=https%3A%2F%2Fwww.informatica-libera.net%2Fdash_faq%2Fstream.mpd&autoplay=on&adapt=auto&flavor=Thank you for any help.
The code :#!/bin/bash
# THIS SCRIPT CONVERTS EVERY MP4 (IN THE CURRENT FOLDER AND SUBFOLDER)
# TO A MULTI-BITRATE VIDEO IN MP4-DASH
# For each file "videoname.mp4" it creates a folder "dash_videoname"
# containing a dash manifest file "stream.mpd" and subfolders containing
# video segments.
# mp4dash documentation and download: https://www.bento4.com/developers/dash/
MYDIR=$(dirname $(readlink -f ${BASH_SOURCE[0]}))
SAVEDIR=$(pwd)
# Check programs
if [ -z "$(which ffmpeg)" ]; then
echo "Error: ffmpeg is not installed"
exit 1
fi
if [ -z "$(which mp4dash)" ]; then
echo "Error: mp4dash is not installed"
exit 1
fi
cd "$MYDIR"
TARGET_FILES=$(find ./ -type f -name "*.mp4")
for f in $TARGET_FILES
do
f=$(basename "$f") # fullname of the file
f="${f%.*}" # name without extension
if [ ! -d "dash_${f}" ]; then
echo "Converting \"$f\" to multi-bitrate video in MPEG-DASH"
ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 1500k -vf "scale=-2:720" -f mp4 -pass 1 -y /dev/null
ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 1500k -vf "scale=-2:720" -f mp4 -pass 2 "${f}_1500.mp4"
ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 800k -vf "scale=-2:540" -f mp4 -pass 1 -y /dev/null
ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 800k -vf "scale=-2:540" -f mp4 -pass 2 "${f}_800.mp4"
ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -vf "scale=-2:360" -f mp4 -pass 1 -y /dev/null
ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 400k -vf "scale=-2:360" -f mp4 -pass 2 "${f}_400.mp4"
ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 200k -vf "scale=-2:180" -f mp4 -pass 1 -y /dev/null
ffmpeg -y -i "${f}.mp4" -c:a libfdk_aac -ac 2 -ab 128k -c:v libx264 -x264opts 'keyint=24:min-keyint=24:no-scenecut' -b:v 200k -vf "scale=-2:180" -f mp4 -pass 2 "${f}_200.mp4"
rm -f ffmpeg*log*
mp4fragment "${f}_1500.mp4" "${f}_1500_fragmented.mp4"
mp4fragment "${f}_800.mp4" "${f}_800_fragmented.mp4"
mp4fragment "${f}_400.mp4" "${f}_400_fragmented.mp4"
mp4fragment "${f}_200.mp4" "${f}_200_fragmented.mp4"
rm -f "${f}_1500.mp4" "${f}_800.mp4" "${f}_400.mp4" "${f}_200.mp4"
mp4dash -v -o "dash_${f}" "${f}_1500_fragmented.mp4" "${f}_800_fragmented.mp4" "${f}_400_fragmented.mp4" "${f}_200_fragmented.mp4"
rm -f "${f}_1500_fragmented.mp4" "${f}_800_fragmented.mp4" "${f}_400_fragmented.mp4" "${f}_200_fragmented.mp4"
fi
done
cd "$SAVEDIR" -
Get result of ffmpeg and pass it to a python script
1er mai 2018, par Rex LowPretty sure this is doable but I am not exactly sure on how to achieve it.
I have a Raspberry Pi streaming constantly on my local network and I use this
ffmpeg
script to save the video inside the Pi.ffmpeg -i http://0.0.0.0:8080/stream/video.mjpeg -vcodec copy -map 0 -f segment -segment_time 5 -segment_format mp4 capture-%05d.mp4
The script is rather straightforward, it loads and saves 5 seconds video continuously in a local directory.
Here’s what I am trying to do ultimately
Upload all saved videos to a Cloud Storage, then delete the local copy
I tried to pipe the output of
ffmpeg
to a python script like this but it does not work the way I imagine it would.ffmpeg -i http://0.0.0.0:8080/stream/video.mjpeg -vcodec copy -map 0 -f segment -segment_time 5 -segment_format mp4 capture-%05d.mp4 | py test.py -p capture-%05d.mp4
This is my script, just to get the name/path of video
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--videoPath', type=str, help="Path to recorded video", required=True)
args = parser.parse_args()
print(args.videoPath) -
Extract audio from youtube in a client-side script
5 mai 2018, par KevinThere are a lot of node libraries for turning a youtube video into an audio stream, but all of them rely on a C-library called ffmpeg.
Ffmpeg has been ported to javascript as well, but it has a 30MB size, which seems rather cumbersome (ffmpeg does a lot more than just rip audio from youtube, it has many advanced audio filtering techniques that won’t be needed for this application).
Lastly, I came across this link,https://hackernoon.com/how-to-build-an-audio-processor-in-your-browser-302cb7aa502a, which claims to be a client-side audio processor but really does all the stuff on the server-side, and then says that stuff can’t be done in the client because of CORS (not sure I understand this, can’t CORS be avoided with a simple flag in the request ?).
Does anyone know of any way to stream audio within the client-side browser, specifically from youtube, in a manner that’s general and unopposed ?