#!/bin/bash

FILE1=$1

#to raw
yes | cp -rf $1 input.raw

#to audio
sox -r 22050 -b 8 -c 1 -e signed input.raw audio.wav

#to mp3
ffmpeg -y -i audio.wav -vn -ar 44100 -ac 2 -f mp3 output.mp3

#to video
ffmpeg -y -f rawvideo -s 32x18 -i input.raw video.mp4

#scale up
ffmpeg -y -i video.mp4 -vf scale=320:240 output.mp4

#combine both
#ffmpeg -y -i output.mp4 -i output.mp3 -c copy -map 0:v:0 -map 1:a:0 output_both.mp4
