Atomic I/O letters column #143

Originally published 2013, in PC & Tech Authority
(in which Atomic magazine is now a section)
Reprinted here July 13, 2013
Last modified 16-Jan-2015.
 

It seeks to here, but not to there

Why can't you seek around in some online videos?

You seem to be to go to any part of a YouTube video by clicking the timeline thing at the bottom, but half of the time when I try this on different video sites - like LiveLeak, for instance - clicking on the timeline just takes you back to the beginning of the video. It works on some other videos on LiveLeak, though.

If I use FVD Video Downloader to download a no-seeking LiveLeak video to my computer and then play it in Media Player Classic or VLC Player, I can seek then. Just not online.

This isn't the end of the world, but I'd still like to know why it happens.

Rick

Answer:
This has to do with the two basic kinds of frames in digital video: "I", for "intra-coded", also known as "key" frames, and "P", for "predicted", also known as "delta" frames.

An I-frame is just an image, complete unto itself. A video can be composed of nothing but I-frames, in which case it behaves in the way you'd expect it to, like a strip of analogue movie film made of sequential images.

Most videos have a lot more P-frames than I-frames, though. P-frames are not a whole image. To simplify, they're just the changes that need to be made to turn the previous frame of video into this new one. Since most frames of most videos are similar to the frame preceding, P-frames can be much smaller than I-frames. They're essential to all lossy video compression, from YouTube to Blu-Ray. Even animated GIFs can use delta compression!

A simple video player, however, can't just seek to a P-frame and start playing - well, not without weird distortion effects, anyway. When you seek in a video and everything's smeared and grey and weird, that's because you told the player to start from a P-frame, and it applied that frame's modification recipe not to actual video frames before it, but to no image data at all.

A lot of freaky animation glitches, like this...

...are the result of faulty encoding or data corruption which removes most or all of one or more I-frames, leaving the P-frames modifying data from previous P-frames. The really extreme examples, like the one above, may be created deliberately. (Just loading an animation file into a hex editor and randomly typing on some data can create effects like this.)

A video-player can avoid these problems by, when you click somewhere on a video file's seek bar, taking where you clicked and then rewinding the video back to the nearest I-frame, and playing from there instead. That gives a proper starting point and avoids the smeary distortion. But if the only I-frame in the whole video is frame number one, you get the behaviour you've been seeing, where trying to seek anywhere in the video just takes you back to the start.

(You don't see this behaviour on YouTube, because YouTube videos are re-encoded to give them plenty of I-frames, even if the original uploaded file didn't have many.)

When you download the video and can seek around in it using a normal video-playing program, that's because the video-player silently zips back from where you clicked to the last I-frame, just as the online player does, but then takes advantage of its much faster access to the video data on your local computer. It invisibly "plays" the video at maximum possible speed up to the point where you clicked, and then starts playing normally. This can take only a fraction of a second for low-res video on a hard drive; you may still see a noticeable pause, though, if the video's high-definition.

Even a low-res video can't be surreptitiously fast-played in this way if it's at the end of a lengthy Internet tube, though; it'll get there eventually, but not without a lengthy pause resembling a program crash or lost connection. So the player instead just goes back to the last I-frame and plays normally from there, instead of doing the same thing invisibly in the background until it gets to the point in the video you actually asked for.

It's of course actually more complex than this. P-frames can be built from more than one preceding frame, for instance. And there are also "B" frames, which are "bi-predictive" - they're constructed by modifying frames before and after them. But just the basic idea of I and P frames explains a lot of online-video weirdness.

(I've written a bit about this before, in this piece from way back in 1997 and this one from '96. A lot of the stuff in those ancient articles is still surprisingly relevant today.)

 

Stroke it and call it a good battery

The battery in my old big laptop (Dell Inspiron 9300) is weird. It's the original battery the laptop came with so you'd expect it to be dead by now, and it normally only gives about 5 minutes of run time. But if I remove the battery with the laptop running from the mains adapter, and let the battery sit for a few minutes, then put it back in, I get a whole 15 or 20 minutes of run time.

This is actually enough for me, since I use the laptop as a home computer and only need the battery to ride out brief blackouts or be able to take the laptop when I go to the bathroom or whatever. I realise I'm going to have to lever open the wallet and buy a proper new battery pretty soon, but why does sitting the battery on a table do any good at all?

Marcus

Underside of Inspiron 9200
Swap it all around, and remember, a rubber mallet eases installation!

Answer:
Chemical batteries of all sorts, from AA alkalines to car batteries, will normally "bounce back" while unloaded. Draw a lot of current out of a battery and its terminal voltage and current delivery capacity will fall; stop drawing current and the battery's specs will start to drift back up toward the nominal values again.

Also, the chemical reactions in batteries work better when the battery is warm. The extreme case is using batteries, especially ones with a water-based electrolyte, in sub-zero temperatures; Alpine photographers keep spare batteries in their inside pockets. Warmth works for other batteries as well, though; if your remote control or torch or nose-hair clipper isn't quite working and you don't have any new batteries, removing the batteries and warming them in your hands will help.

Neither of these cases probably applies to you, though. Your battery shouldn't be supplying the laptop with power when the mains adapter is plugged in, and the laptop's charging circuit probably isn't doing anything weird that the battery appreciates a rest from, either. And removing a battery from a laptop will, if anything, cool the battery down, not warm it up.

So what I'd bet on is that your old laptop and old battery just have a bit of corrosion on the copper contacts on the battery and in the battery bay. Remove and replace the battery and you rub a bit of oxide off the copper, giving less contact resistance and a little more oomph. To clean the contacts properly, try a pen eraser or similar mild abrasive.

(For everyday cylindrical batteries, you can clean the contacts a little by just spinning the batteries in their compartment. This is another remote-control-fixing ritual that often works.)

 

Them! Theeeem!

My uncle and aunt went away for a big two month holiday, and when they came back their PC didn't work any more. All they knew was that it made "a really strange noise", and they gave it to me to fix.

On startup the hard drive DID make a strange noise, then the computer failed to POST with a drive error, so I opened it up.

ANTS. EVERYWHERE.

I don't really DO insects, which makes life difficult here in Queensland. So I, I believe it's called "noped", right out of there and my girlfriend who is much braver than me pulled the computer apart and opened the hard drive with a hex key and reported that the drive itself had ants, or termites or whatever, IN IT.

(I'm very sorry that neither of us took a picture before throwing all the infested stuff in a vat of Alien blood.)

The computer actually came good again with a lot of cleaning and a new hard drive, and now that I've stopped screaming I come to my actual question:

How did ants get INSIDE A HARD DISK?! Aren't those things meant to be hermetically sealed?

Seth

Answer:
Hard drives aren't actually sealed. This is mainly so that changes in atmospheric pressure, and the substantial change in internal air temperature between when the drive's off and when it's running, don't squeeze or expand the casing.

Instead, drives have a small vent somewhere, with a dense filter in it. The "flying height" of a modern hard drive's read/write head over the platter is only about three nanometres, which means even a particle of smoke can be big enough to wedge between platter and head and cause damage. In normal use, the filter keeps the air inside a drive as pure as the air in the clean-room where the drive was assembled.

Those filters aren't particularly durable, though, and I think they're all made of cellulose acetate. So I could see ants or, especially, termites, chewing through the filter just because they think it's edible, and/or because they want to extend their colony into the drive.

(I've heard it said that hard drives are not only sealed, but evacuated inside, to eliminate air friction. This is completely wrong, and impossible. Drive heads need an air cushion to allow them to float over the platters, and will crash and die if the air pressure is too low; problems start to arise above a pressure altitude of about 2500 metres. This is one of the considerations involved in making computers work in space.)

 

The Wayward Pointer

I've got a ThinkPad T60, with both a TrackPoint joystick and a touchpad for controlling the cursor, and one or both of them seems to be defective. Sometimes but not always the cursor quivers around randomly, and left-clicks without me telling it to.

This is very frustrating. I've tried disabling each of the built in pointing devices, or both of them and using a USB mouse, and the jiggling and clicking keeps happening. Even in (Windows 7) safe mode!

Help!

Cara

Answer:
Cara and I corresponded over this for a couple of days, until we reached the breakthrough that Cara's odd cursor behaviour only happened in the living room, bathroom and kitchen. All of which were close to a particular cupboard, which contained... a wireless keyboard, with random junk piled on it.

That cheap "multimedia keyboard" that Cara had forgotten about had its own tiny trackball and mouse buttons, and a teeny tiny USB receiver that Cara forgot was even plugged into the ThinkPad. With the receiver removed, the problem was solved.

I naturally instructed Cara to keep that keyboard and its stealth receiver handy, for whenever someone appeared to deserve a computer-poltergeist experience. With a USB-header breakout cable, you could even install the receiver inside a PC...

 

Other letters columns

I/O #1
I/O #2
I/O #3
I/O #4
I/O #5
I/O #6
I/O #7
I/O #8
I/O #9
I/O #10
I/O #11
I/O #12
I/O #13
I/O #14
I/O #15
I/O #16
I/O #17
I/O #18
I/O #19
I/O #20
I/O #21
I/O #22
I/O #23
I/O #24
I/O #25
I/O #26
I/O #27
I/O #28
I/O #29
I/O #30
I/O #31
I/O #32
I/O #33
I/O #34
I/O #35
I/O #36
I/O #37
I/O #38
I/O #39
I/O #40
I/O #41
I/O #42
I/O #43
I/O #44
I/O #45
I/O #46
I/O #47
I/O #48
I/O #49
I/O #50
I/O #51
I/O #52
I/O #53
I/O #54
I/O #55
I/O #56
I/O #57
I/O #58
I/O #59
I/O #60
I/O #61
I/O #62
I/O #63
I/O #64
I/O #65
I/O #66
I/O #67
I/O #68
I/O #69
I/O #70
I/O #71
I/O #72
I/O #73
I/O #74
I/O #75
I/O #76
I/O #77
I/O #78
I/O #79
I/O #80
I/O #81
I/O #82
I/O #83
I/O #84
I/O #85
I/O #86
I/O #87
I/O #88
I/O #89
I/O #90
I/O #91
I/O #92
I/O #93
I/O #94
I/O #95
I/O #96
I/O #97
I/O #98
I/O #99
I/O #100
I/O #101
I/O #102
I/O #103
I/O #104
I/O #105
I/O #106
I/O #107
I/O #108
I/O #109
I/O #109
I/O #110
I/O #111
I/O #112
I/O #113
I/O #114
I/O #115
I/O #116
I/O #117
I/O #118
I/O #119
I/O #120
I/O #121
I/O #122
I/O #123
I/O #124
I/O #125
I/O #126
I/O #127
I/O #128
I/O #129
I/O #130
I/O #131
I/O #132
I/O #133
I/O #134
I/O #135
I/O #136
I/O #137
I/O #138
I/O #139
I/O #140
I/O #141
I/O #142
I/O #143
I/O #144
I/O #145
I/O #146
I/O #147
I/O #148
I/O #149
I/O #150
I/O #151
I/O #152
I/O #153
I/O #154
I/O #155
I/O #156
I/O #157
I/O #158
I/O #159
I/O #160
I/O #161
I/O #162
I/O #163
I/O #164
Dan's Data letters #1
Dan's Data letters #2
Dan's Data letters #3
Dan's Data letters #4
Dan's Data letters #5
Dan's Data letters #6
Dan's Data letters #7
Dan's Data letters #8
Dan's Data letters #9
Dan's Data letters #10
Dan's Data letters #11
Dan's Data letters #12
Dan's Data letters #13
Dan's Data letters #14
Dan's Data letters #15
Dan's Data letters #16
Dan's Data letters #17
Dan's Data letters #18
Dan's Data letters #19
Dan's Data letters #20
Dan's Data letters #21
Dan's Data letters #22
Dan's Data letters #23
Dan's Data letters #24
Dan's Data letters #25
Dan's Data letters #26
Dan's Data letters #27
Dan's Data letters #28
Dan's Data letters #29
Dan's Data letters #30
Dan's Data letters #31
Dan's Data letters #32
Dan's Data letters #33
Dan's Data letters #34
Dan's Data letters #35
Dan's Data letters #36
Dan's Data letters #37
Dan's Data letters #38
Dan's Data letters #39
Dan's Data letters #40
Dan's Data letters #41
Dan's Data letters #42
Dan's Data letters #43
Dan's Data letters #44
Dan's Data letters #45
Dan's Data letters #46
Dan's Data letters #47
Dan's Data letters #48
Dan's Data letters #49
Dan's Data letters #50
Dan's Data letters #51
Dan's Data letters #52
Dan's Data letters #53
Dan's Data letters #54
Dan's Data letters #55
Dan's Data letters #56
Dan's Data letters #57
Dan's Data letters #58
Dan's Data letters #59
Dan's Data letters #60
Dan's Data letters #61
Dan's Data letters #62
Dan's Data letters #63
Dan's Data letters #64
Dan's Data letters #65
Dan's Data letters #66
Dan's Data letters #67
Dan's Data letters #68
Dan's Data letters #69
Dan's Data letters #70
Dan's Data letters #71
Dan's Data letters #72
Dan's Data letters #73
Dan's Data letters #74
Dan's Data letters #75
Dan's Data letters #76
Dan's Data letters #77
Dan's Data letters #78
Dan's Data letters #79
Dan's Data letters #80
Dan's Data letters #81
Dan's Data letters #82
Dan's Data letters #83
Dan's Data letters #84
Dan's Data letters #85
Dan's Data letters #86
Dan's Data letters #87
Dan's Data letters #88
Dan's Data letters #89
Dan's Data letters #90
Dan's Data letters #91
Dan's Data letters #92
Dan's Data letters #93
Dan's Data letters #94
Dan's Data letters #95
Dan's Data letters #96
Dan's Data letters #97
Dan's Data letters #98
Dan's Data letters #99
Dan's Data letters #100
Dan's Data letters #101
Dan's Data letters #102
Dan's Data letters #103
Dan's Data letters #104
Dan's Data letters #105
Dan's Data letters #106
Dan's Data letters #107
Dan's Data letters #108
Dan's Data letters #109
Dan's Data letters #110
Dan's Data letters #111
Dan's Data letters #112
Dan's Data letters #113
Dan's Data letters #114
Dan's Data letters #115
Dan's Data letters #116
Dan's Data letters #117
Dan's Data letters #118
Dan's Data letters #119
Dan's Data letters #120
Dan's Data letters #121
Dan's Data letters #122
Dan's Data letters #123
Dan's Data letters #124
Dan's Data letters #125
Dan's Data letters #126
Dan's Data letters #127
Dan's Data letters #128
Dan's Data letters #129
Dan's Data letters #130
Dan's Data letters #131
Dan's Data letters #132
Dan's Data letters #133
Dan's Data letters #134
Dan's Data letters #135
Dan's Data letters #136
Dan's Data letters #137
Dan's Data letters #138
Dan's Data letters #139
Dan's Data letters #140
Dan's Data letters #141
Dan's Data letters #142
Dan's Data letters #143
Dan's Data letters #144
Dan's Data letters #145
Dan's Data letters #146
Dan's Data letters #147
Dan's Data letters #148
Dan's Data letters #149
Dan's Data letters #150
Dan's Data letters #151
Dan's Data letters #152
Dan's Data letters #153
Dan's Data letters #154
Dan's Data letters #155
Dan's Data letters #156
Dan's Data letters #157
Dan's Data letters #158
Dan's Data letters #159
Dan's Data letters #160
Dan's Data letters #161
Dan's Data letters #162
Dan's Data letters #163
Dan's Data letters #164
Dan's Data letters #165
Dan's Data letters #166
Dan's Data letters #167
Dan's Data letters #168
Dan's Data letters #169
Dan's Data letters #170
Dan's Data letters #171
Dan's Data letters #172
Dan's Data letters #173
Dan's Data letters #174
Dan's Data letters #175
Dan's Data letters #176
Dan's Data letters #177
Dan's Data letters #178
Dan's Data letters #179
Dan's Data letters #180
Dan's Data letters #181
Dan's Data letters #182
Dan's Data letters #183
Dan's Data letters #184
Dan's Data letters #185
Dan's Data letters #186
Dan's Data letters #187
Dan's Data letters #188
Dan's Data letters #189
Dan's Data letters #190
Dan's Data letters #191
Dan's Data letters #192
Dan's Data letters #193
Dan's Data letters #194
Dan's Data letters #195
Dan's Data letters #196
Dan's Data letters #197
Dan's Data letters #198
Dan's Data letters #199
Dan's Data letters #200
Dan's Data letters #201
Dan's Data letters #202
Dan's Data letters #203
Dan's Data letters #204
Dan's Data letters #205
Dan's Data letters #206
Dan's Data letters #207
Dan's Data letters #208
Dan's Data letters #209
Dan's Data letters #210



Give Dan some money!
(and no-one gets hurt)