-
Notifications
You must be signed in to change notification settings - Fork 6
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
framepos.sh script #2
Comments
cool : ) thanks for the bug report
looks like $fps is unset somehow .. ive added some debug prints: could be an issue with for/while loops, bash is a little tricky here another bug: |
Thanks for the quick reply! Here the new output: framepos test.mp4 keyframe.png I also tried to do some debugging using echoes, but some of them won't show up (Like your "echo "found res: $res"" in line 316). Do you know why that is? Thanks again! |
yes
aah, my bad, we need |
Thanks for the hint! Got the echoes to work now and I think I found the problem :) : |
so its working now? the the bug could be in
whats the value of $res?
|
Oh ok. It worked when removing the -e option. Without removing it I get the following output: fps = 60 |
this is bad .. looks like your echo doesnt know the -e option
also, the "found res" line should look more like
so there should be the input image file, and at least one frame image file
this just confirms that $res is empty, which makes sense:
res only contains the input image file could be an issue with your findimagedupes #!/bin/bash
script_include=$(cat <<-'EOF'
VIEW () {
for f in "$@"
do
echo -n "$f"
echo -n "||||"
done
echo
}
EOF
)
# img1.png img2.png should be identic or similar
findimagedupes -t 90 -i "$script_include" img1.png img2.png
# output should be
# img1.png||||img2.png|||| |
So I think your fix works. I get this output: However, if I run the test script you provided (with identical img1 and img2) I get no output at all. |
do you get the same output? "findimagedupes" is ambiguous |
I think I've the correct version. But an old one (got it via "sudo apt install findimagedupes"). This is my output:
Do you think this is an issue? Thanks again for the help! |
youre testing my patience ; ) i did the test with version 2.18 from https://github.com/jhnc/findimagedupes/releases
as expected still, this could be a bug in findimagedupes #!/bin/bash
# download
git clone --depth 1 https://github.com/jhnc/findimagedupes.git
cd findimagedupes
# patch the 'inline directory'
# the value '/tmp' is used on arch linux
sed -i.bak 's/\/usr\/local\/lib\/findimagedupes/\/tmp/' findimagedupes
# verify patch
diff -u findimagedupes.bak findimagedupes
# run test
script_include=$(cat <<-'EOF'
VIEW () {
for f in "$@"
do
echo -n "$f"
echo -n "||||"
done
echo
}
EOF
)
# img1.png img2.png should be identic or similar
echo global version
findimagedupes -t 90 -i "$script_include" img1.png img2.png
echo git version
./findimagedupes -t 90 -i "$script_include" img1.png img2.png
echo git version verbose
./findimagedupes -v md5,fingerprint -t 90 -i "$script_include" img1.png img2.png
# change script - add line #!/bin/sh
script_include=$(cat <<-'EOF'
#!/bin/sh
VIEW () {
for f in "$@"
do
echo -n "$f"
echo -n "||||"
done
echo
}
EOF
)
echo git version script 2
./findimagedupes -t 90 -i "$script_include" img1.png img2.png
# change script - use printf
script_include=$(cat <<-'EOF'
#!/bin/sh
VIEW () {
for f in "$@"
do
printf "%s||||" "$f"
done
printf "\n"
}
EOF
)
echo git version script 3
./findimagedupes -t 90 -i "$script_include" img1.png img2.png
# output should be
# img1.png||||img2.png||||
no output = no matches were found = images should be different (?)
|
Hi!
I would really like to use your framepos.sh script to search for a provided keyframe in a video.
Unfortunately I can't get it to work. Could you maybe help me out?
I'm on Ubuntu 18.04 and installed ffmpeg and findimagedupes via apt.
Then I provided a ~10 min long .mp4 video and a .png keyframe which I extracted from this video and ran the script via "framepos.sh test.mp4 keyframe.png" and the default settings.
I think the script detects the frame but I get an error. My output looks like this:
framepos.sh test.mp4 keyframe.png
fps = 60
dur = 615.570
near T1 = 0
near T2 = -1
exact T2 = 614.5667
extract frames to /tmp/mv-1605621455.frame-%04d.bmp
extract ... 33 81 86 89 92 94 97 99 103
compare 103 frames from /tmp/mv-1605621455.frame-0001.bmp
search for keyframe.png
extract ... 0 48 82 83 90 96 99 101
compare 101 frames from /tmp/mv-1605621455.frame-0104.bmp
search for keyframe.png
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted
match t =
Do you have an idea on how I can get it to work?
best,
Allan
The text was updated successfully, but these errors were encountered: