[FFmpeg-user] encode five wav files to one Dolby Prologic II encoded file

Martin Thomas Schrott list at mtsonline.at
Thu Mar 23 12:13:46 EET 2023


Hi,


if anyone needs it - here is the sample extended with manual phaseshift:

https://forum.doom9.org/showthread.php?t=184793


best wishes

Martin


Am 14.03.2023 um 15:09 schrieb Martin Thomas Schrott:
> Hi guys,
>
>
> okay I realiced how to get five separate wav files into one stream:
>
> ffmpeg -i $fl -i $fr -i $fc -i ${bl}_shift.wav -i ${br}_shift.wav 
> -filter_complex "[0:0][1:0][2:0][3:0][4:0]amerge=inputs=5, 
> aresample=matrix_encoding=dplii" out.wav
>
>
> but I am still not getting correct dplii encoded channels.
>
>
> Anyone an idea what I am doing wrong?
>
>
> * how would I do the phaseshift correctly?
>
> * does matrix_encoding=dplii do the mixing or do I have to add another 
> command ... what does matrix_encoding=dplii do exactly?
>
>
> thanks for any help
>
> Martin
>
>
>
> Am 05.03.2023 um 20:18 schrieb Martin Thomas Schrott:
>> Hey Guys,
>>
>>
>> after days of reading documentary, searching the net and all lists, 
>> trying and loosing, I hope someone here can help me to succeed.
>>
>>
>> I read, some say ffmpeg is not capable of encoding, others say ffmpeg 
>> can do it. Some say it misses the phaseshift of the surround 
>> channels, others and the docu tell, it can.
>>
>> So after all I found, I would guess ffmpeg should be able to take 
>> five wav files as input and output one wav file in stereo, that is 
>> correctly dolby Prologic II encoded including the phaseshifts. But I 
>> cannot find how this has to be done to work correctly and there is 
>> not a single example anywhere to be found.
>>
>>
>> I tryed countless ways so I post one of them and hope you can guide 
>> me where to go or what to change to be successful. :-)
>>
>>
>> This one is with manual phaseshift of the default 0.0 that should be 
>> 90 degrees for the two back channels, as nowhere is stated if the 
>> matrix_encoding does apply this automatically.
>>
>> /Applications/ffmpeg -y -i bl.wav -af aphaseshift bl_phaseshift.wav
>>
>> /Applications/ffmpeg -y -i br.wav -af aphaseshift br_phaseshift.wav
>>
>>
>>
>> /Applications/ffmpeg -y -i fl.wav -i fc.wav -i fr.wav -i 
>> bl_phaseshift.wav -i br_phaseshift.wav -map 0 -map 1 -map 2 -map 3 
>> -map 4 -af aresample=matrix_encoding=dplii surround.wav
>>
>>
>> it gives an error, that a wav file exactly expects one stream. I 
>> thought the matrix_encoding would output the five wav files in one 
>> stereo stream?
>>
>> If I change to .aac as output I would get a file, but this would not 
>> be a correctly encoded Dolby Prologic II file. This would have 
>> distroyed back channels.
>>
>> Same if I do not apply the phaseshift manually.
>>
>>
>> So I am doing something wrong - anybody here who can help me to find 
>> the correct commands?
>>
>> Would be so thankful. I also did not find a working solution without 
>> ffmpeg, so if someone has an alternative this also would be okay - 
>> even I would prefer the ffmpeg way :-)
>>
>>
>>
>> best wishes,
>>
>> Martin
>>
>>
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list