Page 1 of 1

add black bars on top and bottom

Posted: Sun Dec 30, 2018 2:16 pm
by xonar
Hello!

Using Win7 (x64)
ffmpeg-20181229-fccba32-win64-static

I want to add black bars on top and bottom so I can keep my own subtitles in bottom black area.
The mkv is 3840x1598 and I want to change that to 3840x2160.
Using ffmpeg the change works as desired exept for the colors that are washed out.

Mkv info: 3840*1598 (2:40:1 at 24.000 FPS, HEVC (Main [email protected]) (HDR10)
| Format: HEVC | Color space: YUV | Chroma subsampling 4:2:0 (Type 2) | Bit depth 10 bits | Bits/(Pixel*Frame): 0.127 |

Is it possible to add something in ffmpeg bat file to keep original colors?

This is the bat file I use:

Code: Select all

@echo off
set SOURCEPATH=X:\SOURCEPATH
set TARGETPATH=Y:\TARGETPATH

if not exist "%SOURCEPATH%" goto ErrorSource
if not exist "%TARGETPATH%" goto ErrorTarget

for %%i in ("%SOURCEPATH%\*.mkv") do (
  start/b/wait/low ffmpeg -i "%%i" -vf "pad=3840:2160:(ow-iw)/2:(oh-ih)/2" -c:v libx264 -preset slow -crf 10 -c:a copy 

"%TARGETPATH%\%%~ni.mkv"
  echo.
)
goto Exit

:ErrorSource
echo Source path "%SOURCEPATH%" does not exist.
goto :eof

:ErrorTarget
echo Target path "%TARGETPATH%" does not exist.
goto :eof

:Exit
echo Done.
echo.