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

1 comment:

  1. I recommend iDealshare VideoGo which can crop video to remove the black board or bars of a video file.

    Step by step guide at http://idealshare.net/video-converter/video-cropper.html

    It can easily crop all kinds of video files whatever it is in AVI, MP4, MKV, VOB, WMV, MOV, FLV, 3GP, SWF, OGV, WebM, RMVB, Apple ProRes, MXF, AVCHD, MTS, MOD, TOD, DV, MPEG-1, MPEG-2, DivX, Xvid and etc. It even helps to download and crop YouTube videos.

    ReplyDelete