Skip to content
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

Bugged Metadata Video Output #9

Open
aidandenlinger opened this issue Jun 23, 2024 · 2 comments
Open

Bugged Metadata Video Output #9

aidandenlinger opened this issue Jun 23, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@aidandenlinger
Copy link
Owner

aidandenlinger commented Jun 23, 2024

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 #7 (comment)

@aidandenlinger
Copy link
Owner Author

aidandenlinger commented Jun 23, 2024

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

I believe I understand the effect:

  • Adding metadata to the files happens at the very end of the script, after all the videos are converted. It goes one at a time.
  • The AssertionError is there to assert that something impossible won't happen. The script will completely quit and stop doing any work if the assertion is wrong.
  • So, when the AssertionError happens, it completely quits. Any videos that were supposed to get metadata after the bugged video don't get any metadata.

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
Copy link
Owner Author

aidandenlinger commented Jun 23, 2024

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.

@aidandenlinger aidandenlinger added the bug Something isn't working label Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant