VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. I've used MakeMKV to rip my library of DVDs to .MKV (mpeg2).

    A lot of the MKVs have surround 5.1 / 6.1 (DD / DTS) audio, which I want to convert to 2channel stereo, then convert to libx264 /mp4 with ffmpeg, using a front-end tool
    eg. ffmpeg Batch.

    What parameters (or tool) should I feed ffmpeg to convert the surround audio > stereo audio ?

    Thanks.
    Last edited by Frasier; 30th Jul 2021 at 01:19.
    Quote Quote  
  2. Originally Posted by Frasier View Post
    I've used MakeMKV to rip my library of DVDs to .MKV (mpeg2).

    A lot of the MKVs have surround 5.1 / 6.1 (DD / DTS) audio, which I want to convert to 2channel stereo, then convert to libx264 /mp4 with ffmpeg, using a front-end tool
    eg. ffmpeg Batch.

    What parameters (or tool) should I feed ffmpeg to convert the surround audio > stereo audio ?

    Thanks.
    Depends on your goal - is your goal is plain downmixing or downmixing with some spatial information coded - for first case conversion is quite trivial and you can rely on ffmpeg embedded automate by specifying "-ac 2" (literally 2 audio channels) within command line, if you wish to have better control over downmixing and perhaps use some non standard mix weights then you can manually specify something like this:
    Code:
    -af "pan=stereo|FL < FL+1.414FC+0.5BL+0.5SL+0.25LFE+0.125BR|FR < FR+1.414FC+0.5BR+0.5SR+0.25LFE+0.125BL"
    in case where your goal is to keep spatial information you have two options, or try to downmix to Dolby Surround (Pro Logic II) you can try to do (not tested by me on Dolby Surround capable decoder):
    https://gist.github.com/kgriffs/ced13cf4d28938d34e1e3c80778f75a8

    Code:
    -af "aresample=matrix_encoding=dplii"
    Last method mostly suitable for headphone (but i use this as more general way to downmix multichannel to stereo) is to use HRTF funtion (SOFAlizer filter)

    Code:
    -af "aformat=channel_layouts=7.1,aresample=resampler=soxr:osr=48000:cutoff=0.99:dither_method=0,sofalizer=sofa=dodeca_and_7channel_3DSL_HRTF.sofa:gain=11:lfegain=9"
    SOFA file (dodeca_and_7channel_3DSL_HRTF.sofa) is available in VLC so before trying you can download VLC (portable one) and use embedded SOFA (HRTF) to verify how it will sounds at the end.

    I use SOFA method personally and it work subjectively well with all multichannel sources (resampler is add due modern high sample rate multichannel formats such as DTS HD MA, Dolby TrueHD etc) .
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!