Wednesday, December 30, 2009
video feed grabber:
Thursday, December 24, 2009
~/Library/Application Support/iPhone Simulator/Users/Applications/
Thursday, December 17, 2009
Wednesday, November 04, 2009
Friday, October 30, 2009
One of H.264's most useful features is the ability to choose among many combinations of inter and intra partitions. Pictures are typically in units called macroblocks. A macroblock has typically the size 16x16 pixels and can have different types. If the macroblock type is Intra (I), that part of the decoded image is completely replaced by a new texture, while if the macroblock type is Inter (P) the decoded macroblock data is added to what was previously decoded in that macroblock area. P-macroblocks can be subdivided into 16x8, 8x16, 8x8, 4x8, 8x4, and 4x4 partitions. B-macroblocks can be divided into 16x8, 8x16, and 8x8 partitions. I-macroblocks can be divided into 4x4 or 8x8 partitions. Analyzing more partition options improves quality at the cost of speed. The default is to analyze all partitions except p4x4 (p8x8, i8x8, i4x4, b8x8), since p4x4 is not particularly useful except at high bitrates and lower resolutions. Note that i8x8 requires 8x8dct, and is therefore a High Profile-only partition. p8x8 is the most costly, speed-wise, of the partitions, but also gives the most benefit. Generally, whenever possible, all partition types except p4x4 should be used.
When encoding with h264, the screen is divided into 16x16 Macroblocks (MBs). These blocks can be subdivided further into partitions of various sizes (16x8, 8x16, 8x8, 4x4). Motion estimation is better with smaller subpartitions, but the overhead for such information is similarly increased.
DCT block size is separate from motion block ("partition") size. The DCT has a choice of 8x8 or 4x4. Motion partitions have a choice of 16x16, 16x8, 8x16, 8x8, 8x4, 4x8, or 4x4. Each (inter-) macroblock has both a DCT block size and some motion partition size(s). The only restriction on combining the two is that partitions can't be smaller than their DCT blocks.
Small partitions provide better prediction but cost more bits. There is no overhead one way or the other for DCT block size, but also one isn't always better compression than the other, so that decision is based just on which one is more appropriate to the given image region.
That said, high profile also introduced a new intra partition, "i8x8". Intra partition sizes now have a choice between 16x16, 8x8, and 4x4, which is decided based on prediction quality vs bit cost just like motion partitions are.
In x264, --8x8dct enables high profile, and x264 allows i8x8 partitions if high profile is enabled, but they should not be confused as being the same feature.
One of H.264's most useful features is the abillity to reference frames other than the one immediately prior to the current frame. This parameter lets one specify how many references can be used, through a maximum of 16. Increasing the number of refs increases the DPB (Decoded Picture Buffer) requirement, which means hardware playback devices will often have strict limits to the number of refs they can handle. In live-action sources, more reference have limited use beyond 4-8, but in cartoon sources up to the maximum value of 16 is often useful. More reference frames require more processing power because every frame is searched by the motion search (except when an early skip decision is made). The slowdown is especially apparent with slower motion estimation methods. Recommended default: -refs 6
One of H.264's main features is the in-loop deblocker, which avoids the problem of blocking artifacts disrupting motion estimation. This requires a small amount of decoding CPU, but considerably increases quality in nearly all cases. Its strength may be raised or lowered in order to avoid more artifacts or keep more detail, respectively. Deblock has two parameters: alpha (strength) and beta (threshold). Recommended defaults:-deblockalpha 0 -deblockbeta 0 (Must have '-flags +loop')
dia (x264) / epzs (FFmpeg) is the simplest search, consisting of starting at the best predictor, checking the motion vectors at one pixel upwards, left, down, and to the right, picking the best, and repeating the process until it no longer finds any better motion vector.
hex (x264) / hex (FFmpeg) consists of a similar strategy, except it uses a range-2 search of 6 surrounding points, thus the name. It is considerably more efficient than DIA and hardly any slower, and therefore makes a good choice for general-use encoding.
umh (x264) / umh (FFmpeg) is considerably slower than HEX, but searches a complex multi-hexagon pattern in order to avoid missing harder-to-find motion vectors. Unlike HEX and DIA, the merange parameter directly controls UMH's search radius, allowing one to increase or decrease the size of the wide search.
esa (x264) / full (FFmpeg) is a highly optimized intelligent search of the entire motion search space within merange of the best predictor. It is mathematically equivalent to the bruteforce method of searching every single motion vector in that area, though faster. However, it is still considerably slower than UMH, with not too much benefit, so is not particularly useful for everyday encoding.One of the most important settings for x264, both speed and quality-wise. Looking at full vs. hex vs. umh.
- -subq 6 (FFmpeg)
1: Fastest, but extremely low quality. Should be avoided except on first pass encoding.
6-7: 6 is the default. Activates rate-distortion optimization for partition decision. This can considerably improve efficiency, though it has a notable speed cost. 6 activates it in I/P frames, and subme7 activates it in B frames.
8-9: Activates rate-distortion refinement, which uses RDO to refine both motion vectors and intra prediction modes. Slower than subme 6, but again, more efficient.An extremely important encoding parameter which determines what algorithms are used for both subpixel motion searching and partition decision. Checking 6 or 8.
Typical streams look like this:
- 3GPP - lower quality, H.263, AMR-NB audio, bit rates up to 192Kbps
- MPEG-4 - higher quality, H.264, AAC audio, Bit rates up to 500Kbps
Emulator Skins, Android 1.6 Platform
Thursday, October 29, 2009
Wednesday, October 28, 2009
- Pre-scale your views
- Use Adaptors
- don't use invalidate() - use a specific Rect or region. Use Developer Settings, show screen redraw tools on the device/emulator
- look at the view hierarchy in the emulator --- avoid deep trees --- wide trees are preferred.
- emulator shows the rendering time, layout time, etc
- Compound drawables - collapse views/levels in the view hierarchy (e.g. images adjacent to text)
- ViewStub -- hidden portions- keeps UI views to a minimum (review the Android source code for examples)
- use the
tag instead of a dummy frame or layout node/tag --- again, always avoid hierarchy levels, use the tag to be the root in xml
- Use RelativeLayouts instead of linear layouts
- Try using Custom View and Layout children from the Base classes --- rather than expand the hierarchy by nesting standard layouts
- Standard java performance stuff --- watch GC, allocations (Allocation Tracker tool) String, understand Soft,Weak References
Monday, October 26, 2009
Wednesday, October 07, 2009
Sunday, September 27, 2009
Monday, September 21, 2009
Wednesday, September 16, 2009
- Right now the short code doesn't have a way to specify only a thumbnail. So if you want a preview image, but NOT the player, you can't do that. Useful for some theme layouts that want to overlay text or something else on top of the preview (like another image, like NEW!)
- EDIT: Actually there does seem to be a way to do this: get_the_excerpt(). Unfortunately, it inserts the entire HTML element, and some breaks, which is not what I need. I need ONLY the url. I have temporarily added a new function that bascially does the same thing, only returns JUST the URL. Should I make this a template tag? Or should we add an attribute to the short code?
- 10/25/09 EDIT: OK finally figured this out (mostly). wp_theme_videolink() is something I added to the video.php file of the WP Video project. I will review the code with Hailin and se if we can get it committed. It is basically a version of the wp_add_videolink() that I modified to be for themes, not RSS feeds. Below is a version I used for the eVid theme.
$thumb = wp_theme_videolink();//Was this : $thumb = get_post_meta($post->ID, 'Thumbnail', $single = true);
- There is no way to render the same video in 2 different sizes. For example the eVid theme has a top "Featured Videos" panel which it wants to size large (and widescreen, more later). But the same post can/will appear in the main page. Well, since the theme just dumps the_content(), it uses the same dimensions in both places. So you'd have to hack in a custom meta value to support "featured" vs. "normal", etc. Not elegant. Nicer if the shortcode allowed you to specify a css class and then you could do something like [wpvideo Ay1SIRji class="letterbox"]
- Need an option for the shortcode to remove the player elements. Might want to disable some of the controls for various views.
- How can you remove/change the Wordpress watermark that the player renders? If it's not already supported, add support for making that dynamic in the shortcode. Not only would someone want to remove it, but they might want their own site logo on it, OR they may want different images depending on category, tag, page, etc.
- Need to review/grok how cacheing works. Should cache all thumbnails so loads fast.
- Sitemaps --- how to load to Google, Bing, Yahoo
Tuesday, September 15, 2009
- Lateral positioning of the mask and substrate, resist material, and distance between mask and substrate
- exposure process of how to transfer patters to the photoresist layer: contact printing or projection printing
- development: dissolution or etching of the resist pattern
- interfereometric lithography
- chemical vapor deposition
- thermal oxidation
- Sol-Gel deposition
- Spin coating
- wet etching
- chemical or chemical-physical dry etching
- deposit functional layer over a substrate
- spin coat with photoresist (positive or negative photoresist)
- select mask type (dark or clear field)
- transfer pattern to the resist layer
- etch the structure into the functional layer
- wash away photoresist
Monday, September 14, 2009
- kinematic properties, transport properties, thermodynamic properties, surface tension, vapor pressure, surface accomodation
- Fluidic interconnects - standards? universal interconnects?
- pumps and valves - fabrication, integration, elastomers
- fluid injection = volume vs. sensitivity (if you only have one cell worth of protein, and add fluid you need sensitive sensors
- Confining molecules for detection
- kinetics of chemical reactions
- molecule activitiy
- intensifying and analyzing role of surfaces in catalytic reactions
- applying magnetic fields to conotrol reactions
- labelling molecules
- biomolecules with NEMS
- amplification of other than DNA biological structures
- non-newtonian fluids
- sequenced low-nanogram scale bacterial and mammalian DNA
- support of more efficient PCR prep, see example overview of the issues here:
- hardware and software for controlling, modeling, engineering flows in the chip, for example:
Saturday, September 12, 2009
Friday, September 11, 2009
Thursday, September 10, 2009
- Register an action (remote_transcode_one_video) so that when the user attaches a file, it fires off an exec() to run video-upload.php
- in the transcoder (now we are on another server, most likely) it checks the auth, saves metadata about size, etc. and uses FFMPEG to transcode
- now it sends the file to the file server (send_to_fileserver) where it moves the files into the final resting place, and has a placeholder for sending it off to a CDN or other replicant
- the upload script and the transcode script checks if you have a DATACENTER defined, presumably for load and redundancy; this is a stub, so you would have to add some logic to round robin or randomize or in other ways pick a "transcoder" server and a "fileserver"
- there is a simple authentication mechanism using a simple md5 salty string to auth to the transcoder -- would be nice to add per user auth to prevent spam or abuse, or to block users who post illegal content -- CERTAINLY users should change this string in production! maybe in the comments we can make that more explicit. Security by obscurity is never the right way to go
- we are using some standard formats, but there are ffmpeg templates with many more examples, lots for mobile video, etc. we should import these, and just have a list in the options of all template files, or maybe even create the template inside a post, perhaps with some sort of GUI