for file in *.ts; do
if [ -f "$file" ]; then
echo "Converting '$file'..."
ffmpeg -nostdin -i "$file" -c copy "${file%.ts}.mp4" && rm -f "$file"
echo "Successfully converted '$file' and removed the original."
echo "--------------------------------------------------------"
fi
done