From owner-freebsd-questions@freebsd.org Mon Aug 15 01:00:48 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42532BBACB6 for ; Mon, 15 Aug 2016 01:00:48 +0000 (UTC) (envelope-from rnmtw70@yandex.com) Received: from forward5o.cmail.yandex.net (forward5o.cmail.yandex.net [IPv6:2a02:6b8:0:1a72::28a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCC391F08 for ; Mon, 15 Aug 2016 01:00:47 +0000 (UTC) (envelope-from rnmtw70@yandex.com) Received: from smtp1h.mail.yandex.net (smtp1h.mail.yandex.net [IPv6:2a02:6b8:0:f05::115]) by forward5o.cmail.yandex.net (Yandex) with ESMTP id B78EA20300 for ; Mon, 15 Aug 2016 04:00:43 +0300 (MSK) Received: from smtp1h.mail.yandex.net (localhost.localdomain [127.0.0.1]) by smtp1h.mail.yandex.net (Yandex) with ESMTP id AA0FD8C08AF for ; Mon, 15 Aug 2016 04:00:43 +0300 (MSK) Received: by smtp1h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id H2Ziabk3D4-0gjaPEwb; Mon, 15 Aug 2016 04:00:43 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1471222843; bh=XHYttXBPW36W1Oa0dBRLzxojKlBw9PIYWoVh6Y2L8CM=; h=Subject:To:References:From:Message-ID:Date:In-Reply-To; b=xwjXnLi6Wfp28RpiPpY2OrZxVtcmB3ucn4hVbms8W3LpcWYbj0E8i6gXnKvepLBAd CRyxXBdV+dLgGhppjcF+AznB6av5VaOJRmHtIf7Ok40jW+Hnqp6ZZr4Rd2qZWBKd+U D2Yan7YclORMAThKuXALb8sX9GqpXdCfrDse+MWY= Authentication-Results: smtp1h.mail.yandex.net; dkim=pass header.i=@yandex.com X-Yandex-Suid-Status: 1 0 Subject: Re: Video DVD quality loss with mencoder/dvdauthor/growisofs To: freebsd-questions@freebsd.org References: <20160815013606.896d920c.freebsd@edvax.de> From: Rolf Nielsen Message-ID: Date: Mon, 15 Aug 2016 03:00:41 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2016 01:00:48 -0000 Reposting to include the list (apologies). On 2016-08-15 02:54, Rolf Nielsen wrote: > > > On 2016-08-15 01:36, Polytropon wrote: >> Currently I'm searching for a way to create MPEG files suitable >> for creating movie DVDs. My source files are SD videos with the >> following properties: >> >> container: AVI >> video: DivX DX50, 640x360 px, 24 bpp, 25 fps >> audio: MP3, 44.1 kHz, 2 ch, 128 kbps >> >> I'd like to "inflate" the video for DVD resolution. When I use >> mencoder to do so, the graphics gets "blocky". There are no >> visible compression artifacts in the source video, but the >> result is really terrible. I know I cannot "increase quality" >> when doing 640x360 -> 704x576, but it should not get worse. >> >> My solution is a script "avi2dvd" which uses mencoder, dvdauthor >> and growisofs to prepare the required data structures and then >> burn them onto DVD+R media. The DVD players I tested them with >> play the result format, but show the "blocky" video just like >> a software player (both by checking the .mpg and .vob files), >> so the postprocessing steps do not introduce that significant >> quality loss. >> >> At its heart, the script contains this step: >> >> mencoder -oac lavc -ovc lavc -of mpeg -ofps 25 \ >> -mpegopts format=dvd -vf scale=704:576,harddup \ >> -af lavcresample=44100 -srate 44100 \ >> -lavcopts vcodec=mpeg2video:keyint=15:vrc_buf_size=327:vrc_minrate=1152:vbitrate=1152:vrc_maxrate=1152:acodec=mp2:abitrate=224 \ >> -o ${MPEGFILE} ${AVIFILE} >> >> This reflects the parameters I got from the mplayer documentation >> on the web where this approach is listed for creating DVD files. >> But as I said: The quality is terrible. >> >> (Sidenote: I will additionally need to experiment with -vf crop >> in order to deal with mis-aligned video sources.) >> >> Can anyone provide a _verified_ method that _does not lower_ the >> resulting video quality? >> >> >> > > Try -sws 9 -vf scale=704:576:0:0:10,harddup,pp=ac and see if that helps. > > -sws 9 selects lanczos filter for scaling, and the 10 at the end of the > scale filter does some settings with lanczos (I don't remember exactly > which, but the result looks awful without it), and the pp=ac is a post > processing filter that should reduce blockiness. > > And btw, DVD video requires the audio tracks to be 48000 Hz. > -- Vänligen / Sincerely, Rolf Nielsen