Skip to content

Instantly share code, notes, and snippets.

@riyad
riyad / extract-audio.sh
Last active November 17, 2018 22:19
Extract audio from any media file ffmpeg can play into a new one (without converting or reencoding!)
#!/bin/sh
#
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de>
# License: Mozilla Public License 2.0
#
# Extract audio from any file ffmpeg can play (without converting or reencoding!).
if [[ $# -ne 3 ]]; then
echo "Error: wrong number of arguments"
@riyad
riyad / ffmpeg-cut
Last active November 17, 2018 22:16
Cut out a part of a media file within the given time stamps (without converting or reencoding!)
#!/bin/bash
#
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de>
# License: Mozilla Public License 2.0
#
# Cuts out a part of a media file within the given time stamps (without converting or reencoding!).
set -o nounset # complain when reading unset vars
# set -o xtrace # print every command as it's executed
@riyad
riyad / ffmpeg-mp3-converter.rb
Last active November 17, 2018 22:14
Small scripts to transcode any file VLC or ffmpeg can play to mp3.
#!/usr/bin/env ruby -rubygems
#
# Author: Riyad Preukschas <riyad@informatik.uni-bremen.de>
# License: Mozilla Public License 2.0
#
# Transcode any file ffmpeg can play to mp3.
require 'optparse'
require 'shellwords'