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

properly remove webp metadata (fixes #43) #44

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

conundrumer
Copy link

A Chrome update added metadata to generated WebP, which caused videos generated by Whammy to be invalid.

@chrahunt describes the fix:

Okay, I figured out the issue. In Whammy here it skips the first 4 bytes of the VP8* chunk, assuming there's no additional metadata. Well now there is, but it isn't what the webp format is expecting. Replacing 4 with webp.data.indexOf('\x9d\x01\x2a') - 3 did the trick (get to the start_code then back up 3 bytes for the frame_tag as detailed here. I did a local test and was able to generate a webm that ffmpeg approved of.

A Chrome update added metadata to generated WebP, which caused videos generated by Whammy to be invalid.

@chrahunt [describes the fix](chrahunt/TagProReplays#78 (comment)):

> Okay, I figured out the issue. In Whammy [here](https://github.com/antimatter15/whammy/blob/a1c8e861a3269387ffac519fe6e96c645efb6686/whammy.js#L192) it skips the first 4 bytes of the VP8* chunk, assuming there's no additional metadata. Well now there is, but it isn't what the webp format is expecting. Replacing `4` with `webp.data.indexOf('\x9d\x01\x2a') - 3` did the trick (get to the `start_code` then back up 3 bytes for the `frame_tag` as detailed [here](https://tools.ietf.org/html/rfc6386#section-19.1). I did a local test and was able to generate a webm that ffmpeg approved of.
@chrahunt
Copy link

On second thought it may be better to just preserve the relevant section of the data here than slice where the frame is actually used. Seems nicer to do the 'parsing' of the webP for consumption by the rest of the extension in parseWebP.

@ataber
Copy link

ataber commented Dec 16, 2016

This fix was required for me to get anything rendering in the exported webm 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants