aidandenlinger / SnapchatMemoriesCaptionAdder

Adds metadata (captions and timestamps) to your exported Snapchat memories.
MIT License
23 stars 4 forks source link

Bugged Metadata Video Output #9

Open aidandenlinger opened 5 months ago

aidandenlinger commented 5 months ago

I was able to isolate this bug. It depends upon a handful of bugged videos, around 3 out of 1500.

If the program encounters one of these videos when in the final stages of processing, all other videos saved to output before this encounter have the correct metadata however, any videos encountered after will have no metadata (e.g. timestamp set to present). Additionally, this bugged input video will not be saved to the output folder itself. My three encounters with videos like these seem to be clustered around mid-2020.

Here is the traceback:

Waiting for final videos...
100%|██| 1/1 [00:00<00:00,  8.73it/s]
Traceback (most recent call last):
File "/Users/jonathanxakellis/Documents/Snapchat/SnapchatMemoriesCaptionAdder/main.py", line 120, in <module>
main()
File "/Users/jonathanxakellis/Documents/Snapchat/SnapchatMemoriesCaptionAdder/main.py", line 114, in main
add_file_creation(path, metadata)
File "/Users/jonathanxakellis/Documents/Snapchat/SnapchatMemoriesCaptionAdder/SnapchatMemoriesCaptionAdder/adder.py", line 105, in add_file_creation
assert output.exists()
AssertionError

Originally posted by @jxakellis in https://github.com/aidandenlinger/SnapchatMemoriesCaptionAdder/issues/7#issuecomment-2184517773

aidandenlinger commented 5 months ago

@jxakellis Thanks for isolating what's causing this! Helps me out a lot.

I believe I understand the effect:

But, the thing I thought was impossible is clearly possible. I'll update the code so instead of crashing, it'll emit a warning (with some useful information) and continue going. This ensures that all the videos that can get metadata will get metadata, we'll log info about the bugged videos, and then it'll be easier to figure out the cause of what's going wrong.

I'll update this thread once I change the code, should be pretty quick.

aidandenlinger commented 5 months ago

Ok, I updated the code in 24b986c, it'll print a warning for any files it can't find and continue on. Feel free to git pull or redownload the script and we can see what the output is and try to determine what's bugged about these files.