Page MenuHomePhabricator

Generation of a WebM video thumbnail on Commons broken
Closed, ResolvedPublic

Description

On https://commons.wikimedia.org/wiki/File:Hym_-_2015-06-25.webm the creation of a thumbnail seems to be broken and the links to the thumbnails in other resolutions produce an error message.

Event Timeline

Pristurus updated the task description. (Show Details)
Pristurus raised the priority of this task from to Low.
Pristurus added a subscriber: Pristurus.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 31 2015, 7:29 PM
Aklapper renamed this task from Generation of a thumbnail broken to Generation of a WebM video thumbnail on Commons broken.
Aklapper set Security to None.
Restricted Application added a subscriber: Steinsplitter. · View Herald TranscriptNov 1 2015, 4:46 PM
$:andre\> wget -vv https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Hym_-_2015-06-25.webm/800px--Hym_-_2015-06-25.webm.jpg--2015-11-01 17:46:33--  https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Hym_-_2015-06-25.webm/800px--Hym_-_2015-06-25.webm.jpg
Resolving upload.wikimedia.org (upload.wikimedia.org)... 91.198.174.208, 2620:0:862:ed1a::2:b
Connecting to upload.wikimedia.org (upload.wikimedia.org)|91.198.174.208|:443... connected.
HTTP request sent, awaiting response... 429 Too Many Requests
2015-11-01 17:47:17 ERROR 429: Too Many Requests.
brion added a subscriber: brion.Nov 2 2015, 2:17 AM
brion added a comment.Nov 2 2015, 2:22 AM

It's a VP9-based file; so one possibility could be that thumbnailing servers have not (all?) received software updates for ffmpeg/libvpx/etc...

brion added a comment.Nov 3 2015, 8:45 PM

Ok, testing in isolation on a vagrant setup.... the thumbnailing via ffmpeg works, but can take like a full minute to create. o_O

If I'm reading output from mkvinfo correctly, it seems to have only 2 keyframes in the entire file -- so it's probably decoding half the file up to the midpoint to get the output frame. :(

Well it is transcoded from a lossless avi by ffmpeg (two pass transcoding) with ""ffmpeg.exe" -i infile -c:v libvpx-vp9 -pass 1 -aspect 16:9 -b:v 12000K -crf 10 -threads 8 -speed 4 -tile-columns 6 -frame-parallel 1 -an -f webm
ffmpeg.exe" -i infile -c:v libvpx-vp9 -pass 2 -b:v 12000K -crf 10 -aspect 16:9 -threads 8 -speed 2 -tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 -an -f webm outfile.webm"
I also used these settings on a few other but shorter (e.g. File:Trichterspinne mit Beute -2015-06-14.webm) uploads. In fact the creation of the thumbnail seems to take a significant longer time than using the vp8 codec.

brion added a comment.Nov 3 2015, 10:43 PM

@Pristurus ok I've found a couple other references to keyframe issues with ffmpeg vp9 output, and am seeing similar behavior on a couple of files I encoded myself as well. I'll try fiddling with the settings and see if I can resolve it by forcing more keyframes...

Note that the file also can't be seeked during playback due to the lack of keyframes. (If you get the vp8 or theora transcodes they seek fine, but the original doesn't)

Thanks for your examination of the problem. Yes, the seeking issue here is also reproducibly . I wish you success in solving the problem!

brion added a comment.Nov 4 2015, 1:16 AM

@Pristurus ok, adding '-g 128' into the ffmpeg command lines fixes both seeking and the thumbnail generation. This forces a keyframe every 128 frames, the same setting we use on our output files. I'm not quite sure why the default is 'no keyframes' ;) but this seems to help!

Fine! As far as I know this parameter is used to set the maximum interval between keyframes. So the real size of intervals will be different from this value. Why do you prefer a value of 128? I think it should depend on the framerate of the input video. Otherwise it will produce in a 60fps file a new keyframe after about 2 seconds and in a 24fps file after about 5 seconds (theoretical maximum).

brion added a comment.Nov 4 2015, 3:25 PM

That's just the value we happen to use, no idea if it was selected with any particular thought. Feel free to use any suitable value.

Okay I have uploaded a new version of the video and thumbnail is created now. Thanks for your help!

brion closed this task as Resolved.Nov 6 2015, 5:04 PM
brion claimed this task.