Problem:

Some Plex players do not give Plex full access to the OS/hardware for DTS decoding. This means that Plex will then have to transcode the audio which can mean lots of buffering or in the case of the Xbox One X will force 4K video to be transcoded to 1080p. You may also find that If you don’t have a true 5.1 channel audio system (such as some soundbars) you may find that DTS soundtracks are quiet when used with media players suck as Kodi, Plex or Windows media player. As the Xbox One X fully supports Plex using AC3 the solution below also solved many audio sync issues for me that seemed to occur when the DTS audio was being transcoded. After running my .mkv files through the below script I had an .mkv file that I could play on Xbox One X which had clear/loud audio, would direct play (including 4K HDR) and had no audio sync issues.

Solution:

There was no solution I could find within the applications or the audio systems to correct this. The only solution was to re-encode the audio track using FFmeg. The below script takes a DTS audio track from a file and re-encodes it to 5.1 channel AC3. For me this made the soundtrack much louder and especially made a difference to dialog. Fortunately using this method means that you only have to re-encode the audio not the video so only takes a few minutes even on an old core i5.

In it’s the simplest form you can just use the command as below:

C:\ffmpeg\bin\ffmpeg.exe -i "F:\temp\Video.mkv" -map 0 -vcodec copy -scodec copy -acodec ac 3 -b:a 640 k "c:\temp\Video.mkv"

This script will ask you for a path to a file and then convert the file entered from DTS to AC3

Add-Type -AssemblyName Microsoft.VisualBasic $Filepath = [Microsoft.VisualBasic.Interaction] :: InputBox( 'Enter file path' , 'File Path' ) $NewFilepath = $Filepath -replace ( "`"" , "" ) $source = Get-ChildItem -path $NewFilepath -Recurse -Include *.mkv, *.mp4, *.avi $ffpath = "C:\ProgramData\chocolatey\lib\ffmpeg\tools\ffmpeg\bin\ffmpeg.exe" $DirOut = "D:\Temp" $output = Join-Path $DirOut -ChildPath (( Get-Item $source ).basename + ".mkv" ) & $ffpath -i $source -map 0 -vcodec copy -scodec copy -acodec ac3 -b : a 640k $output -loglevel 8 -stats

The script below will simply convert any .mkv file that you drop into the ‘Convert’ folder from DTS to AC3:

$source = Get-ChildItem -path "F:\Convert*" -Recurse -Include *.mkv $ffpath = "C:\ProgramData\chocolatey\lib\ffmpeg\tools\ffmpeg\bin\ffmpeg.exe" $DirOut = "F:\Converted" $output = Join-Path $DirOut -ChildPath (( Get-Item $source ).basename + "_out.mkv" ) & $ffpath -i $source -map 0 -vcodec copy -scodec copy -acodec ac3 -b : a 640k $output -loglevel 8 -stats

This code will allow you to drop in a number of files and loop through all the .mkv files converting the soundtracks from DTS to AC3:

$sources = Get-ChildItem -path "F:\Convert*" -Recurse -Include *.mkv $ffpath = "C:\ProgramData\chocolatey\lib\ffmpeg\tools\ffmpeg\bin\ffmpeg.exe" foreach ( $source in $sources ) { $DirOut = "D:\Temp" $output = Join-Path $DirOut -ChildPath (( Get-Item $source ).basename + ".mkv" ) & $ffpath -i $source -map 0 -vcodec copy -scodec copy -acodec ac3 -b : a 640k $output -loglevel 8 -stats}







