0

After trying to find a solution for this for about two hours now I have to ask here or I'm going mad.

I have a video with these tracks:

Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
Stream #0:1(deu): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
Stream #0:3(eng): Subtitle: hdmv_pgs_subtitle

I'd like to convert the video to x265, copy the first audio track (0:1), convert the second audio track (0:2) to ac3 and copy the subtitle track.

After a lot of reading, searching and trying my most promising try looks like this:

ffmpeg -i source.mkv -map 0:v -profile:v main -c:v libx265 -preset slow -vsync vfr -x265-params "crf=22:rc-lookahead=50" -map 0:a:1 -c:a:1 ac3 -b:a:1 640k -map 0:a:0 -c:a:0 copy -map 0:s -c:s copy target.mkv

Everything works fine except the conversion of the DTS audio track to AC3. The result of the command above:

Stream #0:0(eng): Video: hevc (Main), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc
Stream #0:1(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
Stream #0:2(deu): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
Stream #0:3(eng): Subtitle: hdmv_pgs_subtitle

The English audio track becomes swapped with German one, but nothing else changes.

I'm looking for a solution to convert the DTS track to AC3 while just copying the other audio AC3 track. I'm using ffmpeg 4.1.6.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.