Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
31st October 2014, 15:45 | #1 | Link |
Registered User
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
|
h264levl - automatically ensuring level-conformance for H.264 encodes
Here is something I started, partly to fulfil a need and partly to explore Windows shell scripting. As it may be useful to others too, I'm taking the liberty of sharing it here.
The main aim of the attached utilities is to automatically ensure the H.264 level-conformance of arbitrary encodes. In other words, the utilities make it unnecessary to guess and/or discover the required settings through trial-and-error test encodes. Automatically ensuring level-conformance is useful for various reasons:
Here is an example of how h264level can be called from another script: Code:
... setlocal enableextensions setlocal enabledelayedexpansion ... rem Calculate H.264 level and maxref rem -------------------------------- for /f "usebackq tokens=1* delims==" %%i in (`"call h264levl %WIDTH% %HEIGHT% %FPS% %BITRATE% %PROFILE% 1 1 "`) do ( if /i [%%i] == [level] ( set LEVEL=%%j ) else if /i [%%i] == [maxref] ( set MAXREF=%%j ) else if /i [%%i] == [x264maxref] ( set XMAXREF=%%j ) ) rem Check successful parsing set PARLIST= for %%i in (LEVEL MAXREF XMAXREF) do ( if [!%%i!] == [] ( if not [!PARLIST!] == [] set PARLIST=!PARLIST!, set PARLIST=!PARLIST!'%%i' ) ) if not "%PARLIST%" == "" ( set ERRMSG=Unable to calculate legal value/s for %PARLIST%^^! goto ERRPAUSE ) ... Although FFx264 uses ffmpeg for encoding, its syntax is readily adapted for e.g. x264. Extract the files and double-click for instructions. Known restrictions * These utilities have only been properly tested on 8-bit video Last edited by fvisagie; 2nd November 2014 at 11:09. Reason: Removed temporary download link |
Thread Tools | Search this Thread |
Display Modes | |
|
|