Constantly resizing .webm file
Asked Answered
E

1

8

I've been messing with webm file headers (messing with the header data for file length etc.) and in the process I stumbled upon a webm that behaves weirdly. I reuploaded it here on webmshare. It constantly resizes itself which makes it hard to impossible to close/pause it. The same behavior can be observed with vlc media player and mpv player. It still does this on discord, but the player itself doesn't rescale, just the image does.

After some digging I found the apparent source of the .webm, a youtube video by the creator youtube link here.

This leads to my suspicion and explains the relatively large filesize of the original webm:

Apparently a command to change the webm size/aspect ratio is given between every frame of the webm. The original creator seems to add this programmatically between frames.

Now to my question:

How does this happen? What information is being added to change the aspect ratio while playing? Where is it added and how? Is it a HEX value edit or something else?

Any hints towards where to look or explanations are much appreciated!

Exuviate answered 30/12, 2020 at 1:11 Comment(2)
"How does this happen?" who wants a bug as a feature?? What good can come from this?Jamille
@Jamille Well personally I consider it fun. The same way that abusing bad implementation of png gAMA chunks is a creative way to steganographically hide images in others without needing software to decode it. Obviously it's silly, but it's fun.Exuviate
E
15

I stopped researching for this question, but recently (and entirely by accident) stumbled over the solution, and it's a bit more boring than one might think. It's not about trickery with file headers or anything, just plain old editing:

  • First the video is chopped into parts. Each of these parts is generated with a different aspect ratio. (This can be done with ffmpeg for example).
  • Then these parts are concatenated together again to form a single video file, with the first part having a aspect ratio of 1:1 to make the file look normal in previews. (Again, ffmpeg has a concat function)
  • Then the audio of the original file (which is lost during the process of chopping the video in parts and concatenating it again) is copied into this new file.

So it's "just" a bunch of videos with different aspect ratios, stitched together.

Exuviate answered 12/1, 2021 at 21:48 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.