Log in

View Full Version : DTS Downmixed to stereo with ffmpeg/libopus


verahert
4th April 2016, 06:11
Hello, i'm trying to encode some bluray h264 remux to vp9 webm. Actually i'm using this line for encoding:
ffmpeg -i /Rambo.mkv -c:v libvpx-vp9 -b:v 1400 -threads 8 -speed 1 -c:a libopus -b:a 96 -f webm /Rambo.webm

Problem is that the original audio is "DTS Master Audio, English, 7.1 channels, 24 bits, 48kHz" and when i run this line, ffmpeg reports that will generate libopus in 5.1 and i want it in Stereo

I tried putting --downmix-stereo but it doesn't work "Unrecognized option '-downmix-stereo' appear, i need help to determine the parameter to encode DTS to Opus in Stereo.

Thanks!

nevcairiel
4th April 2016, 09:46
Just add "-ac 2", then it'll downmix for you. (-ac is "audio channel")

verahert
4th April 2016, 14:02
Thanks! one more question, is it possible to encode it in 2 channels and Dolby Pro Logic II?

foxyshadis
4th April 2016, 21:32
You need one more flag: -af "aresample=matrix_encoding=dplii" Also note that it's 96000, not 96.

You should do some serious testing before adding pro-logic to opus, especially at such a low bitrate. I just tested on both a very artificial test sample (http://people.n0i.net/altblue/audio/Test%20AC3%20v2.0.avi) and a classical music sample (http://www.lindberg.no/hires/test/2L-056_03_mch_96kHz.flac), and noticed that in particular, center-rear (as in equal rear left and right) was just gone. At 128kbps, surround warbles like hell but it's there. I think you'd need a much higher bitrate to get good DPLII.

Opus has native surround, and many software and hardware players can do real-time downmixing to uncompressed DPLII. I think you should explore that option, instead of encoding DPLII in the video.