1

I have a series of MP4 files that I intend to compress into x265. The files have two audio tracks, to which a name and language is set.

I want the files compressed the video but keeping the audio tracks intact, including the name.

My current script compresses and preserves the languages, but loses the audio track names.

@echo off
setlocal enabledelayedexpansion


set FFmpegPath=ffmpeg.exe

:: Loop through all MP4 files in the current folder
for %%F in (*.mp4) do (
    echo list file: %%F
    echo make on: %%F

    :: Run ffmpeg for each MP4 file, converting to x265 with quality 19 and preserving all metadata, including track names (which it does not do)
    "%FFmpegPath%" -i "%%F" -c:v libx265 -crf 19 -c:a copy -map 0 -map_metadata 0 -map_chapters 0 "%%~dpF%%~nF_x265.mp4"

    echo Made %%F
)

pause
New contributor
AP2024 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4

0

You must log in to answer this question.

Browse other questions tagged .