Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
logiciel:multimedia:video:optimizevideo:start [2022/07/03 17:05] – supprimée - modification externe (Unknown date) 127.0.0.1 | logiciel:multimedia:video:optimizevideo:start [2022/08/13 22:14] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
+ | {{tag> | ||
+ | ====== optimizeVideo : Remplace une vidéo par sa plus petite version sans perte de qualité perceptible ====== | ||
+ | |||
+ | <code bash optimizeVideo-master/ | ||
+ | #! /bin/bash | ||
+ | |||
+ | : ' | ||
+ | === HOW TO RUN === | ||
+ | |||
+ | For running this installer, in the application " | ||
+ | "/ | ||
+ | |||
+ | For a list of programs installed like this type: | ||
+ | ls / | ||
+ | |||
+ | |||
+ | === PURPOSE === | ||
+ | |||
+ | This installer is mostly for trying out the software | ||
+ | If you end liking it, ask someone how to package it | ||
+ | |||
+ | If your system includes the app " | ||
+ | https:// | ||
+ | |||
+ | |||
+ | === LEGALESE === | ||
+ | |||
+ | Installer by Alberto Salvia Novella (es20490446e.wordpress.com) | ||
+ | Under the latest GNU Affero License | ||
+ | https:// | ||
+ | ' | ||
+ | |||
+ | |||
+ | # For testing the installer: | ||
+ | update=" | ||
+ | simulate=" | ||
+ | clean=" | ||
+ | |||
+ | # Others: | ||
+ | here=" | ||
+ | program=" | ||
+ | in=" | ||
+ | etc=" | ||
+ | lists=" | ||
+ | fileList=" | ||
+ | dirList=" | ||
+ | |||
+ | |||
+ | mainFuntion () { | ||
+ | if [ ! -d " | ||
+ | checkDependencies | ||
+ | builds | ||
+ | installs | ||
+ | else | ||
+ | uninstalls | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | |||
+ | builds () { | ||
+ | if [ ! -d " | ||
+ | bash " | ||
+ | chown --recursive " | ||
+ | fi | ||
+ | |||
+ | if [ ! -d " | ||
+ | echo " | ||
+ | exit 1 | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | |||
+ | checkDependencies () { | ||
+ | list=" | ||
+ | |||
+ | if [ -f " | ||
+ | readarray -t lines < <(cat " | ||
+ | missing=() | ||
+ | |||
+ | for line in " | ||
+ | name=$(echo " | ||
+ | path=$(echo " | ||
+ | web=$(echo " | ||
+ | |||
+ | if [ ! -z " | ||
+ | web=" | ||
+ | fi | ||
+ | |||
+ | if ! $(ls $path &> /dev/null); then | ||
+ | missing+=(" | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | if [ ! -z " | ||
+ | echo " | ||
+ | echo >&2 | ||
+ | printf ' | ||
+ | echo >&2 | ||
+ | echo "Get those installed first" | ||
+ | echo "and run this installer again" | ||
+ | exit 1 | ||
+ | fi | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | |||
+ | checkPermissions () { | ||
+ | if [ " | ||
+ | sudo " | ||
+ | exit ${?} | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | |||
+ | cleanUp () { | ||
+ | if [ " | ||
+ | if [ ! -z " | ||
+ | rm --recursive "/ | ||
+ | fi | ||
+ | elif [ " | ||
+ | invalidVariable " | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | |||
+ | createLists () { | ||
+ | if [ ! -d " | ||
+ | mkdir --parents " | ||
+ | fi | ||
+ | |||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | echo " | ||
+ | } | ||
+ | |||
+ | |||
+ | dirsInFolder () { | ||
+ | folder=" | ||
+ | |||
+ | dirs=$( | ||
+ | cd " | ||
+ | find . -type d | | ||
+ | cut --delimiter='/' | ||
+ | ) | ||
+ | |||
+ | echo " | ||
+ | } | ||
+ | |||
+ | |||
+ | fileMime () { | ||
+ | file=" | ||
+ | |||
+ | file --brief --mime " | ||
+ | cut --delimiter=';' | ||
+ | } | ||
+ | |||
+ | |||
+ | fileParents () { | ||
+ | file=" | ||
+ | |||
+ | echo ${file} | | ||
+ | rev | | ||
+ | cut --delimiter='/' | ||
+ | rev | ||
+ | } | ||
+ | |||
+ | |||
+ | installFile () { | ||
+ | file=" | ||
+ | |||
+ | if [ " | ||
+ | installSymlink " | ||
+ | else | ||
+ | install -D " | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | |||
+ | installSymlink () { | ||
+ | symlink=" | ||
+ | target=" | ||
+ | |||
+ | makeParents " | ||
+ | ln --symbolic --force " | ||
+ | } | ||
+ | |||
+ | |||
+ | installs () { | ||
+ | readarray -t files < < | ||
+ | createLists | ||
+ | |||
+ | for file in " | ||
+ | installFile " | ||
+ | echo " | ||
+ | done | ||
+ | |||
+ | dirsInFolder " | ||
+ | echo " | ||
+ | } | ||
+ | |||
+ | |||
+ | invalidVariable () { | ||
+ | variable=" | ||
+ | |||
+ | echo "The variable \" | ||
+ | echo "It can either be \" | ||
+ | exit 1 | ||
+ | } | ||
+ | |||
+ | |||
+ | makeParents () { | ||
+ | file=" | ||
+ | parents=" | ||
+ | mkdir --parents " | ||
+ | } | ||
+ | |||
+ | |||
+ | prepareEnvironment () { | ||
+ | set -e | ||
+ | updateInstaller | ||
+ | setOut | ||
+ | checkPermissions | ||
+ | trap "" | ||
+ | cleanUp | ||
+ | } | ||
+ | |||
+ | |||
+ | setOut () { | ||
+ | if [ " | ||
+ | out="" | ||
+ | elif [ " | ||
+ | out=" | ||
+ | else | ||
+ | invalidVariable " | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | |||
+ | toInstall () { | ||
+ | toInstall=$( | ||
+ | cd " | ||
+ | find . -not -type d | | ||
+ | cut --delimiter='/' | ||
+ | ) | ||
+ | |||
+ | echo " | ||
+ | } | ||
+ | |||
+ | |||
+ | uninstalls () { | ||
+ | readarray -t files < <(cat " | ||
+ | readarray -t dirss < <(cat " | ||
+ | |||
+ | for file in " | ||
+ | rm " | ||
+ | done | ||
+ | |||
+ | for dir in " | ||
+ | if [ -d " | ||
+ | rm --recursive --force " | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | if [ ! -z " | ||
+ | rm --recursive "/ | ||
+ | fi | ||
+ | |||
+ | echo " | ||
+ | } | ||
+ | |||
+ | |||
+ | updateInstaller () { | ||
+ | if [ " | ||
+ | remote=" | ||
+ | local=" | ||
+ | |||
+ | if [ -z " | ||
+ | if [ -z " | ||
+ | echo "No Internet, which is required" | ||
+ | else | ||
+ | echo " | ||
+ | echo "Ask developers to fix this" | ||
+ | fi | ||
+ | |||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | if [ " | ||
+ | echo " | ||
+ | sudo " | ||
+ | exit ${?} | ||
+ | fi | ||
+ | elif [ " | ||
+ | invalidVariable " | ||
+ | fi | ||
+ | } | ||
+ | |||
+ | |||
+ | prepareEnvironment " | ||
+ | mainFuntion | ||
+ | </ | ||
+ | |||
+ | Modofier comme ceci : | ||
+ | <code - optimizeVideo-master/ | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | </ | ||
+ | ===== Pré-requis ===== | ||
+ | |||
+ | <WRAP list-deep> | ||
+ | - **Installez [[apt> | ||
+ | - **Installez [[apt> | ||
+ | - **Installez [[apt> | ||
+ | - **Installez [[apt> | ||
+ | - **Installez [[apt> | ||
+ | - **Installez [[apt> | ||
+ | - **Installez [[apt> | ||
+ | - **args** :<cli prompt=' | ||
+ | ...@...: | ||
+ | ...@...: | ||
+ | ... | ||
+ | ...@...: | ||
+ | ...@...: | ||
+ | installed | ||
+ | </ | ||
+ | - **solve** :<cli prompt=' | ||
+ | ...@...: | ||
+ | ...@...: | ||
+ | ... | ||
+ | ...@...: | ||
+ | ...@...: | ||
+ | installed | ||
+ | </ | ||
+ | </ | ||
+ | ===== Installation ===== | ||
+ | |||
+ | <cli prompt=' | ||
+ | ...@...: | ||
+ | installed | ||
+ | </ | ||
+ | ===== Configuration ===== | ||
+ | |||
+ | ===== Utilisation ===== | ||
+ | |||
+ | <cli prompt=' | ||
+ | ===== Désinstallation ===== | ||
+ | |||
+ | <cli prompt=' | ||
+ | ...@...: | ||
+ | uninstalled | ||
+ | </ | ||
+ | ===== Problèmes connus ===== | ||
+ | |||
+ | ===== Voir aussi ===== | ||
+ | |||
+ | * **(fr)** [[http:// | ||
+ | |||
+ | ---- | ||
+ | //Basé sur << [[http:// |