#!/bin/bash
ffmpeg -y -strict experimental -i lego.mkv -threads 0 \
  -acodec libfaac -ab 64k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level:v 3.0 \
    -x264opts "fps=12:keyint=36:bitrate=200" -s 416x234 bbb.mpegts/stream_200.mp4 \
  -acodec libfaac -ab 64k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level:v 3.0 \
    -x264opts "fps=15:keyint=45:bitrate=400" -s 480x270 bbb.mpegts/stream_400.mp4 \
  -acodec libfaac -ab 64k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level:v 3.0 \
    -x264opts "fps=23.976:keyint=90:bitrate=600"  -s 640x360 bbb.mpegts/stream_600.mp4 \
  -acodec libfaac -ab 96k -ac 2 -ar 48000 -vcodec libx264 -vprofile baseline -level:v 3.1 \
    -x264opts "fps=23.976:keyint=90:bitrate=1200" -s 640x360 bbb.mpegts/stream_1200.mp4 \
  -acodec libfaac -ab 96k -ac 2 -ar 48000 -vcodec libx264 -vprofile main -level:v 3.1 \
    -x264opts "fps=23.976:keyint=90:bitrate=3500" -s 960x540 bbb.mpegts/stream_3500.mp4 \
  -acodec libfaac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -vprofile main -level:v 3.1 \
    -x264opts "fps=23.976:keyint=90:bitrate=5000" -s 1280x720 bbb.mpegts/stream_5000.mp4 \
  -acodec libfaac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -vprofile main -level:v 3.1 \
    -x264opts "fps=23.976:keyint=90:bitrate=6500" -s 1280x720 bbb.mpegts/stream_6500.mp4 \
  -acodec libfaac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -vprofile high -level:v 4.0 \
    -x264opts "fps=23.976:keyint=90:bitrate=8500" -s 1920x1080 bbb.mpegts/stream_8500.mp4
  