Currently the demo loads the entire .webm file containing frames up to 4x resolution, seeking to the frame with the target density. Eventually I'll try repacking the frames into separately loadable files which can be fed into Media Source Extensions or decoded via JavaScript... That should prevent buffering of unused high resolution frames.
Some issues:Changing resolutions always forces a keyframe unless doing single-pass encoding with frame lag set to 1. This is not super obvious, but is neatly enforced in encoder_set_config in vp9_cx_iface.h! Use --passes=1 --lag-in-frames=1 options to vpxenc.
Keyframes are also forced if width/height go above the "initial" width/height, so I had to start the encode with a stub frame of the largest size (solid color, so still compact). I'm a bit unclear on whether there's any other way to force the 'initial' frame size to be larger, or if I just have to encode one frame at the large size...
There's also a validity check on resized frames that forces a keyframe if the new frame is twice or more the size of the reference frame. I used smaller than 2x steps to work around this (tested with steps at 1/8, 1/6, 1/4, 1/2, 2/3, 1, 3/2, 2, 3, 4x of the base resolution).
I had to force updates of the golden & altref on every frame to make sure every frame ref'd against the previous, or the decoder would reject the output. --min-gf-interval=1 isn't enough; I hacked vpxenc to set the flags on the frame encode to VP8_EFLAG_FORCE_GF | VP8_EFLAG_FORCE_ARF.
I'm having trouble loading the VP9 webm files in Chrome on Android; I'm not sure if this is because I'm doing something too "extreme" for the decoder on my Nexus 5x or if something else is wrong... Is there any way I can do a validity check on my encoded frames?
-- brion vibber (brion @ pobox.com / brion @ wikimedia.org)
--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.
To post to this group, send email to webm-d...@webmproject.org.
Visit this group at https://groups.google.com/a/webmproject.org/group/webm-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/d/optout.
Hi Brion,Thanks for looking at all of these technologies!I ran some somewhat similar testsbut for a different reason. My tests centered around when it is better quality wise to encode scalable keyframes rather than a single frame. An image encoded at 1920x1080p but at a very high quantizer - often looks and is measurably worse on metrics like ssim, than a frame encoded at lower resolution and scaled up with a residual to catch any egregiously bad stuff.
I'll try and respond to your issues in line:Currently the demo loads the entire .webm file containing frames up to 4x resolution, seeking to the frame with the target density. Eventually I'll try repacking the frames into separately loadable files which can be fed into Media Source Extensions or decoded via JavaScript... That should prevent buffering of unused high resolution frames.Decoded via Javascript would be kind of a shame but certainly would give you a lot of control over things like container format and avoid any issues you might have with the way chrome / et al handle video ( eg autoplay on android) vs images. That said it will be a lot slower and big images might take a long time to load.
Some issues:Changing resolutions always forces a keyframe unless doing single-pass encoding with frame lag set to 1. This is not super obvious, but is neatly enforced in encoder_set_config in vp9_cx_iface.h! Use --passes=1 --lag-in-frames=1 options to vpxenc.When I played with it I had similar issues. The way the codec handles lag and messages you send it is a bit weird.Could you file a bug with exactly what you tried here: https://bugs.chromium.org/p/webm/issues/list
Keyframes are also forced if width/height go above the "initial" width/height, so I had to start the encode with a stub frame of the largest size (solid color, so still compact). I'm a bit unclear on whether there's any other way to force the 'initial' frame size to be larger, or if I just have to encode one frame at the large size...See this bug:I actually used libvpx's internal scaling to do the down scale and thus avoided that problem.I think this is different so please file another bug. I'm guessing you did the scaling external to libvpx and that we don't provide a great way for you to pass in the maximum original size when doing it that way.
There's also a validity check on resized frames that forces a keyframe if the new frame is twice or more the size of the reference frame. I used smaller than 2x steps to work around this (tested with steps at 1/8, 1/6, 1/4, 1/2, 2/3, 1, 3/2, 2, 3, 4x of the base resolution).Yes because our internal scalers won't work in the case that you go outside our viable range.
5.16 Reference frame scaling
It is legal for different decoded frames to have different frame sizes (and aspect ratios). VP9 automatically handles resizing predictions from reference frames of different sizes.
However, reference frames must share the same color depth and subsampling format for reference frame scaling to be allowed, and the amount of up/down scaling is limited to be no more than 16x larger and no less than 2x smaller (e.g. the new frame must not be more than 16 times wider or higher than any of its used reference frames).
| static INLINE int valid_ref_frame_size(int ref_width, int ref_height, | ||
| int this_width, int this_height) { | ||
| return 2 * this_width >= ref_width && | ||
| 2 * this_height >= ref_height && | ||
| this_width <= 16 * ref_width && | ||
| this_height <= 16 * ref_height; | ||
| } |
I had to force updates of the golden & altref on every frame to make sure every frame ref'd against the previous, or the decoder would reject the output. --min-gf-interval=1 isn't enough; I hacked vpxenc to set the flags on the frame encode to VP8_EFLAG_FORCE_GF | VP8_EFLAG_FORCE_ARF.Yes on its own the codec will surely do the wrong thing.
I'm having trouble loading the VP9 webm files in Chrome on Android; I'm not sure if this is because I'm doing something too "extreme" for the decoder on my Nexus 5x or if something else is wrong... Is there any way I can do a validity check on my encoded frames?Currently shipped versions of chrome pass all video tags through to the android operating system ( in m52/m53 this changes). Unfortunately in android there are issues with changing framesizes on non keyframes which get in the way of this.