Skip to content

Instantly share code, notes, and snippets.

# Recompress video, add audio waveform
# usage: ./compress-video-waveform.sh video-source video-destination
videocodec="libx264 -strict -2 -crf 20 -preset slow"
audiocodec="libmp3lame -b:a 320k"
waveform="[0:a]showwaves=s=1920x540:mode=cline:split_channels=1:colors=\#ffffff40|\#ffffff40,format=argb[w];[0:v][w]overlay=(W-w)/2:(H-h)/2[v]"
ffmpeg -y -i $1 -c:v $videocodec -acodec $audiocodec -filter_complex $waveform -map "[v]" -map 0:a $2
# Convert Ardour left+right wavs to stereo flac files
for f in *%L.wav;
do
left=$f
right=$(echo $f | sed s/%L/%R/)
stereo=$(echo $f | sed s/%L.wav/.flac/)
ffmpeg -y -i "$left" -i "$right" -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -acodec flac "$stereo" # && rm -f "$left" "$right"
done
@kassoulet
kassoulet / Convert Audio To Video Visualisation
Last active April 4, 2018 07:40
Makefile to convert audio files to videos, with audio waves display.
# Makefile to convert audio files to videos, with audio waves display
# What you need to upload a nice audio on Youtube but you don't have a video
#
# Needs:
# - a music/ folder with flac files
# - a covers/ folder with 1920x1080 pictures,
# each with the same name than the flac, ending with "-1080p.png"
# - a video/ folder to store the generated videos
@kassoulet
kassoulet / gist:5880861
Created June 27, 2013 22:11
ViewPagerTester : How to stress-test a ViewPager
class ViewPagerTester {
private ViewPager mPager;
private int mDelay;
public ViewPagerTester(ViewPager pager, int delay) {
mPager = pager;
mDelay = delay;
}
public void run() {
@kassoulet
kassoulet / ratings.py
Created January 18, 2012 10:20
Retreive package ratings from Ubuntu Software Center
#!/usr/bin/python3
"""
Retreive package ratings from Ubuntu Software Center
gautier at soundconverter.org
"""
from sys import argv, exit
from time import sleep