-
Notifications
You must be signed in to change notification settings - Fork 256
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
File path gets altered somewhere #16
Comments
weird. What does this give you?
|
|
oh right, how about
are there any errors for the 00 and 01 galleries? |
Hmmm, nope 😞
|
It seems to happen after a video file. If I remove files 260 and 261 from gallery 002, it happens at 284 which is after 280 (a video).
|
Not finished yet (encoding right now), but when I remove file 284 from gallery 02 as well, it works. So maybe just "bad" video files? Because I have some more videos… |
hmm.. the problem is that these paths are wrong, probably not related to the files themselves. Even if the video -> still frame conversion fails, I don't see how it's affecting the next iteration of the loop.. here's a small test program. Save it anywhere and try to execute in the shell:
|
Heh, there it is again. See
|
alright, getting closer. How about just:
|
Nope, sorry.
|
ok, then:
|
Works for all videos (260, 261, 280). |
hm.. definitely something strange there. try this:
|
Thanks for your patience, man! Leading slash gets stripped.
|
I have patience in abundance : ] yeah, some of those paths don't have a leading /, I'm not sure what could be causing that. If you run that test script multiple times, are they always the same ones that are missing the /? what if you remove the "| sort" from the end of
|
Aside from the fact that they are all videos I copied from my Android phone via Airdroid it seems pretty much random. Edit: It seems more like the path name itself is contaminated. Whichever file (content does not matter) starts with the bad path name is determined erroneous by the test script. |
I think I've replicated this on my mac, but for me it only errors when there are both .webm and .mp4 files in the same directory. (just mp4 or just webm, with the same files, gives no errors) definitely very strange.. |
Hmm, I don't have any webm's. For me the issue seems to be where the filename is in the list. I have one folder where even items are consistently broken. Consider:
2 and 4 are kaputt.
Now 1 and 3 are kaputt. |
Order seems to matter on my end too, but it's every 3 files. If I have just a folder of mp4s the error also doesn't occur |
What I also don't understand is why the path is "damaged" only after invoking |
yeah I don't get it either. It's not even related to the files, merely invoking the ffmpeg decoder causes the error. |
ok, so the problem seems to be that ffmpeg is eating the input somehow. Adding -nostdin to the ffmpeg command fixes it on my end. I pushed a commit that should fix this issue, try it again now : ] |
Hm, not for me 😞
But it does fix our test, running this on 02 gallery (or the whole folder with adjusted #!/bin/bash
dir="/Users/npiccolotto/Desktop/gallery/02 Death Valley"
while read file
do
filename=$(basename "$file")
extension=$(echo "${filename##*.}" | tr '[:upper:]' '[:lower:]')
if [ "$extension" = "mp4" ]
then
# any errors here?
ffmpeg -nostdin -loglevel error -y -i "$file" -vframes 1 -qscale:v 2 test.jpg
fi
if [ "$extension" = "jpg" ]
then
# any errors here?
identify -format "%wx%h\n" "$file"
fi
echo "$file"
done < <(find "$dir" -maxdepth 1 ! -path "$dir" ! -path "$dir*/_*" | sort)
|
can't reproduce at the moment, so it'll be a bit tough again. But what if you replaced this line:
with
does it output a truncated path still? Are there any truncated paths from subsequent commands/errors? |
Okay, I tracked it down to this line (~350):
If I comment the format detection out and instead rely on the file extension, it works. |
thanks for doing the legwork. It's election day here but I'll have a look when I get back. identify shouldn't have the same issue ffmpeg did, not sure what could be causing this one. |
we're trusting the file extensions anyways, so I just removed that line |
Yay 🎉 |
Sorry, I'd like to fix this myself, but I'm not proficient in bash scripting.
Happens with and without draft mode reliably at this file. It is the second video file expose.sh encounters. Anyways,
piccolotto/Desktop/gallery
should be/Users/npiccolotto/Desktop/gallery
. Same goes forrs/npiccolotto/Desktop/gallery
. Not sure if the other errors are caused by the wrong path.I'm running on OSX 10.10.2. Happens with zsh and bash.
The text was updated successfully, but these errors were encountered: