Skip to content

Commit

Permalink
Add simple error checking for steps that create necessary files
Browse files Browse the repository at this point in the history
  • Loading branch information
nekno committed Jul 24, 2023
1 parent 3a6469f commit 06c9d39
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/DV7toDV8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,30 @@ do

echo "Demuxing DV7 BL+EL+RPU HEVC from MKV..."
"$mkvextractPath" "$mkvFile" tracks 0:"$mkvBase.DV7.BL_EL_RPU.hevc"

if [[ $? != 0 ]] || [[ ! -f "$mkvBase.DV7.BL_EL_RPU.hevc" ]]
then
echo "Failed to extract HEVC track from MKV. Quitting."
exit 1
fi

echo "Demuxing DV7 EL+RPU HEVC..."
"$doviToolPath" demux --el-only "$mkvBase.DV7.BL_EL_RPU.hevc" -e "$mkvBase.DV7.EL_RPU.hevc"

if [[ $? != 0 ]] || [[ ! -f "$mkvBase.DV7.EL_RPU.hevc" ]]
then
echo "Failed to demux EL+RPU HEVC file. Quitting."
exit 1
fi

echo "Converting DV7 BL+EL+RPU to DV8 BL+RPU..."
"$doviToolPath" --edit-config "$jsonFilePath" convert --discard "$mkvBase.DV7.BL_EL_RPU.hevc" -o "$mkvBase.DV8.BL_RPU.hevc"

if [[ $? != 0 ]] || [[ ! -f "$mkvBase.DV8.BL_RPU.hevc" ]]
then
echo "File to convert BL+RPU. Quitting."
exit 1
fi

echo "Deleting DV7 BL+EL+RPU HEVC..."
rm "$mkvBase.DV7.BL_EL_RPU.hevc"
Expand Down

0 comments on commit 06c9d39

Please sign in to comment.