View Single Post
Old 16th January 2014, 20:39   #2402  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
ffmpeg vbr encodes in AVStoDVD

Here's a somewhat delayed Xmas present for Fishman0919...

I made a small wrapper for ffmpeg.exe which enables 1-pass and also 2-pass VBR encodes using ffmpeg. The 2-pass command line is taken from this post:
http://forum.doom9.org/showthread.ph...80#post1651880

Here is the readme:
Quote:
ffmpeg VBR modes for AVStoDVD
------------------------------------

This small utility allows 1-pass VBR and high quality 2-pass VBR encodes
using ffmpeg under AVStoDVD.


Installation:

1. Go to the "AVStoDVD\FFmpeg" folder and rename the original "ffmpeg.exe"
to "_ffmpeg.exe". This name is hard coded into the script and cannot
be changed.

2. Extract the two files "ffmpeg.exe.vbr" and "ff_vbr.bat" into this folder,
then rename "ffmpeg.exe.vbr" to "ffmpeg.exe".



Usage:

With the AVStoDVD default settings nothing changes at all (hopefully).
For medium and lower bitrates the HCenc encoder is used by default.
If you override this setting and force ffmpeg CBR, now ffmpeg will operate
in 1-pass VBR mode instead.

If your bitrate is below 3500k AND you have activated the ffmpeg high
quality mode, ffmpeg will run in a high quality 2-pass VBR mode.
(command line parameters courtesy of Fishman0919)
Download here: //EDIT// Link removed

I have tested it quite a bit with ffmpeg version 2.1.1, on my Windows XP machine it is very stable. I do not know however if renaming ffmpeg.exe in a folder under "program files" will work under Win7 or Win8. If it doesn't, you probably know the usual workarounds (Take Ownership or install AVStoDVD outside of program files). The script itself only writes into the specified output folder which should not be a problem.

The provided "ffmpeg.exe.vbr" is just a compiled batch file which only calls ff_vbr.bat. Not too elegant, but "ffmpeg.exe" is hard coded into the AVStoDVD executable, and I really did not want to patch the executable.


There are a couple of things I noticed while I made this thing, maybe one of you guys has some answers:

I noticed that AVStoDVD sets a buffer size of 2000k by default. According to the DVD specs this is a little high, it should be 1835k according to Hank315. Is there a special reason for this?

In 2-pass mode using Fishmans parameters, ffmpeg issues a warning:
Quote:
ME_MAP size may be a little small for the selected diamond size
Is this something serious or should I ignore it?

When I was comparing 1-pass VBR mode to good old QuEnc I noticed that ffmpeg has a tendency to undersize quite a bit, sometimes by almost 20%. This was for an already low bitrate of 3900k. While QuEnc 1-pass and HCenc 1-pass both had no problems, ffmpeg only reached a bitrate of a little over 3000k.

I then tried to specify a minimum quantizer of 1, but it did not help very much. Are there any parameters I can use to avoid this undersizing without compromising speed?


Whatever, please test my little tool and let me know what should be improved....


Cheers
manolito

Last edited by manolito; 18th January 2014 at 16:51.
manolito is offline   Reply With Quote