Topic: Short playtime keeps disappearing

Posted under Site Bug Reports & Feature Requests

I don't know if this is a just me-problem but every time I’m adding tags to short videos the short_playtime keeps disappearing and when I try to add them back it just didn’t save and keep the previous tag history.

Is this an automatic feature? Like how aliased tag automatically change to a different tag even though nobody is changing said tag. If so then there’s must be a mistake somewhere as the wiki says “less than 30 seconds” and I actually use a stopwatch to see if it’s true.

I hope that this bug is not a new feature because there’s no way videos under 30 seconds aren’t short enough.

Donovan DMC

Former Staff

gifs are not videos
gifs do not have a stored duration, so the tag is removed when editing

gifs have a maximum of 20MiB
I don't think that's enough to reasonably go above 30 seconds

snpthecat said:
gifs have a maximum of 20MiB
I don't think that's enough to reasonably go above 30 seconds

if the full thing was 24fps that'd be 720 frames, ~28k per frame. that dosn't sound too unreasonable. although that'd also assume that they animated the entire 30 second thing on 1s, which would be unlikely.

snpthecat said:
gifs have a maximum of 20MiB
I don't think that's enough to reasonably go above 30 seconds

Improbable, but not impossible.

For example, the gif in post #2967592 has a duration of 1:45 and post #2938543 has a duration of 0:40.
(At least these are the values that FFPROBE spits out)

As a sidenote:
I found these while searching for gifs in order of descending duration.
Seems the site stores duration information for some gif posts.
This seems to affect all posts that were originally webm files, which later got replaced with a gif. Example 1 Example 2
Even after the replacement, these posts retain the duration information.
I don't think that's intentional.

Donovan DMC

Former Staff

snedmano said:
Seems the site stores duration information for some gif posts.
This seems to affect all posts that were originally webm files, which later got replaced with a gif. Example 1 Example 2
Even after the replacement, these posts retain the duration information.
I don't think that's intentional.

It's definitely a bug, it's probably as simple as not clearing the field (if the duration matches the old video), or mismatched checks resulting in actually saving the duration of the gif (the same method used for getting video duration does work on gifs, so if a gif manages to get there it will return a valid value) for example calculating the duration with the gif file while the post still has the webm extension, causing it to think it's still a video

donovan_dmc said:
It's definitely a bug, it's probably as simple as not clearing the field (if the duration matches the old video), or mismatched checks resulting in actually saving the duration of the gif (the same method used for getting video duration does work on gifs, so if a gif manages to get there it will return a valid value) for example calculating the duration with the gif file while the post still has the webm extension, causing it to think it's still a video

Why not include that information for all animated gif / png posts then? I don't see any harm in that.

Aacafah

Moderator

We'd have to add bespoke duration calculations for that instead of just reading the metadata. Not a huge deal or anything, but it is extra work. I'll forward this internally.

Ok it’s been 3 months now and it’s still disappearing, is it because GIFs aren’t countable in terms of playtime? If so then how do the tag came to be if it’s not "short" in the first place. Can anyone please give me a definitive answer

aacafah said:
We'd have to add bespoke duration calculations for that instead of just reading the metadata. Not a huge deal or anything, but it is extra work. I'll forward this internally.

Is it still going?

Aacafah

Moderator

whatismyname1234 said:
Ok it’s been 3 months now and it’s still disappearing, is it because GIFs aren’t countable in terms of playtime? If so then how do the tag came to be if it’s not "short" in the first place. Can anyone please give me a definitive answer

We already told you.

donovan_dmc said:
gifs are not videos
gifs do not have a stored duration, so the tag is removed when editing

To be more specific, we calculate a duration value for videos. Even though we only actually calculate it for videos, every single post has a space for it regardless of type; you can see this in the API response for my non-animated pfp, where it has a value of null. This tag is intended for use with videos, which do calculate & store a value for this duration field, & therefore can be determined to be greater than or less than 30 seconds. Additionally, we always check if a post is a video before allowing this tag to be included, at least currently; it appears that wasn't always the case previously, but it clearly is now, as you can see below.

Btw, you can't & shouldn't bother manually adding this tag; it does nothing.

Here is our automatic tag function that's called every time you edit the tags.

def add_automatic_tags(tags)
      return tags unless Danbooru.config.enable_dimension_autotagging?

      tags -= %w[thumbnail low_res hi_res absurd_res superabsurd_res huge_filesize wide_image tall_image long_image flash webm mp4 long_playtime short_playtime]

      ...
      tags << "long_playtime" if is_video? && duration >= 30
      tags << "short_playtime" if is_video? && duration < 30
      ...
    end

As you can see, we always remove the long_playtime & short_playtime tags (among others) from the list of tags, whether or not they were there to begin with, & we only (re)add them if the post is_video? & duration >= 30/duration < 30 respectively. It doesn't matter if the user adds it or not, we'll still make our own determination on whether or not it should be there automatically.

whatismyname1234 said:
Is it still going?

Tl;dr We haven't had a chance to look into it yet & I can't make promises about when we will; "not a huge deal" in terms of implementation doesn't mean it's quick or trivial to get running on the site.

Details

At least 2 of the 4 volunteer devs have full-time jobs, & this is far from the top of our list of priorities. We haven't gotten to it, & we may never do so. To give you a better idea of what goes into what might at first seem like a minor change, we haven't had the time to

  • discuss whether or not we want to implement this in the first place
  • investigate the specifications for the Graphic Interchange Format & the Animated Portable Network Graphics extension to the Portable Network Graphics format
  • use that info to make functions that calculate consistent & correct conversions from frame count to duration in seconds
  • implement that to the code
  • manually test it to make sure it does what it's supposed to
  • add the proper unit tests to ensure this doesn't break anything & to catch future changes that would break this
  • add a database fixer to manually update all of the preexisting GIF & APNG posts with their duration & proper duration-related auto tags
  • manually test the fixer to make sure it does what it's supposed to
  • add the proper unit tests to ensure the fixer doesn't break anything
  • have our lead dev review the suggested changes to make sure everything's correct & integrate those changes to the rest of the code
  • finally have our lead dev prepare a release package to go live on the server

I personally haven't found the time for this yet, especially when I have to do much of this process for far more pressing issues and I can only work on this when I'm not at my full-time job or dealing with personal matters, which, tbh, I'm already neglecting for my work on the site. Our lead dev has also been so busy they've had to miss at least 1 weekly update.

Again, I don't want this to come off as rude or anything, I just want you to have realistic expectations. I hate letting people down, so I don't want you waiting with bated breath or something.

I'm not saying it's never gonna happen, but it's far from a priority & we already have overflowing to-do lists. The site is open-source, & this would be a wonderful first contribution if anyone wants to give it a try, but until then, the only answer I can give you is "we'll get to it when we get to it".