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 | |
| # | |
| # 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 | |
| #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 | |
| #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 |
| 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 |
| <?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"; |
| #!/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 |
On mac:
/usr/local/bin.| #!/bin/bash | |
| ## Install FFMPEG 2.8.6 Ubuntu 16.04 64Bits | |
| ## http://www.linuxpro.com.br/2017/04/compile-ffmpeg-nvenc-ubuntu/ | |
| ## Pacote Compilado no GITHUB: https://github.com/jniltinho/oficinadotux | |
| ## Run as root (sudo su) | |
| ## Check Nvidia ENC | |
| ## nvidia-smi dmon -i 0 | |
| ## Test FFMPEG ENCODER NVENC (FFMPEG 2.8.6 NVIDIA-SDK 6.0.1) |
| #!/bin/bash | |
| cpuinfo > cpuinfo.txt | |
| # ----------------------------------------------------------- | |
| # | |
| # Encodage H264 1080p24 8 bits profil "slower" avec optimisation "grain" | |
| # | |
| # ----------------------------------------------------------- |