-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux tweaks #206
base: master
Are you sure you want to change the base?
Linux tweaks #206
Changes from all commits
7af8bc1
5a71093
883ed2f
d5505da
749309e
81400eb
115088f
f9878b4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,16 @@ while [ "${*}" != "" ] ; do | |
shift | ||
|
||
#Confirm input is a video file | ||
if [[ -z $(file -Ib "${INPUT}" | grep video) ]] ; then | ||
echo "Input is not a video file" && continue | ||
unset VIDEOCHECK | ||
if [[ "$(uname -s)" = Darwin ]] ; then | ||
VIDEOCHECK='file -Ib' | ||
elif [[ "$(uname -s)" = Linux ]] ; then | ||
VIDEOCHECK='file -i' | ||
fi | ||
if ! [[ -z ${VIDEOCHECK} ]] ; then | ||
if [[ -z $(${VIDEOCHECK} "${INPUT}" | grep video) ]] ; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. on mac running: I get There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. isn't that because it is using command substitution and attempting to run the output of In the same way that just running On my end, using the command |
||
echo "Input is not a video file" && continue | ||
fi | ||
fi | ||
|
||
IO=$(mktemp) | ||
|
@@ -75,7 +83,7 @@ while [ "${*}" != "" ] ; do | |
|
||
#Create Fingerprint | ||
ffmpeg -f concat -safe 0 -i "${IO}" -vf signature=format=xml:filename="${TEMPFINGERPRINT}" -map 0:v -f null - | ||
xml sel -N "m=urn:mpeg:mpeg7:schema:2001" -t -m "m:Mpeg7/m:DescriptionUnit/m:Descriptor/m:VideoSignatureRegion/m:VSVideoSegment" -v m:StartFrameOfSegment -o ':' -v m:EndFrameOfSegment -o ':' -m m:BagOfWords -v "translate(.,' ','')" -o ':' -b -n "${TEMPFINGERPRINT}" > "${TEMPFINGERPRINT_SORTED}" | ||
xmlstarlet sel -N "m=urn:mpeg:mpeg7:schema:2001" -t -m "m:Mpeg7/m:DescriptionUnit/m:Descriptor/m:VideoSignatureRegion/m:VSVideoSegment" -v m:StartFrameOfSegment -o ':' -v m:EndFrameOfSegment -o ':' -m m:BagOfWords -v "translate(.,' ','')" -o ':' -b -n "${TEMPFINGERPRINT}" > "${TEMPFINGERPRINT_SORTED}" | ||
|
||
#Sort extract relevant values from fingerprint and sort for parsing | ||
(IFS=$'\n' | ||
|
@@ -174,5 +182,5 @@ while [ "${*}" != "" ] ; do | |
done | ||
#Play footage from input for which possible matches were found | ||
if ! [ "${MODE}" = 'text' ] ; then | ||
ffplay -hide_banner -loglevel panic -f concat -safe 0 -i "${VISUALRESULTS}" -vf drawtext=fontcolor=white:box=1:[email protected]:fontsize=20:fontfile="/Library/Fonts/Andale Mono.ttf":textfile="${DRAWTEXT}" | ||
ffplay -hide_banner -loglevel panic -f concat -safe 0 -i "${VISUALRESULTS}" -vf drawtext=fontcolor=white:box=1:[email protected]:fontsize=20:fontfile="${FFMPEGFONTPATH}":textfile="${DRAWTEXT}" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add also here an
with a warning or an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is just a check to see if the input is a video (and throw an error if it isn't) I thought it would be better to attempt to set the variable, but then to skip the video check if the variable was unset (See line 48).
This way, if the person was using an irregular system (but somehow everything else was working) with a valid input it would allow them to proceed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand. Would in this case an
before the line 43 be appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point! I'll add that in!