you are here: codestackercodes [RSS] → tag ffmpeg [RSS]

shell script for audio recording

details in this post: http://leonardofaria.net/2016/01/26/shell-script-for-audio-recording/

#!/bin/bash


# paths

TIMELIMIT="timelimit"
LIVESTREAMER="livestreamer"
FFMPEG="ffmpeg"

# parameters

IN=$1
OUT=$2
TIME=$3
if [[ -z $TIME ]]; then TIME="3600"; fi

if [ $# -lt 1 ]; then
	echo -n "Usage: $0 url output [time]"
	exit 0
fi

if [[ -z `which $TIMELIMIT` ]]; then
	echo "timelimit not found" 1>&2
	exit 1;
fi

if [[ -z `which $LIVESTREAMER` ]]; then
	echo "livestreamer not found" 1>&2
	exit 1;
fi

if [[ -z `which $FFMPEG` ]]; then
	echo "ffmpeg not found" 1>&2
	exit 1;
fi

echo "START STREAMING"
$TIMELIMIT -t $TIME $LIVESTREAMER $IN best -o $OUT.ts

echo "CONVERTING FILE TO MP3"
ffmpeg -y -i $OUT.ts -c:a libmp3lame -b:a 64k -joint_stereo 0 $OUT

rm $OUT.ts
echo "DONE"

batch convertion: ffmpeg avi -> mpg

#!/bin/sh
for f in *.flv;
do
echo "Processing $f"
ffmpeg -i "$f" -target ntsc-dvd "${f%.flv}.mpg"
done

[ffmpeg] batch screenshot generator from flv

path = "."
videos = Dir["#{path}/*.flv"]
videos.each do |f|
  puts "converting #{f}"
  newFile = f.gsub(".flv", ".jpg")
  system("ffmpeg -itsoffset -4 -i #{f} -vframes 1 -an -f mjpeg -s 320x240 #{newFile}")
end

ffmpeg on mac os leopard

source: http://www.haykranen.nl/2007/11/21/howto-install-and-use-ffmpeg-on-mac-os-x-leopard/

sudo port install ffmpeg +gpl +lame +x264 +xvid

ffmpeg screenshots

ffmpeg -itsoffset -4  -i video.mpeg -vframes 1 -an -f mjpeg -s 320x240 video.jpeg

ffmpeg -i video.flv -vcodec png -ss 00:00:03 -s 320x240 -vframes 1 -an -f rawvideo video.png
Displaying all 5 Code