Page 1 of 1

add black bars on top and bottom

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

Using Win7 (x64)

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

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 

goto Exit

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

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

echo Done.