#!/bin/bash

in_file=""$1""
gst-launch-1.0 filesrc location="$in_file" ! decodebin ! vp8enc threads=3 multipass-mode=1 bitrate=800000 multipass-cache-file=multipass.cache token-parts=1 ! fakesink

gst-launch-1.0 filesrc location="$in_file" ! decodebin name=d webmmux name=m ! filesink location="$in_file.webm" d. ! queue ! vp8enc threads=3 multipass-mode=2 bitrate=800000 multipass-cache-file=multipass.cache mode=vbr auto-alt-ref-frames=1 speed=0 max-keyframe-distance=360 min-quantizer=0 max-quantizer=60 token-parts=1 ! m. d. ! queue ! audiorate tolerance=50000000 ! audioconvert ! audioresample ! audio/x-raw,rate=44100,channels=2 ! vorbisenc ! m.
