利用第三方FFMPEG解码器让群晖的Video Station完美支持DTS、EAC3、TrueHD

       群晖公司由于版权的原因,群晖自带的Video Station无法播放带有DTS、EAC3、TrueHD等编码格式的视频文件,严重影响使用效果。本文将利用第三方的ffmpeg替换VideoStation中自带的ffmpeg解码器,完美播放带有DTS、EAC3、TrueHD等编码格式的视频,实现对全视频格式的支持。

一、安装ffmpeg解码器

1、在群晖套件中心,设置,套件来源,新增,名称(任意写),位置:http://packages.synocommunity.com

 

 

如果按照上述方法不能正常安装ffmpeg套件的,可以到这个地址:https://github.com/th0ma7/synology/tree/master/packages
请根据自己的CPU架构下载对应的ffmpeg安装包,上传到群晖的套件中心安装,目前常见的构架有:

(1)DS918+的CPU架构是apollolake

(2)DS3617xs的CPU架构是broadwell

(3)DS3615xs的CPU架构是bromolow

其他的CPU架构与之对应的版本可以在这查询:https://github.com/SynoCommunity/spksrc/wiki/Architecture-per-Synology-modelffmpeg

 

二、安装VideoStation
在套件中心安装Video Station,本文安装的Video Station版本为2.4.7-1603。

 

 

三、我们先来测试一下没修改之前,用Video Station播放带有DTS和EAC3编码的视频文件,会是怎样的

这个是带EAC3编码的视频文件

 

 

用Video Station播放EAC3编码的界面提示

 

 

这个是带DTS编码的视频文件

 

 

用Video Station播放DTS编码的界面提示

 


四、用第三方的FFMEG代替

进群晖的控制面板,终端机和SNMP,勾选启动SSH功能,并调整对应的端口号。然后到电脑上打开XSheell软件,用root用户以SSH的方式登录到群晖(还没开启root的,请自己去开启:https://wp.gxnas.com/?s=root),执行以下命令:

1、调整文件权限

sudo chmod +s /var/packages/ffmpeg/target/bin/ffmpeg
sudo chmod +s /var/packages/ffmpeg/target/bin/ffprobe
sudo chmod +s /var/packages/ffmpeg/target/bin/vainfo

 

2、备份原文件

sudo sed -i'-BACKUP' -e 's/eac3/ZAAP/' -e 's/dts/ZAP/' -e 's/truehd/ZAPZAP/' /var/packages/VideoStation/target/lib/libsynovte.so
sudo mv /var/packages/VideoStation/target/bin/ffmpeg /var/packages/VideoStation/target/bin/ffmpeg-BACKUP
sudo mv /var/packages/VideoStation/target/bin/ffprobe /var/packages/VideoStation/target/bin/ffprobe-BACKUP
sudo mv /var/packages/VideoStation/target/bin/vainfo /var/packages/VideoStation/target/bin/vainfo-BACKUP

 

3、更改/var/packages/VideoStation/target/ffmpeg为自定义脚本,调用第三方的ffmpeg解码器(命令已经更新,下图为之前的截图,命令有区别请忽略)

echo "H4sICJ6oBF8AA2ZmbXBlZy13cmFwcGVyAO1abXPbNhL+LP4KhKVf5Jimybn7ogwz8dlKqklcayzHnU7ioyASlFhTJEtQVFzH/70LAqT4KjltrzO9qWeSSMCziwfAg8Vine9eaDMv0GaYLiQpJqkp64YsSZYfzg/7j1KP2IsQycqhgxOCDl7u/aTuLdU9B+19P9i7HOxNDvpIRcojTWKCl57zxL7pMnr9GmnJMtJcdxmR+Ql4k564VyvCMS67BvRX5Ia+g9Q10o1T+EaJg2Sq/ffkSNG+aejix0T7WieLhMTLjEG8LPerJV8nNHFIHEs9RhnJR0dH6P3ow4fz70cfLhB8k6Xevef7SL0ZXl/CJOyF5zuR58jIeK05JNWCle+zwZIYRygbEU1G7xhaknBsL8zpKsBLglQs5ntAtZMj+hCEMOCDpWkH0G6vEqRCl3WAVBfpUynA9HcYGlMJqJmKIrG1X6bUVN5IfKqmrDy+GSBVf5KlfPKm/PbtpcImI4E0dFNLcaxF2L7Hc0LFWmkJjuckybTDWxjWqGFvPYeEkwQnXhg0LdT/nJ2//ziG5ZhT87AvSakdOsQ25fdXoMA1rChBnz4h5TukzhN0iu7uJCeUbEwJV40XSD3V60u9Hl14bgL/LsPUIybrhC/M7UvzUFY9OcMD8NUrsFissW0Tv2wnmhqWor1qTzOWZXMqeNeseXPV2C3bue12btVkiaOyUQGD9gLY8xz4ak6zI6XoGwUMxP4DwkWfAJ4KUiZiy4zuXqFkQWAhez2x+tPd2x3F4QwEmCI4IWGMVEp8YicW1w9FSkYGmhfh2iJBEnuEIiG3bAyLCzh0kUNcvPITMwij2As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7QYKbtuA4qH/xVquvnjB3PplRVaQe3u/Ng5sPmwruH3g7dCuGkO+EJUyQ/liaXakzcJE5dkoXOYlC56ZiJcdS09YllLLTPLBZitXsNZPjX/d59l6OVHgyEpikW/RbuO09KatZC7dbkuJSNsrOEvAPZaDy1R7/CzDK/ezPFAe4aH7dPxZXuDYWeOYsOMTZJUi6E3iFTl+LtjFQPNYk3kJs1JqIwGe+cRhb2kIK+QLsVn8g/c0q6S+3KNTScpXf1MOoqtZ7EXFDvSkvPj59u3lePiOv4tZkU/OO86vLobn4sEsHOVd47Prs8vbCXSJpqzsCwOKCiS0Sr3MW+VtjfZf76jIon1JIr5g727YL38G/O8l7/6l5EFc+Ui3OQsgwTN6dFh9PPYLVmclLP5mwnmJ42Io6uM/Xp+N5Y5V0quefxxzz5k33eRThsPMZt0yHljz5dHz5RHYZ64QnCgpr6ebygtRnclK76xUBBSLaru0xl6y+Z7Jeh6TCOBhkJKYwmlALrufnBfyrqG/fhW2w6zWFkYkgJiJYBcS8PQN9h+DmNjhPICY44AbXvd4rvEoSLHvOSirYrnhKnDQGhSNQA82oZQx8oJolezyKOJo+TcY/LcXwx/y32B0RgdhM7m5uPp4gxqymiawoll18N87SEzblDcejYdoclsTn94UH+8wmmc3U6WOWlQJ90W3KsvWRtnaENZGp7XR0LQYidVaKqHAyNufpfVeWei9bUrv1aXOjsk/cv+byP120iV3o0vu+nPkntI/IvdO60LuhazFSLnci2NgpN9y+f0j9/97uV9dj9515RVNWf112qEJbHnLaoCmEkIBfnhYhqiV5ev3keonSD/NXyd/4hIycp272PxdWtEl7f7fC78BTGYfI90hAAA=" | base64 -d | gunzip > /var/packages/VideoStation/target/bin/ffmpeg

 

4、更新ffprobe vainfo

sudo ln -s /var/packages/ffmpeg/target/bin/ffprobe /var/packages/VideoStation/target/bin/ffprobe
sudo ln -s /var/packages/ffmpeg/target/bin/vainfo /var/packages/VideoStation/target/bin/vainfo

 

5、解除对EAC3、DTS、TrueHD的屏蔽

sudo sed -i'-BACKUP' -e 's/eac3/ZAAP/' -e 's/dts/ZAP/' -e 's/truehd/ZAPZAP/' /var/packages/VideoStation/target/lib/libsynovte.so

 

6、调整文件权限

sudo chmod +x /var/packages/VideoStation/target/bin/ffmpeg
sudo chmod +s /var/packages/VideoStation/target/bin/ffmpeg
sudo chown root:VideoStation /var/packages/VideoStation/target/bin/ffmpeg

 

 

五、接下来我们再用Video Station来播放刚才未能播放的文件做一下测试

1、DTS播放正常

 

2、EAC3播放正常

六、非常完美!

 


如果DSM7.X版本要解决同样的问题,请参考《利用第三方解码器FFMPEG让群晖DSM7.X版本的Video Station支持DTS视频编码和EAC3音频编码》。