View Full Version : set audio compression on single track
alex.brown111@hotmail.com
27th July 2021, 19:06
Hi,
I have some MKV files with multiple audio tracks.
I need to set audio compress level like this:
ffmpeg.exe -i title_t00.mkv -c:a copy -compression_level 2 output.mkv
but not to all audio but only the English track (or better only the flac tracks)
There is a way to set audio -compression_level on X track and copy the rest ?
Thanks !
tebasuna51
27th July 2021, 22:44
https://trac.ffmpeg.org/wiki/Map
Something like to copy the first and recode the second:
ffmpeg.exe -i title_t00.mkv -map 0:v copy -map 0:a:1 copy -map 0:a:2 -c:a flac -compression_level 2 ... output.mkv
alex.brown111@hotmail.com
28th July 2021, 07:32
Thank you ,
I have found the solution myself:
ffmpeg.exe -i title_t00_.mkv -c:a:2 flac -map 0:v -map 0:a -compression_level:3 1 -t 30 output_DS9_comp_track_3_comp_1.mkv
however I still search a solution to select the track by language.
I don't sure if exist a method becouse actually I need to remember:
c:a:X
compression_level:X+1
that sometimes may cause confusion.
Richard1485
28th July 2021, 08:36
however I still search a solution to select the track by language.
Maybe there's a more efficient method, but a two-step process should work.
ffmpeg.exe -i title_t00.mkv -vn -sn -map 0:a:m:language:eng -c:a flac -compression_level 2 -f matroska - | ffmpeg.exe -i title_t00.mkv -i - -map 0 -map -0:a:m:language:eng -map 1 -c copy output.mkv -y
The first process selects the audio English tracks, encodes them as flac, and pipes the output to the second process, which (a) disables all English audio tracks in the original file but copies everything else (b) copies the piped tracks.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.