I'm trying to write my first semi advanced bash script that will take input in the form of a filename referring to an avi
video, send it to ffmpeg
to convert to a mp4
(preserving the original name) and then hand it off to MP4Box
.
The below is pretty much what I'm doing...
#!/usr/bin/bash
ffmpeg -i $0 -acodec libfaac -ab 128k -ac 2 -vcodec libx264 -vpre hq -crf 22 -threads 0 ($0).mp4
MP4Box -inter 500 ($0).mp4
- Is there some sort of try/catch I can do for the first program invocation to make sure MP4Box gets workable input?
- Should I even bother with error catching at all, should I instead rely on the programs themselves to do this for me?