Solvedspksrc FFmpeg EAC3 and/or DTS support in Video Station for DSM 6.x

For new Package Requests, see the guidelines

Setup

Package Name: FFmpeg
_Package Version:_3.3.3-7

_NAS Model:_DS916+
_NAS Architecture:_Intel
_DSM version:_6.1.3-15152 Update 6

Expected behavior

Playback of video with Dolby tracks in DS Video work without issue

Actual behavior

Playback error "failed to play the video because the file format of the currently selected audio track is not supported" (for EAC3).

Steps to reproduce

_1._Launch DS Video
_2._Select video with EAC3 audio
_3._Play

Package log

Check Package Center or /usr/local/{package}/var/

n/a

Other logs (attempted a re-install)

E.g. /var/log/messages or /var/log/synopkg.log

2017/10/08 16:46:44	uninstall ffmpeg: begin to stop version 3.3.3-7
2017/10/08 16:46:45	uninstall ffmpeg 3.3.3-7 Begin start-stop-status stop
2017/10/08 16:46:45	uninstall ffmpeg 3.3.3-7 End start-stop-status stop ret=[0]
2017/10/08 16:46:45	uninstall ffmpeg 3.3.3-7 Begin unload apparmor
2017/10/08 16:46:45	uninstall ffmpeg 3.3.3-7 End unload apparmor ret=[0]
2017/10/08 16:46:45	uninstall ffmpeg: stop version 3.3.3-7 successfully, result 0
2017/10/08 16:46:45	uninstall ffmpeg 3.3.3-7 Begin preuninst
2017/10/08 16:46:45	uninstall ffmpeg 3.3.3-7 End preuninst ret=[0]
2017/10/08 16:46:45	uninstall ffmpeg 3.3.3-7 Begin /bin/rm -rf /volume1/@appstore/ffmpeg
2017/10/08 16:46:46	uninstall ffmpeg 3.3.3-7 End /bin/rm -rf /volume1/@appstore/ffmpeg ret=[0]
2017/10/08 16:46:46	uninstall ffmpeg 3.3.3-7 Begin postuninst
2017/10/08 16:46:46	uninstall ffmpeg 3.3.3-7 End postuninst ret=[0]
2017/10/08 16:46:46	uninstall ffmpeg: Uninstall 3.3.3-7 successfully
2017/10/08 16:47:21	install ffmpeg 3.3.3-7 Begin preinst
2017/10/08 16:47:21	install ffmpeg 3.3.3-7 End preinst ret=[0]
2017/10/08 16:47:21	install ffmpeg 3.3.3-7 Begin /bin/mv -f /volume1/@tmp/pkginstall/package /volume1/@appstore/ffmpeg
2017/10/08 16:47:21	install ffmpeg 3.3.3-7 End /bin/mv -f /volume1/@tmp/pkginstall/package /volume1/@appstore/ffmpeg ret=[0]
2017/10/08 16:47:21	install ffmpeg 3.3.3-7 Begin /bin/rm -rf /var/packages/ffmpeg
2017/10/08 16:47:21	install ffmpeg 3.3.3-7 End /bin/rm -rf /var/packages/ffmpeg ret=[0]
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 Begin /bin/mkdir -p /var/packages/ffmpeg
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 End /bin/mkdir -p /var/packages/ffmpeg ret=[0]
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 Begin /bin/mv -f /volume1/@tmp/pkginstall/INFO /var/packages/ffmpeg/INFO
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 End /bin/mv -f /volume1/@tmp/pkginstall/INFO /var/packages/ffmpeg/INFO ret=[0]
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 Begin /bin/rm -rf /var/packages/ffmpeg/scripts
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 End /bin/rm -rf /var/packages/ffmpeg/scripts ret=[0]
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 Begin /bin/mv -f /volume1/@tmp/pkginstall/scripts /var/packages/ffmpeg/scripts
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 End /bin/mv -f /volume1/@tmp/pkginstall/scripts /var/packages/ffmpeg/scripts ret=[0]
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 Begin /bin/rm -rf /var/packages/ffmpeg/conf
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 End /bin/rm -rf /var/packages/ffmpeg/conf ret=[0]
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 Begin /bin/mv -f /volume1/@tmp/pkginstall/conf /var/packages/ffmpeg/conf
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 End /bin/mv -f /volume1/@tmp/pkginstall/conf /var/packages/ffmpeg/conf ret=[0]
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 Begin postinst
2017/10/08 16:47:22	install ffmpeg 3.3.3-7 End postinst ret=[0]
2017/10/08 16:47:24	install ffmpeg: begin to start version 3.3.3-7
2017/10/08 16:47:24	install ffmpeg 3.3.3-7 Begin pre-load apparmor
2017/10/08 16:47:24	install ffmpeg 3.3.3-7 End pre-load apparmor ret=[0]
2017/10/08 16:47:24	install ffmpeg 3.3.3-7 Begin start-stop-status start
2017/10/08 16:47:24	install ffmpeg 3.3.3-7 End start-stop-status start ret=[0]
2017/10/08 16:47:24	install ffmpeg: start version 3.3.3-7 successfully, result 0
2017/10/08 16:47:24	install ffmpeg 3.3.3-7 Begin /bin/rm -rf /volume1/@tmp/pkginstall
2017/10/08 16:47:24	install ffmpeg 3.3.3-7 End /bin/rm -rf /volume1/@tmp/pkginstall ret=[0]
2017/10/08 16:47:24	install ffmpeg 3.3.3-7 successfully
52 Answers

✔️Accepted Answer

Well I did the rollback to version 2.3.4-1468 and the EAC3 audio is once again transcoding. For those who are unsure about the process, the steps I took were as follows:

  1. Check for the binary for your Synology and download the previous version

For me I use a Synology DS916+ so this was:
(a) Checking https://www.synology.com/en-global/support/download/DS916+#packages
(b) Identifying the previous version using https://www.synology.com/en-global/releaseNote/VideoStation?model=DS916%2B
(c) Manually altering the download link on the packages page to https://global.download.synology.com/download/Package/spk/VideoStation/2.3.4-1468/VideoStation-x86_64-2.3.4-1468.spk

  1. Uninstall the existing Video Station in Package Centre (be sure that the remove database checkbox is unchecked)
  2. Perform a manual install with the downloaded package file

As an update to the ticket with Synology they closed it as a feature request with the following generic reply: "We have sent up your concerns with the ffmpeg process in DSM 6.2 beta and your desire to source the ffmpeg off the $PATH or some other mechanism that allowed third party versions to be used, to our features and development team."

I also did a bit of experimenting with the downgraded version following in the steps of @cr03. My output for the 'ffmpeg' in Video Station was as follows:

/var/packages/VideoStation/target/bin$ ffmpeg -encoders | grep eac3
ffmpeg version 2.7.1 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.3 (crosstool-NG 1.20.0) 20150311 (prerelease)
  configuration: --prefix=/usr --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-shared --disable-static --enable-version3 --enable-nonfree --enable-libfaac --enable-encoders --enable-pthreads --disable-bzlib --disable-protocol=rtp --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffserver --disable-ffplay --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-vaapi --disable-decoder=amrnb --disable-encoder=zmbv --disable-encoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=dca --disable-decoder=eac3 --disable-decoder=truehd --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100

I don't see any output in the ps auxwf | grep ffmpeg which helps me understand which 'ffmpeg' was being used. Perhaps you guys can help?

root     24877  0.0  0.0  23116   972 pts/3    S+   08:15   0:00                      \_ grep --color=auto ffmpeg
root     24855 99.2  0.1 117124 14396 ?        Rl   08:14   0:03  \_ /var/packages/VideoStation/target/bin/ffmpeg -ss 633.258 -i /volume1/video/[...].mkv -threads 0 -vcodec copy -vsync 2 -vbsf h264_mp4toannexb=repeatheader -acodec libmp3lame -ab 256k -ac 2 -f ssegment -segment_format mpegts -segment_list_type m3u8 -hls_seek_time 633258 -segment_time 8 -segment_time_delta 1.258 -segment_start_number 00079 -avoid_negative_ts 0 -break_non_keyframes 0 -map 0:0 -map 0:1 /tmp/VideoStation/HLS/[...]/slice-%05d.ts

Other Answers:

Team, thanks for all your feedback on this. As suggested this needs to be resolved by Synology and I have logged a ticket regarding same. The details of the ticket are as follows:

Problem Explanation:

Summary: Latest compatibility update for DSM 6.2 beta breaks third-party 'ffmpeg' engines

Detail: Prior to the latest udpate (Version: 2.3.5-1471), users were able to install third party engines like the one from SynoCommunity. It appears that Video Station now includes an older embedded ffmpeg at '/volume1/[at]appstore/VideoStation/bin/ffmpeg' which overides the one from SynoCommunity (https://synocommunity.com/package/ffmpeg).

From preliminary analysis the embedded version in Video Station is version 2.7.1 whereas the SynoCommunity version is v3.3.3. It is thought that in the previous architecture that Video Station used to source the ffmpeg off the $PATH or some other mechanism that allowed third party versions to be used. I am hoping that consideration can be given to allowing this setup once again.

Problem Reproduce Steps:

Launching Video Station and playing media files with esoteric media formats like EAC3 for audio results in an error "failed to play the video because the file format of the currently selected audio track is not supported". Prior to the latest update with the SynoCommunity ffmpeg install this worked flawlessly.

I'll update the team once I receive a response.

Hi all,

Exchanges on this threads where really awesome, thnx to all who shared ideas and helped improving or testing the various scripts & new package sets. Changes are now all pushed spksrc upstream and official package are to be made available in the next few weeks.

I believe that the originating problem is now fully resolved (and a few other bits as well). Closing the thread.

Again thnx to all.

cr03
106

I believe a recent DSM update may have included an architecture change by Synology?

I don't have a "before picture" but, I believe VideoStation used to source the ffmpeg off the $PATH?

Now it looks like Synology are embedding ffmpeg at /volume1/@appstore/VideoStation/bin/ffmpeg.

As expected, I couldn't find anything in spksrc that hinted perhaps the packages used to make accommodations for this by - say - overriding Synology's choice of ffmpeg for VideoStation? Doing so might be inelegant, anyway.

$ /volume1/\@appstore/VideoStation/bin/ffmpeg -encoders | grep eac3
ffmpeg version 2.7.1 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.3 (crosstool-NG 1.20.0) 20150311 (prerelease)
  configuration: --prefix=/usr/pkg --incdir='${prefix}/include/ffmpeg' --arch=i686 --target-os=linux --cross-prefix=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --enable-cross-compile --enable-optimizations --enable-pic --enable-gpl --enable-version3 --enable-nonfree --enable-libfaac --enable-encoders --enable-pthreads --disable-muxer=image2 --disable-muxer=image2pipe --disable-swscale-alpha --disable-ffplay --disable-ffserver --disable-doc --disable-devices --disable-bzlib --disable-altivec --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libmp3lame --disable-decoder=amrnb --disable-encoder=zmbv --disable-encoder=dca --disable-encoder=ac3 --disable-encoder=ac3_fixed --disable-encoder=eac3 --disable-decoder=eac3 --disable-encoder=truehd --disable-decoder=truehd --cc=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ccache-gcc --enable-shared --disable-static --enable-yasm --enable-libx264 --enable-encoder=libx264
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
$

You may notice eac3 has been disabled in the build arguments by Synology.

After backing up the vendor's binary, I boldly attempted to ln and then just plan mv the SynoCommunity ffmpeg version 3.3.3 into the VideoStation package... neither worked, so I asked myself why....

A ps auxwf while streaming yielded the arguments used by VideoStation to invoke ffmpeg for transcode. I tried to replicate the same invocation of the ffmpeg process from shell. I got Unrecognized option 'hls_seek_time'. Perhaps this argument has been deprecated, and I can see that VideoStation is making assumptions about the ffmpeg version that aren't going to be easily reconciled.

I empathize with @cytec that it's not feasible to provide what @houndtt and I are looking for in a sustainable way. I - or someone else - might be motivated to compile an older version of ffmpeg with eac3 to attempt a drop-in replacement.

FYI: I have just followed this https://gist.github.com/BenjaminPoncet/bbef9edc1d0800528813e75c1669e57e#gistcomment-3119240 instructions and on my DS 718+ most of things are working:

  • BDMV, mkv, avi
  • srt subtitles
  • FDH and 4k (incl. hdr)
  • AC3, DTS (HDMA), DD (TrueHD/Atmos)
    They transcode all to FHD+Stereo with use of HW acceleration (almost no CPU load)

What is not working: iso files.