<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi Listers!</p>
<p>Here is a little tooly that I made that may be be of any use to
you guys ;<br>
</p>
<p>Today, if you want to publish a song, pretty soon they're going
to ask your for "the video". But sometimes you don't have the time
/ money to do it. Heck, it's a job. <a
href="https://www.youtube.com/watch?v=O27yC-qLlMM">The "Lost
Week" video</a> took me like a (big. Huge) week to put together,
not counting shooting time. BTW it was edited in KDEnlive, but
since <a href="https://www.youtube.com/watch?v=7EH9jSnYAGI">No
Sister</a> (and <a
href="https://www.youtube.com/watch?v=2zZO7-wo2_o">my Why, Phil
show</a> and all) I use Blender for that kind of things now.</p>
<p>Back on topic : You don't have time to put together a proper
video for your shiny new because you have a life and recording the
song already took the best of it lately.<br>
</p>
<p>Here is <a
href="https://github.com/xaccrocheur/kituu/blob/master/scripts/px-video-maker.sh">a
script</a> to quickly generate a <a
href="https://www.youtube.com/watch?v=t-u18CbdjBE">cool-looking
music video</a>, given the sound file, the cover artwork image
and an optional ending bit :</p>
<p><tt>#!/usr/bin/env bash<br>
<br>
FILE_PATH="$1"<br>
FFMPEG="ffmpeg"<br>
ARTIST="$2"<br>
ALBUM="$3"<br>
COVER_FILE_PATH="$4"<br>
EFFECT="$5"<br>
<br>
if [ "$#" -ne 5 ]; then<br>
echo "Usage: $0 [audio file path] 'artist name' 'album name'
[artwork image file path] [point|line|p2p|cline]"<br>
exit<br>
fi<br>
<br>
convert -resize 1280x720 "${COVER_FILE_PATH}" -background none
-gravity center -extent 1280x720 "${COVER_FILE_PATH}.jpg"<br>
<br>
$FFMPEG -y -i "${FILE_PATH}" -loop 1 -i "${COVER_FILE_PATH}.jpg"
-filter_complex "[0:a]
showwaves=s=1280x310:mode=${EFFECT}:r=25,colorkey=0x000000:0.1:0.5[wave];[1:v][wave]
overlay=y=H-h:eval=init[canvas];[canvas]drawtext=fontfile='Jura-Book.ttf':fontsize=60:text='${ARTIST}':x=30:y=(h-70-text_h*2.5):fontcolor=white:shadowy=2:shadowx=2:shadowcolor=black,drawtext=fontfile='Jura-Book.ttf':fontsize=72:text='${ALBUM}':x=20:y=(h-70-text_h):fontcolor=ff6600:shadowy=2:shadowx=2:shadowcolor=black"
-shortest -codec:v libx264 -crf 18 -preset fast -codec:a aac
-strict -2 -b:a 192k "${FILE_PATH}-composite.mp4"<br>
<br>
if [[ -e "end.mp4" ]]; then<br>
$FFMPEG -y -i "${FILE_PATH}-composite.mp4" -i "end.mp4"
-filter_complex "[0:0] [0:1] [1:0] [1:1] concat=n=2:v=1:a=1 [v]
[a]" -map "[v]" -map "[a]" "${ARTIST}-${ALBUM}.mp4"<br>
<br>
rm -rf "${FILE_PATH}-composite.mp4"<br>
else<br>
mv "${FILE_PATH}-composite.mp4" "${ARTIST}-${ALBUM}.mp4"<br>
fi<br>
<br>
rm -rf "${COVER_FILE_PATH}.jpg"<br>
<br>
echo -e "<br>
################################################<br>
DONE : ${ARTIST}-${ALBUM}.mp4"<br>
<br>
</tt></p>
This will<br>
<ul>
<li>Take the (PNG) cover, and center it inside a 1280x720 (AKA
720p) pixels video ;<br>
</li>
<li>Generate a "wave" of the (WAV) sound file ;<br>
</li>
<li>Print "Artist" in Orange, And then "Title" in White, below,
slightly bigger and offset to the left ;<br>
</li>
<li>Merge the 3 together ;<br>
</li>
<li>If there exists a file named "end.mp4" in the directory,
append it to the final video ;<br>
</li>
<li>Clean up everything, and produce a file named
"Artist-Title.mp4" in 720p.</li>
</ul>
<p>Notes: <br>
</p>
<ul>
<li>This script depends on the ffmpeg and imagemagick packages</li>
<li>The last argument is the style of the dancing waveform, take a
short audio file to experiment with all 4 of them<br>
</li>
<li>The "end.mp4" file is optional, it's there if you want an
ending credit / legal / whatever bit, or a nice fade out,
anything. It's scaled to fit.<br>
</li>
<li>If there is a "Jura-Book.ttf" font file in the directory from
which the script is invoked, it will be used, otherwise your
default serif font will be.</li>
</ul>
With it, you can make <a
href="https://www.youtube.com/watch?v=t-u18CbdjBE">that kind of
music video</a> ; hope it's useful, cheers everybody, keep on
rocking it!<br>
<br>
<br>
yPhil<br>
<br>
<pre class="moz-signature" cols="72">--
Yassin "xaccrocheur" Philip
<a class="moz-txt-link-freetext" href="http://manyrecords.com">http://manyrecords.com</a> / <a class="moz-txt-link-freetext" href="http://yassinphilip.bitbucket.org">http://yassinphilip.bitbucket.org</a></pre>
</body>
</html>