#!/bin/bash

# $_POST["path"]." ".$_POST["name"]
# /HDD/rec/mohammadhossein-1582312671.flv  mohammadhossein
dir=$1
# arrIN=(${dir//-/ })
 DirName="/HDD/playback/"$2
mkdir $DirName
/usr/bin/ffmpeg -y -i $1 -c copy -copyts -movflags +faststart $DirName/$3.mp4
rm $1
/usr/bin/ffmpeg -y -i $DirName/$3.mp4 -vf "thumbnail,scale=640:360" -frames:v 1 $DirName/$3.jpg

#php /hdd/rec/vtt.php $DirName/$3.mp4 $Name $DirName 

#echo $@ > /HDD/rec.txt
#echo ${arrIN[0]} > /HDD/rec2.txt 