From owner-freebsd-multimedia@FreeBSD.ORG Thu Sep 29 21:29:17 2005 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E46A816A41F for ; Thu, 29 Sep 2005 21:29:16 +0000 (GMT) (envelope-from csabamolnar@gmail.com) Received: from qproxy.gmail.com (qproxy.gmail.com [72.14.204.195]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DB8E43D49 for ; Thu, 29 Sep 2005 21:29:16 +0000 (GMT) (envelope-from csabamolnar@gmail.com) Received: by qproxy.gmail.com with SMTP id p35so50443qbb for ; Thu, 29 Sep 2005 14:29:15 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=jEgEsRvG6/u85aORuM7KVqcKGmKpseCDBlHcYh3ezvGMnY4H6Qkk37GTpfy+dpgCFBryzs5y3452N+9OS0JzjxuDzrvvm2BMUo72TMMKIG81vaLd9P7GkwxrSoJB/llxrXtOXno1bD3Q2MuQsrKc6JRY1iYOnAxwgM6ccNhv35Q= Received: by 10.65.93.18 with SMTP id v18mr514298qbl; Thu, 29 Sep 2005 14:23:03 -0700 (PDT) Received: from ?172.19.5.120? ( [193.6.168.3]) by mx.gmail.com with ESMTP id e14sm77044qbe.2005.09.29.14.23.00; Thu, 29 Sep 2005 14:23:01 -0700 (PDT) From: =?iso-8859-1?q?Moln=E1r_Csaba?= To: freebsd-multimedia@freebsd.org Date: Thu, 29 Sep 2005 23:26:04 +0200 User-Agent: KMail/1.8.2 References: <6.2.3.4.0.20050929155647.03113e40@64.7.153.2> In-Reply-To: <6.2.3.4.0.20050929155647.03113e40@64.7.153.2> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509292326.04914.csabamolnar@gmail.com> Cc: Mike Tancsa Subject: Re: fast transcoding of pvr-250 created files X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: csabamolnar@gmail.com List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2005 21:29:17 -0000 On Thursday 29 September 2005 21.59, Mike Tancsa wrote: > The native format is > quite large and I want to convert the file into xvid or divx for > later viewing, but I dont want to reduce the quality too > much. Anyone doing anything similar, and if so what program are you > using with what options ? > Use mencoder - even the FreeBSD handbook suggests that. At first it might be overwhelming a bit (all those options) - but they make a lot of sense. I strongly suggest to read the man page of mencoder/mplayer and the online documentation. When you recode, you have to decide which codec to use. You would want to use an mpeg-4 codec. Examples: divx, xvid, ffmep. Divx sucks, don't use it. Xvid is widely regarded as the king of mpeg-4 codecs, however, development for more than half a year now. Regardless, divx is still playing catch-up, and xvid is playable on almost any platforms. Another good choice is libavcodec's ffmpeg. This has reached the quality of xvid this year, and it is actively developed. It is also part of mplayer, so you won't need additional codecs. Encoding option depend very much on the quality of your source material, as well as it's properties. For instance, if you are capturing sports (I capture tennis matches :)) you will probably need higher bitrates to preserve the original quality. For your average tv shows, you don't need that much. The mplayer documentation - http://mplayerhq.hu/DOCS/HTML/en/index.html - has many examples, and this is a fairly large topic, but here is an example: # you tell mencoder about the input file, the output video codec (-ovc) # which is libavcodec (lavc) and its options (lavcopts) mencoder sourcematerial.mpeg -ovc -lavc -lavcopts \ # here you tell about the codec (mpeg4), the intended bitrate, and set some # other options (which are very well documented in mplayer's help) # vpass=1 means that you do a two-pass encoding, which is a must if you # want the best quality vcodec=mpeg4:vbitrate=1900:mbd=2:v4mv:trell:cmp=3:subcmp=3:mbcmp=3:mbd=2:autoaspect:vpass=1:cbp:mv0\ # next we need to set the audio codec options: -oac mp3lame -lameopts cbr:br=128 # then you need to crop and scale - cutting cruft or black borders, which # seriously reduce quality. See the -vf cropdetect option in the man page, # which helps you set the correct values - my example is pal, so yours will be # quite different # this is where we apply some post-processing filters, like # pp=lb/dr, and finally scale the movie -vf crop=720:544:0:16,pp=lb/dr,scale=512:384 -sws 2 # finally you define the output filename: -o encodedmovie.avi The second pass would look exactly the same, except you write vpass=1. Also, if your source is NTSC, you'll probably need to deinterlace, define the fps, and whatnot. Anyway, mencoder is the most powerful tool there is for encoding, recoding and capturing - for any platform! Take a look at the forums at www.doom9.org - almost every "professional" encoder uses mencoder, or rather, their own MeGUI built on mplayer there. Finally, ffmpeg is so fast (faster than xvid by ~20%, which is in turn faster than divx - which sucks, as I said) that you can often capture directly into mpeg-4 avis. The problem is, that you must define higher bitrates, and because it is real-time encoding, it will be obviously one pass. But still - here is what I do: ftp://hatvani.unideb.hu/pub/FreeBSD/ADDONS/docs/TV_ENCODE/rip.sh Remember, if you watch ntsc, you'll need some additional options, but all is there in the mplayer documentation.