The Shoes of the Fisherman's Wife Are Some Jive-Ass Slippers

tpot (at) frungy . org

rss

2006
Months
Oct

Mon, 16 Oct 2006

bfr - nonblocking 8-bit-clean pipe buffer

I recently discovered the bfr program while searching for a way to watch a large video file stored on a web server connected by a slow pipe. The premise is that your link is slower than the rate at which the video codec consumes data so say hello to Mr Progress Bar every ten seconds or so. Most video players can buffer up a small amount of data and some even allow you to change the size of the buffer but sometimes this just doesn't work well.

Here's my command line:

$ wget -q -O http://some.domain/bigassfile.ogg | \
  bfr -pk -b 100m | \
  xine stdin://
The command line above starts a wget of a big-ass file, then uses bfr to start accumulating up to 100M of data and displays a progress bar in KB on stderr. The xine video player is used to display the output appearing on standard input.

The exact moment when streaming starts is 10% of the buffer size though the options to change this don't seem to work as advertised in the manual page. The progress bar is very nice though as it displays a graphical display of the size of the buffer, as well as the rate data is entering and leaving. If the buffer empties completely, you can hit pause in xine and go get a cup of coffee while the buffer refills.

posted at: 14:33 | path: /software | permanent link to this entry