Bonjour,
une idée farfelue qui me trottait dans la tête depuis pas mal de temps. Un barge est un barge
lancer le script
YOUTUBE_VINTAGE et attendre l'invite pour coller l'adresse de la vidéo Youtube.
apt install mplayer ffmpeg youtube-dl
la vidéo sera sur le Bureau
le script :
#!/bin/bash
PATH=$PATH:/sbin:/usr/sbin
## VINTAGE
## @Anonyme
## youtube-dl ffmpeg youtube-dl
## youtube-dl -o -f best https://www.youtube.com/watch?v=oK7k0EIGlF4
## https://www.youtube.com/watch?v=zs9IsYjCrAw
## https://www.youtube.com/watch?v=aiNFF9q5OLw
# Retro Movie Camera Sound Effect
# https://www.youtube.com/watch?v=pHWHokbd5xQ
# https://www.youtube.com/watch?v=xlobOQZ9Wqk
# youtube-dl -f m4a https://www.youtube.com/watch?v=xlobOQZ9Wqk
# https://stackoverflow.com/questions/349 … ing-ffmpeg
DIR=$(xdg-user-dir DESKTOP)
SCRATCHESDIR=~/DATA_VINTAGE
SCRATCHES=$(youtube-dl --get-filename -o "%(title)s.%(ext)s" w9iQBNyn4Ac)
PROJECTOR_FILM=$(youtube-dl --get-filename -o "%(title)s.%(ext)s" -f m4a https://www.youtube.com/watch?v=xlobOQZ9Wqk)
JOBDIR=~/OLD_JOB
if [ ! -d "$SCRATCHESDIR" ]; then
mkdir "$SCRATCHESDIR"
fi
if [ -e "$SCRATCHESDIR/$SCRATCHES" ]; then
echo "Fichier déjà présent"
sleep 2
else
echo "Fichier absent"
sleep 2
youtube-dl -o "$SCRATCHESDIR/$SCRATCHES" -f best https://www.youtube.com/watch?v=w9iQBNyn4Ac
fi
if [ -e "$SCRATCHESDIR/$PROJECTOR_FILM" ]; then
echo "Fichier déjà présent"
sleep 2
else
echo "Fichier absent"
sleep 2
youtube-dl -o "$SCRATCHESDIR/$PROJECTOR_FILM" -f m4a https://www.youtube.com/watch?v=xlobOQZ9Wqk
fi
if [ ! -d "$JOBDIR" ]; then
mkdir "$JOBDIR"
fi
echo "Coller une URL: "
read -r URL
youtube-dl -o "$JOBDIR/%(title)s.%(ext)s" -f best "$URL"
VIDEO_NAME=$(youtube-dl --get-filename -o "%(title)s.%(ext)s" -f best "$URL")
BASENAME="$(basename "$VIDEO_NAME" | sed 's/\.[^.]*$//')"
SCALE=$(ffprobe "$JOBDIR/$VIDEO_NAME" 2>&1 | awk '/Stream/ && /Video:/ { print $11 }')
DURATION=$(ffprobe "$JOBDIR/$VIDEO_NAME" -show_format 2>&1 | sed -n 's/duration=//p')
echo "$DURATION"
ffmpeg -i "$SCRATCHESDIR/$SCRATCHES" -r 1 -f image2 "$SCRATCHESDIR/image_damage_effect_%4d.png"
ffmpeg -loop 1 -r 7 -f image2 -i "$SCRATCHESDIR/image_damage_effect_%4d.png" \
-c:v libx264 -preset veryfast \
-filter:v scale="$SCALE" -pix_fmt yuv420p \
-t "$DURATION" -y "$JOBDIR/SCRATCH.mp4"
ffmpeg -i "$JOBDIR/$VIDEO_NAME" -i "$JOBDIR/SCRATCH.mp4" \
-loglevel repeat+verbose \
-c:v libx264 -preset veryfast \
-filter_complex "blend=all_mode='overlay':all_opacity=0.4,\
colorchannelmixer=0.98786:0.01538:0.00378:0.0:0.00698:0.99372:0.00336:0.0:0.00544:0.01068:0.98262:0.0" \
-pix_fmt yuv420p -map 0:1 -acodec copy -y "$JOBDIR/$BASENAME+[SCRATCH].mkv"
rm -f "$JOBDIR/$VIDEO_NAME"
rm -f "$JOBDIR/SCRATCH.mp4"
ffmpeg -ss 00:00:03.000 -i "$SCRATCHESDIR/$PROJECTOR_FILM" -filter:a "volume=0.2" -ac 2 -acodec ac3 -b:a 160k -y "$JOBDIR/[REDUCE_DB]-$PROJECTOR_FILM"
ffmpeg -stream_loop -1 -i "$JOBDIR/[REDUCE_DB]-$PROJECTOR_FILM" -acodec copy -ss 00:00:00.000 -t "$DURATION" -y "$JOBDIR/long_output.ac3"
rm -f "$JOBDIR/[REDUCE_DB]-$PROJECTOR_FILM"
ffmpeg -y -i "$JOBDIR/$BASENAME+[SCRATCH].mkv" -stream_loop -1 -i "$JOBDIR/long_output.ac3" \
-filter_complex "[0:a][1:a]amix=inputs=2:duration=longest[out]" \
-map 0:v -c:v libx264 -preset veryfast -map [out] -ss 00:00:00.000 -t "$DURATION" -y "$DIR/${BASENAME[Vintage]}.mkv"
rm -r "$JOBDIR"
Dernière modification par Anonyme (10-04-2020 12:46:38)