Tuesday, April 26, 2011

Remove black borders and bars from Movies with VLC, Mplayer or FFMPEG

no cropping
cropped borders

Black borders at the top and bottom of DVD and Blu-Ray movies can be bothersome to many people who wish to use every inch of their HDTV. This can be especially frustrating to those who buy movies that are advertised as 720p and 1080p, but find out that black borders are a part of the advertised resolution of the movie Disc.

Unless advertised as full screen, 720x480 DVDs are usually 720x352 and 720x368.
While 1080p Blu-Ray movies are sometimes 1920x800.

If your wondering what resolution some of your movies might actually be, Mplayer can be used to check the real resolution. Simply use one of the commands below and while the movie is playing, look for a line that has -vf crop=x:y:x:y. The proceeding numbers followed by colons are your movies real width and height and what I assume is the number of pixels that the black borders fill the screen in with. 

Example
mplayer dvd:// -vf cropdetect or mplayer "file" -vf cropdetect
Result
-vf crop=720:352:0:62

So how do you get rid of Black borders and bars used in DVDs and Blu-Rays?

Well there are three methods that I use to eliminate borders from movies. Here they are from the easiest to the hardest:


1. VLC
VLC media player can be used crop black borders and bars without re-encoding
the video. While the movie is playing, simply right click on the screen and select
video > crop > 16:9. After that right click again, but this time select video >  
aspect > 4:3. That's all there is too it. This works if the movie has an aspect ratio
of 16:9.


2. Mplayer
For those who enjoy using command line, Mplayer can be used to crop black
borders also. First detect the crop size with Mplayer and the -vf cropdetect
command. Next load a Movie with Mplayer and the command -aspect 4:3 and
the crop resolution gained from -vf cropdetect.


Example of cropping a HD movie
mplayer -aspect 4:3 "Your Movie" -vf crop=1920:800:0:140


3. FFMPEG
The last most difficult and time consuming method will require you to rip the movie and
use ffmpeg to re-encode the movie and crop the top and bottom black borders.

First use mplayer -vf cropdetect to determine the crop resolution.
Next determine which audio stream will be copied with the re-encoded movie. This can be
determined by playing the original movie with VLC and changing audio streams to find the
one you prefer and using ffmpeg -i "movie".  FFMPEG will show information about the
movie including all of it's audio streams which will usually have a line with #0.1[0x80]
in it. With the crop resolution and audio stream information, the movie is now ready to be
re-encoded.

Example of re-encoding a vob file and cropping it's top and bottom black borders
ffmpeg -map 0:0 -map 0:1 -i "ripped movie" -acodec copy -vcodec mpeg2video -vf crop=720:368:0:54 -vb 8000k newmovie.vob

Thursday, September 23, 2010

HDBaseT: The HDMI replacement? Just wait a minute.

If you have not heard there is a new connection standard set to take the place of HDMI, component, coax and other standards currently used to connect electronics to TVs and monitors for audio and video. This new standard will be named HDBaseT. The electronics that will be used with this standard will be computers, game consoles, AV receivers, blu-ray players and other devices that output high-definition audio and video.


So what makes HDBaseT better than current connection standards?

HDBaseT will have the ability to not only carry high-definition video and audio, but also network devices over Ethernet, power devices over Ethernet and send control signals to devices.  Maybe the best part of all is that HDBaseT will use RJ-45 as connection ports and CAT5 and CAT6 as connection cables.

Features of HDBaseT:
HD Video and Audio
100BaseT Ethernet
Power devices over Ethernet
Send control signals
Use standard CAT5/6 cables

So whats the problem with HDBaseT?

Looking at all these great features, you might ask why I am not sold on HDBaseT. The answer is very simple. The reason behind my reluctance to buy into HDBaseT is because of the current TVs and devices we all currently own. Take a good look at your TV, PC monitor, PC and other devices you may have in your home. None are compatible with HDBaseT. Most TVs and monitors don't even have RJ-45 Ethernet ports. Even if your devices do have RJ-45 Ethernet ports, it still will not be compatible with HDBaseT because it does not have the new technology inside it.

In my mind HDBaset is no more than a plan to force people to buy new electronics, which will certainly be more expensive than the electronics will all currently own. How many people can really afford to replace every electronic in there home for the sake of HDBaseT. Keep in mind a lot of people still don't know what HDMI is. For the next couple of years I will be sticking with HDMI.

Saturday, August 14, 2010

Affordable accessories for your HTPC

I've finally decided to open up my own online store and sell accessories for a HTPC. I bought a small inventory consisting of HDMI cables, Component cables, SATA cables, USB cables, CAT5 ethernet cables and MicroSD card readers. Nothing will cost more than $10. If I am successful at selling these accessories, I will increase the number of different products I sell.

If anyone is interested in purchasing any of these accessories, you can find them on this Blog to the right of this article or visit www.pcandmoney.com/htpc-store/

Thursday, August 5, 2010

Clone a hard drive with FOSS and dd

Recently, a old co-worker contacted me asking me to fix his computer. Upon examining the computer, I quickly discovered it had a bad hard drive. The hard drive would make various clicking sounds, which signaled to me there was a catastrophic problem. On top of that, BIOS would not detect the hard drive most of the time I tried to boot. It was clear that a new hard drive would have to be purchased. This is were another problem appeared.

I suggested to my old co-worker that I could install Linux on the new hard drive, because the old hard drive could not be detected by the BIOS most of the time, which was the reason for him asking me to fix his computer. That was a major problem because he and his family were using Windows Vista with multiple user accounts and they probably would not be comfortable with Linux. So now my only option was to try to clone the entire old hard drive with bad sectors to a new hard drive, easier said then done.

So now I have two major problems.

Problem 1. Getting the old hard drive with bad sectors to be detected by BIOS.

Problem 2. Make an exact duplicate of the old hard drive that uses Windows Vista.

My solutions to these problems.

Solution 1.
By changing the power cable and unmounting the hard drive from the hard drive cage, I was able to get the hard drive to be detected by the BIOS and fdisk.

Solution 2.
Although I have never cloned a hard drive before, I new it could be a simple task by using free and open source software and command line tools. I  loaded Arch Linux from an external hard drive, ran fdisk -l to discover the device name of the old hard drive and new hard drive, and then used dd to clone the old hard drive. dd is a unix command that copies and converts files. After about 3 hours and 30 minutes the cloning was finished. I uninstalled the old hard drive, so that Vista would not get the two confused. Vista worked on the new hard drive the same as it did with the old. After a reboot and chkdsk there are no problems with the newly cloned hard drive.

Warning!
The new hard drive must be equal to or larger than the old hard drive. If the new hard drive is larger than the old hard drive, the new hard drive will have to be partitioned to equal the size of the old hard drive or dd will use the entire hard drive space when cloning.

Example:
sda =250GB      sdb = 500GB
dd if=/dev/sda of=/dev/sdb, now the computer will see sdb as having only 250 GB of space.


For those interested to know what hard drive I used, it was Western Digital caviar blue WD5000AAKS 500GB for only $45.



Here is a review of steps and commands I used to clone a hard drive.

1. Load Linux from a live CD, USB drive or external hard drive.

2. Run fdisk -l from command line too determine the device name of each hard drive

3. Use dd to clone the hard drive. dd if=/dev/sda of=/dev/sdb
Where sda is the old hard drive and sdb is the new hard drive.
Using the command above will clone everything from sda to sdb
including the sda file size. sdb must be equal or larger than sda
for the cloning to be successful.

Friday, July 9, 2010

RocketFish 5.1 sound card working with linux


I managed to get a cheap sound card off of ebay for less than $7. This sound card has a name of Rocketfish 5.1 PCI, but lspci detects it as an Creative Labs CA0106 Soundblaster sound card. Before purchasing this sound card, I did some research to see if it worked properly with Linux. What I found is that many people had a problem getting this sound card to work with Linux. The problem seems to stem from the ALSA drivers. When I first installed the rocketfish sound card and tried to play sound, I got nothing but static. This rocketfish sound card does not seem to get along with the ALSA drivers.

So how do you get the Rocketfish sound card to work with Linux?
The simple answer is to install the OSS drivers and disable the ALSA drivers. This seems to be a easy fix, but not a long term one because I prefer ALSA drivers over OSS. With a little more research I found out that the rocketfish sound card does indeed work with ALSA drivers, but it was not consistent.

I will eventually try to get this sound card working with ALSA and give updates and procedures if I'm successful.

Monday, June 28, 2010

PS3 disc read error Fix!

I've spent the last few weeks trying to fix my PlayStation 3. Apparently I had a dead blu-ray drive.  After searching the internet for hours for symptoms that matched my problem and cleaning the lens of the blu-ray drive, I figured out that it was a bad lens in the blu-ray drive that caused me so much grief.

This really shocked me since I thought by buying one of the original PS3's(20GB model), I was getting better hardware than the newer models. Then I remembered that every PlayStation that I have ever owned have all had the same problem. DISC READ ERROR! It seems pretty amazing that a $500 or $600 machine could have the same problems as a $300 machine from 11 years before.

So how do you know if you really have a bad lens?
There are three dead give aways to a bad lens. The first would obviously be no disc appearing on screen after a game is inserted. The second is a small circle at top right of the screen that never stops spinning. The third and most serious is when the disc appears not to be spinning, this signifies that the lens is bad.

How can the PS3 be fixed when it is out of warranty?
The only way to fix the disc read error is to buy another lens for your blu-ray drive and take apart the blu-ray drive to install the better lens. This is not a simple task to complete and that's assuming you found an affordable replacement lens. There are many videos on youtube that can help people with assembly and disassembly. Finding an affordable replacement will require patience. I can tell you that they range from $45 to about $80. I managed to get one for about $49, but I will not put the seller's information on this page. I refuse to give anyone free advertising, but I will be more than happy to tell where I got it through an e-mail.

In all it took me about two hours to replace the bad lens and have everything aligned and back in the right place. My PS3 works again!

Tuesday, June 15, 2010

Diskless PC Part 1 - Budget PC built for $159


Recently I managed to build a diskless PC for a mere $159 and I could have did it for less if I was not so picky about components. This budget PC consist of a AMD sempron 140 cpu, Biostar A785GE motherboard, OCZ 2GB of ram, Rosewill tower with a 350 watt PSU and Rosewill card reader. What makes this deal so special is the sempron cpu. The sempron 140 cpu can be unlocked to a dual-core cpu with the right motherboard. In my case the right motherboard(Biostar A785GE) was bundled with the sempron cpu. This bundled deal can be frequently found at newegg.com for around $70.

Breakdown of components

1. Biostar A785GE Motherboard - Price: Bundled with cpu and case for $99.97 + $9.99 shipping
The biostar A785GE had the best specs I could get on a motherboard with a bundle cpu deal at newegg for under $100. The case was just a bonus. What sold me on this motherboard was it's ability to play HD video and DVI port. The downsides of this motherboard are it's lack of HDMI port and only 6 audio channels.

2. Sempron 140 CPU - Price: Bundled with motherboard and case for $99.97 + $9.99 shipping
Currently the cheapest CPU on the market at around $33 and it has a lot of power. With the right motherboard and bios update, this sempron 140 single core cpu can be unlocked to a dual-core cpu. It shows up as an X2 4400E in the bios.

3. OCZ 2GB RAM 5400 667MHz - Price: $38.99 + $1.99 shipping
Worked for around 8 days, then had serious problems. Ram stick caused problems with onboard video and segmentation faults with software. Will have to RMA.

4. Rosewill Case / 350 Watt PSU - Price: Bundled with motherboard and cpu for $99.97 + $9.99 shipping
Not very fond of the large tower cases, but it was part of a bundled cpu and motherboard deal, so I really can't argue about it's size. This large case gave me an opportunity to use a ATSC tuner card I had laying around that would not fit in my low profile HTPC case.

5. Rosewill 40 in 1 card reader - Price $7.99
Really didn't need this component, but got it just in case I came across a cheap memory card that I could use for storage.


What about the hard drive and optical drive?
Choosing not to buy a hard drive and optical drive saved me at least $70. Because there is no hard drive or optical drive I am left with only three options for booting a operating system. The three options include booting from flash memory, booting from my old external hard drive or net booting over the Ethernet port. Booting from the Ethernet port is the best and preferred method, but is also the hardest.

In Part 2, I will follow up on how this budget PC performed and what method I chose to boot the operating system.