Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma
You can get the list of supported formats with:
ffmpeg -formats
You can get the list of installed codecs with:
| #!/bin/bash | |
| # suffix to use on the output file | |
| suffix="_padded" | |
| # color must be a value from http://ffmpeg.org/ffmpeg-utils.html#Color | |
| color="black" | |
| # seconds_at_start must be an integer | |
| seconds_at_start=2 | |
| # seconds_at_end must be an integer | |
| seconds_at_end=10 |
| <?php | |
| // Server file | |
| class PushNotifications { | |
| // (Android)API access key from Google API's Console. | |
| private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI'; | |
| // (iOS) Private key's passphrase. | |
| private static $passphrase = 'joashp'; | |
| // (Windows Phone 8) The name of our push channel. | |
| private static $channelName = "joashp"; |
| Terminal Commands: | |
| One webcam: | |
| ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -vcodec libx264 -pix_fmt yuv420p -preset ultrafast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE | |
| Two webcam overlay: | |
| ffmpeg -f alsa -ac 2 -i hw:1,0 -f v4l2 -s 1280x720 -r 10 -i /dev/video1 -f v4l2 -s 320x240 -r 10 -i /dev/video0 -filter_complex "[1:v]setpts=PTS-STARTPTS[bg]; [2:v]setpts=PTS-STARTPTS[fg]; [bg][fg]overlay=shortest=1 [out]" -map "[out]" -map 0:a -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 20 -b:v 2500k -codec:a libmp3lame -ar 44100 -threads 6 -b:a 11025 -bufsize 512k -f flv rtmp://a.rtmp.youtube.com/live2/YOURSTREAMNAMEHERE |
| #!/bin/bash | |
| #brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid | |
| #$1 directory $2 input type $3 output type | |
| #ffmpeg -i input.flv -vcodec libvpx -acodec libvorbis output.webm | |
| find "$1" -type f -name "*.$2" | while read -r file; do | |
| filename=$(basename "$file" ".$2") | |
| dirname=$(dirname "$file") | |
| ffmpeg -i "$dirname/$filename.$2" "$dirname/$filename.$3" | |
| done |
| #!/bin/bash | |
| #Mirror: https://k0nsl.org/blog/snippets/bench-cpu-sh/ | |
| #Installation von BC | |
| apt-get install bc -y | |
| #Infos über System | |
| cname=$( awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo ) | |
| cores=$( awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo ) |
| #! /bin/bash | |
| # | |
| # Diffusion youtube avec ffmpeg | |
| # Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée. | |
| VBR="2500k" # Bitrate de la vidéo en sortie | |
| FPS="30" # FPS de la vidéo en sortie | |
| QUAL="medium" # Preset de qualité FFMPEG | |
| YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube |
| #!/bin/bash | |
| # Create an Iframe index from HLS segmented streams | |
| # $1: Filename to be created | |
| # $2: Location of segmented ts files | |
| # Check how many arguments | |
| if [ $# != 2 ]; then | |
| echo "Usage: $0 [Input filename] [Location of segmented streams]" | |
| exit 1; | |
| fi |
| makeWebm() { | |
| FILE=$1 | |
| BITRATE=${2:-'3450'} | |
| SIZE=${3:-'1280x720'} | |
| FILENAME=${FILE%%.*} | |
| ffmpeg -i ${FILE} -acodec libvorbis -ac 2 -ab 96k -ar 44100 -b ${BITRATE}k -s ${SIZE} ${FILENAME}.webm | |
| } | |
| makeWebms() { | |
| BITRATE=${1:-'3450'} |
| #!/bin/bash | |
| # Backup a Plex database. | |
| # Author Scott Smereka | |
| # Version 1.0 | |
| # Script Tested on: | |
| # Ubuntu 12.04 on 2/2/2014 [ OK ] | |
| # Plex Database Location. The trailing slash is |