The HiDef Myth

0
Filed under Uncategorized

What is high definition video?

Wikipedia says it’s “any video system of higher resolution than standard-definition (SD) video, and most commonly involves display resolutions of 1280×720 pixels (720p) or 1920×1080 pixels (1080i/1080p)”.

So, apparently, an image of 1920 by 1080 pixels is high definition.  The following image(when clicked) is 1920 by 1080 pixels so it must be high definition.

I’ll assume there are no arguments with that.
What about the next image?

Well, it’s certainly 1920 by 1080 which means it’s high definition, but what happened?
What happened is the source was much much smaller.

You see, it’s all about the source.  If you didn’t use a very high quality (expensive) camera, if you’ve done any kind of encoding that was lossless(unlikely), or did the encoding to a size smaller than 1920×1080…. it’s high definition only by technicality and it’s certainly of lower quality.

What do you think happens when you watch HD TV?  The creators of whatever show you’re watching film it on expensive cameras.  Then they encode it using a lossy codec (quality lost). Then it gets sent to the network which re-encodes it using another, probably different, lossy codec(more quality lost) with their own stuff added to be broadcast to your television provider.  The cable/sat provider re-encodes it yet again using another different lossy codec (more quality lost) adding their own stuff and it’s transmitted to your box which decodes it.  So that’s at least 3 times it’s encoded, losing quality each time, and these are just the encoding we know about.  It could be done several times more on it’s path to you. We don’t know what encoders they use, but we can be certain they don’t use lossless codecs and we don’t know what size they are encoded at.

The same is true for Blu-Ray.  We don’t know how many times it was encoded, at what sizes, and the codec they use (h.264), though it has a lossless function,  isn’t used and probably can’t be used on BluRay players.

All we see is the 1920×1080 result and by then the fact that it’s HD doesn’t mean a whole lot.
Sorry to burst your bubble.  :/

Simple audio CD burning on the command-line.

0
Filed under linux

Normally I despise all optical media for various reasons, but recently a family member of mine asked me to make them a few audio CDs.   I didn’t like this idea too much, but I’m sure they wouldn’t grasp exactly why optical media is bad and they didn’t have the necessary simple hardware to replace it.  In the long run my sanity would hold over a bit longer if I just went ahead and burned the CDs.

Oh my god, burning a CD takes a long damn time not including the time it takes to find the MP3s and a decent audio cd burning app.  As my only windows machine, my laptop chugged away on the first disc as I stared at the progress bar in utter awe.  Then I had an idea.

There’s got to be a better way.  Hell, I have two other linux machines sitting here, with burners!  So I broke down and wrote a simple bash script that converts a dir of MP3s to WAVs, burns the CD, ejects it, and then removes the WAVs.  I even had it store the WAVs in RAM if there was enough room.

Below is the script in all it’s simplistic glory.  I’m sure it has a flaw or two, but I’ll fix it and update it here. :)

#!/bin/bash
log="$0.log"
lame=$(which lame)
wodim=$(which wodim)

if [ ! -x $lame ]; then
  echo "-->  lame not found."
  exit
fi
if [ ! -x $wodim ]; then
  echo "-->  wodim not found."
  exit
fi
if [ $(df | grep shm | tr -s [:blank:] | cut -d" " -f4) -ge 800000 ]; then
  path="/dev/shm/tmpwav"
else
  path="wav"
fi

# spinner stuff
spinner(){
  PROC=$1
  while [ -d /proc/$PROC ];do
    echo -[/]' ; sleep 0.05
    echo -[-]' ; sleep 0.05
    echo -[\]' ; sleep 0.05
    echo -[|]' ; sleep 0.05
  done
  echo -   "
  return 0
}

# width:

STAT_COL=80
if [ ! -t 1 ]; then
  USECOLOR=""

# stty will fail when stdin isn't a terminal
elif [ -t 0 ]; then
  STAT_COL="$(/bin/stty size)"
  # stty gives "rows cols"; strip the rows number, we just want columns
  STAT_COL="${STAT_COL##* }"

else
  # is /usr/share/terminfo already mounted, and TERM recognized?
  /bin/tput cols &>/dev/null
  if [ $? -eq 0 ]; then
    STAT_COL=$(/bin/tput cols)
  fi
fi
if [ "0$STAT_COL" -eq 0 ]; then
  # if output was 0 (serial console), set default width to 80
  STAT_COL=80
  USECOLOR=""
fi

# we use 13 characters for our own stuff
STAT_COL=$(($STAT_COL - 13))

# disable colors on broken terminals
TERM_COLORS="$(/bin/tput colors 2>/dev/null)"
if [ $? = 3 ]; then
	TERM_COLORS=8
elif [ -n "${TERM_COLORS}" ]; then
	case "${TERM_COLORS}" in
		*[!0-9]*)
			USECOLOR=""
			;;
		*)
			[ "${TERM_COLORS}" -lt 8 ] && USECOLOR=""
			;;
	esac
else
	USECOLOR=""
fi
unset TERM_COLORS

# clear the TZ envvar, so daemons always respect /etc/localtime
unset TZ

# colors:
if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then
	C_MAIN="\033[1;37;40m"      # main text
	C_OTHER="\033[1;34;40m"     # prefix & brackets
	C_SEPARATOR="\033[1;30;40m" # separator

	C_BUSY="\033[0;36;40m"      # busy
	C_FAIL="\033[1;31;40m"      # failed
	C_DONE="\033[1;37;40m"      # completed
	C_BKGD="\033[1;35;40m"      # backgrounded

	C_H1="\033[1;37;40m"        # highlight text 1
	C_H2="\033[1;36;40m"        # highlight text 2

	C_CLEAR="\033[1;0m"
fi

if [ -t 1 ]; then
	SAVE_POSITION="\033[s"
	RESTORE_POSITION="\033[u"
	DEL_TEXT="\033[$(($STAT_COL+4))G"
else
	SAVE_POSITION=""
	RESTORE_POSITION=""
	DEL_TEXT=""
fi

# status
pdone(){
  printf "${DEL_TEXT}"
  printf "   ${C_OTHER}[${C_DONE}DONE${C_OTHER}]${C_CLEAR} \n"
}

# do it
echo -n "Creating temporary directory ...    "
mkdir $path
pdone
echo "Convering MP3s to WAVs ...     "
lamecounter=1
for file in *.mp3 ; do
  echo -n "--> Converting track ${lamecounter} to WAV ...     "
  $lame --decode "$file" $path"/$file.wav" > $log 2>&1 &
  spinner $!
  pdone
  let "lamecounter++"
done

if (shopt -s nullglob dotglob; f=($path/*.wav); ((! ${#f[@]}))); then
  echo -e "For some reason we don't have WAVs to burn.\nCheck the log and try again.\Halting."
  exit
fi

echo -n "Burning audio disc ...     "
$wodim -v -pad speed=1 dev=/dev/cdrw -dao -swab $path/*.wav > $log 2>&1 &
spinner $!
pdone
if [ -x $(which eject) ]; then
  echo -n "Ejecting the disc ...     "
  eject
  pdone
fi
echo -n "Deleting temp dir and WAVs ...     "
rm $path/*
rmdir $path
pdone
echo -e "\nEnjoy your CD.  :) \n"

Note: I’m still trying to figure out a way to have the script detect if the current disc is audio, data, or blank.  Any tips?

My views on the myth of ‘Intelectual Property’

0
Filed under Philosophy

In case you are uninformed, “Intellectual Property” is the term copyright holders use to describe their legal monopoly over ideas.  An example is that the recent film Avatar is the intellectual property Fox.  At least that is the view of the copyright holder and the law(being their puppet).

However, I don’t believe in intellectual property at all.   I don’t believe that anyone can “own” an idea.  Some would say making a copy of the fore-mentioned film is stealing.   I disagree.  If you’ve not deprived someone of something, you’ve not stolen anything.  I’m certain that no matter how many times I copy an idea, a movie, music, software, etc, that the creator is not deprived of anything. They retain their copy.  If I walk into a convenience store and snap a picture of a candy bar and then walk otu I’m sure you wouldn’t say I stole something.   So why all the confusion when it comes to copyright? Why all the “you wouldn’t steal a car” crap from the MPAA?

Money.  That’s right, the driving force behind almost everything.  The millions(and even billions) of dollars that the film studios make from simply making a thousand copies of a 2 hour block of entertainment, simply isn’t enough I guess.  They make it sounds like they make pennies as they drive around in top end cars and are all over TV spewing about how we should support this or that international effort.   blah blah blah.   You hear the sob story “the people who work backstage need these jobs..”.  I call bullshit.   They get paid, in advance, long before the movie hits theaters. If they don’t meet their meaningless quota it’s poor planning on their part.

Record studios realized this a little while ago and have given up all hope of stopping people from copying.  Instead, they were smart enough to adapt.  They now focus on several other things to ensure income.  One of which is selling individual songs online, easily, at affordable prices, in guaranteed quality.

People now, as they always have, download what they want when they want.  I doubt the idea of intellectual property will ever go away, but  I’m sure the day will come when the movie studios will wise up and take the path the record studios have.


For an interesting documentary on this very topic check out Steal This Film

lightweight desktop woes

0
Filed under linux
Tagged as , , , , ,

I’ve been using a lightweight desktop for a while now and after fooling around with gnome for a few minutes the other day, I noticed a few things that I miss.  Namely, automounting and filetype associations.

Running a desktop that consists of just openbox and dmenu I simply don’t have these two features out of the box, but I’ve found a simple solution to both.  :D

Filetype Associations:
Now you wouldn’t think this would be a big deal on a very lightweight desktop, but having chroimum(google chrome) automatically open .torrent files with my favorite bittorrent application is very useful. This was rather easily acheived on my main distro (archlinux) by installing ‘perl-file-mimeinfo’.

Auto-mounting:
Don’t you just love it when you plug in a thumb drive and it’s automatically mounted? Gnome does it, KDE does it, why the hell can’t you with something lightweight? Well, you can! There’s a simple daemon called, strangely enough, autofs. From a bit of experimentation I’ve discovered how simply it works. You plug in a device and it automounts it. After a period of inactivity(I chose 5 seconds), it automatically unmounts it. When you access the mount point again it remounts until the timeout is hit again. So to “safely” unmount a removable device, simply leave the mount point and wait your specified timeout. Anyhow, you can read more about it here.

Welcome

0
Filed under Uncategorized

Welcome to my site.  There isn’t a whole lot here right now and there probably won’t be for a short while.   More will certainly be added after I play around with the wordpress options a bit more.