r/ffmpeg•
Tal_Star

Can someone help me with this so it will only copy English audio tracks

For the command bellow is there a way to make it so it will only copy EN audio tracks. Currently I manually remove the extra audio tracks using MKVtoolbox. The audio track is not always in the same space so can't just use a hard copy Track x

for /R %%g in (*.mkv) do (

if not exist "A:\1080p%%~pg" md "A:\1080p%%~pg"

ffmpeg -hide_banner -loglevel error -stats -threads 16 -hwaccel cuda -i ^

"%%~g" -c:v hevc_nvenc -vtag hvc1 -preset slow -tier high ^

-rc vbr -b:v 4M -maxrate 6M -bufsize 20M -qmin 15 -qmax 25 -surfaces 32 -rc-lookahead 48 ^

-c:a libopus -vbr on -b:a 160k -frame_duration:a 40 ^

-af "aresample=resampler=soxr:precision=33:osf=flt:osr=48k:ochl=stereo,asetnsamples=1920:true" ^

-c:s copy -c:t copy -n "A:\1080p%%~pg%%~ng.mkv" )

Posted Jan 11, 2025, 7:23 PM UTC

11
vegansgetsick•

It's -map a:m:language:eng

3