Log in

View Full Version : Copy & convert audio tracks to FLAC with ffmpeg BUT keeping original audio tracks ?


N'Cha
21st September 2023, 16:44
Hi

Is it possible to encode a movie with ffmpeg but to keep the audio tracks that are in DTS-HD and/or Dolby truHD intact BUT at the same time, to create a copy of these tracks, that are converted into FLAC all that happening while I'm doing my encode, not post-encode with MKVtoolnix?

Let's say my remux has:
Audio Track 1: Japanese DTS-HD 2.0
Audio Track 2: English DTS-HD 5.1

when doing my encode i'd like the encoded video to have
Audio Track 1: Japanese DTS-HD 2.0
Audio Track 2: English DTS-HD 5.1
Audio Track 3: Japanese FLAC 2.0
Audio Track 4: English FLAC 5.1

Thank you

Kisa_AG
22nd September 2023, 14:17
Hi

Is it possible to encode a movie with ffmpeg but to keep the audio tracks that are in DTS-HD and/or Dolby truHD intact BUT at the same time, to create a copy of these tracks, that are converted into FLAC all that happening while I'm doing my encode, not post-encode with MKVtoolnix?

Let's say my remux has:
Audio Track 1: Japanese DTS-HD 2.0
Audio Track 2: English DTS-HD 5.1

when doing my encode i'd like the encoded video to have
Audio Track 1: Japanese DTS-HD 2.0
Audio Track 2: English DTS-HD 5.1
Audio Track 3: Japanese FLAC 2.0
Audio Track 4: English FLAC 5.1

Thank you

I think, yes. Something like that:
ffmpeg -i Input.mkv -map 0:v -c:v libx264 -crf 22 etc. -map 0:a -c:a copy -map 0:a:0 -c:a:2 flac -map 0:a:1 -c:a:3 flac Output.mkv

N'Cha
23rd September 2023, 20:19
Thanks that worked! (though strange behavior with MPC where the flac audio has a lower volume + if i switch to it, then all the audio language selection disapear. I don't have that problem with VLC