I guess there is no pattern

upscaling glitch disco floor

A friend asked me to help her make a video, which was supposed to look like this:

A white square, then one black pixel appears, then another adjoining one, another one; repeat with white pixels as soon as the square’s black. Randomize, goto 10. A simple algorithm, a quick PHP script that would output a series of tiny PNGs. But as soon as I tried to convert the dozens of 5×5px images to a movie (picking the lossless FFV1 codec as intermediate format), and scaling it up with a nearest-neighbor/point filter (up to DVD size), something weird happened: colors appeared from nowhere, even though I was explicitly converting to grayscale.

I ran some more scripts, and it turned out that the colors depend on the scale factor. Here’s an animated gif where every frame was converted with a different scale factor. (take a close look at the edges, they’re more blurred in the beginning, as the scale factor was higher. Ignore the GIF artifacts — click to see the animation and beware, it’s strobey)


I wondered if there was a pattern, so I made a montage. The scale factor decreases left-ro-right, top-to-bottom.

I guess there is no pattern

I tried other combinations of codecs, scale factors and colors, to no success. This “problem” turned out to be limited (as far as I can tell, and remember – I did this some time ago) to

  • really small files
  • the nearest-neighbor/point filter
  • the FFV1 codec
  • an ancient version of MEncoder

vlc http stream glitches

I’m working on a project that utilizes vlc to stream video over http. It’s a pretty straightforward command, it works well & stable. Here’s what I receive:


The artifacts here are normal, it’s just P/B-frames before an I-frame/keyframe comes along (every 250 with h264 by default). They look even nicer, when there’s not much data (movement or noise, that is):


But as soon as I try to set the bitrate, it’s real glitches galore:

I tried Ubuntu’s 2.0.3, compiled 2.0.5 by myself, but the problem is still there. It’s either the low default bitrate (about 400kb/s, I think) – or a custom bitrate that is way over my bandwith, as the glitches go away at >1000kb/s.

The solution workaround I settled on was to use x264 (by the venc parameter), which let’s you set your bitrate without fucking up your bits.

infinite keyint The Happy End - Endscapes