Spksrc: Add apollolake support to ffmpeg package for DSx18+ Series [$40]

Created on 3 Oct 2017  路  22Comments  路  Source: SynoCommunity/spksrc

Setup

_Package Name: ffmpeg
_Package Version: v3.3.3-7

_NAS Model: DS218+, DS718+, DS918+
_NAS Architecture: Apollo Lake
_DSM version: 6.1

Expected behavior

Support for NAS devices (DS918+ specifically) with apollolake architecture in ffmpeg package.

Actual behavior

ffmpeg is currently not available for apollolake-based NAS devices in SynoCommunity package repo.

Notes:

It appears as though the toolchain for apollolake is available on the DSM 6.1 Tool Chains list

My goal is to test the transcoding and streaming capabilities of these devices using formats that require the ffmpeg package. Would like to see how the updated hardware transcoding competes with soft/hard transcoding through services like plex/emby/etc.

edit: I'm mostly looking to use the community ffmpeg package for DTS support. If there is another workaround that would also work.

Thank you for your time.

arch bounty dsm 6.0

Most helpful comment

@stephanlinke @m4tt075 Yes, work is in progress

All 22 comments

Bounty Added for this.

I tried to compile current version to apollolake toolchain but there is ARMv8 / AARCH64 specific issue with assembly compilation...
x264 assembly source code is specific to Apple compiler for iOS/macOS, a pity team ignores GNU linaro.

Sorry this comment concerns rtd1296, not apollolake which is x86_64 based so it should go straight forward.

@ChrisAnonymous : Hmh, unless this has changed, DSM should ship an ffmpeg version with hw encoding / decoding enabled, as this is what Synology's very own Videoplayer package is using to transcode. On my older DS415Play this version is located in the /bin folder. You might want to give that one a try. You can double-check the ffmepg configuration by logging into your NAS via ssh and running /bin/ffmpeg -version.

I agree. But stock version is compiled with many more --disable flags, and SynoCommunity with more --enable ones:

admin@DiskStation:~$ /bin/ffmpeg -version
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/i686-pc-linux-gnu/bin/i686-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/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-ccache-gcc --enable-yasm --enable-libx264 --enable-encoder=libx264 --enable-libh264_smd --enable-smd --disable-filter=hqdn3d --extra-libs='-lgdl -losal -lpal -lsven -lismd_core -lismd_audio -lismd_viddec -lismd_videnc -lismd_vidpproc -lplatform_config -lffmpeg_plugin -ljson-c '
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
admin@DiskStation:~$ /usr/local/ffmpeg/bin/ffmpeg -version
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.9.3 (crosstool-NG 1.20.0) 20150311 (prerelease)
configuration: --target-os=linux --cross-prefix=/spksrc/toolchains/syno-evansport-6.1/work/i686-pc-linux-gnu/bin/i686-pc-linux-gnu- --prefix=/usr/local/ffmpeg --extra-cflags=-I/spksrc/spk/ffmpeg/work-evansport-6.1/install/usr/local/ffmpeg/include --extra-ldflags=-L/spksrc/spk/ffmpeg/work-evansport-6.1/install/usr/local/ffmpeg/lib --extra-libs='-lxml2 -ldl' --pkg-config=/usr/bin/pkg-config --ranlib=/spksrc/toolchains/syno-evansport-6.1/work/i686-pc-linux-gnu/bin/i686-pc-linux-gnu-ranlib --enable-cross-compile --enable-rpath --enable-pic --enable-shared --enable-optimizations --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-fontconfig --enable-libass --enable-libbluray --enable-avresample --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-openssl --disable-debug --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-static --disable-txtpages --arch=i386 --enable-thumb
libavutil      55. 58.100 / 55. 58.100
libavcodec     57. 89.100 / 57. 89.100
libavformat    57. 71.100 / 57. 71.100
libavdevice    57.  6.100 / 57.  6.100
libavfilter     6. 82.100 /  6. 82.100
libavresample   3.  5.  0 /  3.  5.  0
libswscale      4.  6.100 /  4.  6.100
libswresample   2.  7.100 /  2.  7.100
libpostproc    54.  5.100 / 54.  5.100

@ymartin59 : Hey, are you running an evansport device? Asking because I just noticed the --enable-libh264_smd option in your DSM ffmpeg. That's what I have. This is non-standard, and refers to some non-disclosed patch Synology applied to ffmpeg to enable hw-transcoding with evansport devices. Has never been upstreamed into ffmpeg. Drove me insane trying to reproduce it. I have never managed to. This is also why I have given up on hw-transcoding with my own ffmpeg version some time ago, and the reason why I have been asking @ChrisAnonymous to check for the "maybe-not-so-vanilla" ffmpeg version shipping with DSM. For hw-transcoding-testing, that would be my starting point.

@m4tt075 I can check that in a couple hours since I don't have remote ssh setup at work.

But I primarily wanted a version of ffmpeg for DTS audio support since videostation stopped supporting the codec. Would the default ffmpeg have DTS support?

If there's another way to add DTS audio support or if that's an entirely different issue that may not involve an ffmpeg package, let me know and I will update the OP for this issue.

P.S. Apologies if my questions or requests are shortsighted. I'm still learning about Synology h/w transcoding capabilities and I'm new to the community packages as well.

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
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

@ChrisAnonymous : Right, DTS is an issue with the stock ffmpeg version to my knowledge.
Look, here is the (as of yet untested) apollolake build of the SynoCommunity package for manual installation:
https://www.dropbox.com/s/sjz27ylyrdwfhmf/ffmpeg_apollolake-6.1_3.3.3-7.spk?dl=0
It should install into /usr/local/ffmpeg/bin. Give it a try, and let us know how it goes...

Brilliant! Opened up some files in VidStation and DTS audio appears to be working great across various codec encodes. I will run some more thorough tests in the next day or so, but so far this package seems to do the trick. :)

@ChrisAnonymous When done, do not hesitate to close this issue. Thank you in advance.

@m4tt075 Hello. About your "evansport" question, I am really surprised optimization has not been ported upstream when Synology follows open source rules and publish their own changes. You can find ffmpeg source archive used to built evansport version at: https://sourceforge.net/projects/dsgpl/files/Synology%20NAS%20GPL%20Source/7321branch/evansport-source/

@m4tt075 the apollolake-6.1_3.3.3-7 build also works on my DS418play. Thanks for sharing. One thing I noticed is that when ffmpeg is converting (DTS and EAC3) all tracks are downmixed to stereo instead of 5.1 channel audio. I don't have this issue with regular AC3 tracks. This is the last hurdle, getting surround sound with DTS and EAC3 when that is working I will never update again.

DS418play
DSM 6.1.3-15152 Update 8
DS Video 2.3.4-1468 (downgraded for EAC3 support)
Using Chromecast connected to Marantz SR6006

@m4tt075 I tested the apollolake-6.1_3.3.3-7 build on DS 918+. So far so Good! :) I hope that a stable release with optimizations will be available in synocommunity repo soon. Thanks for your effort!!!

"Right, DTS is an issue with the stock ffmpeg version to my knowledge.
Look, here is the (as of yet untested) apollolake build of the SynoCommunity package for manual installation:
https://www.dropbox.com/s/sjz27ylyrdwfhmf/ffmpeg_apollolake-6.1_3.3.3-7.spk?dl=0
It should install into /usr/local/ffmpeg/bin. Give it a try, and let us know how it goes..."

Hi everyone. Noob here. I installed this version in Package Center -> Manual Install. It worked on my DS218+, then I uninstalled through the Package Center to go back to original settings of the NAS. But now every video I watch, when I go to Resource Monitor -> Task manager, it shows a high % use of CPU for FFMpeg even though I have uninstalled it. I am pretty sure that before it was showing high CPU use for DS video. Am I doing something wrong in he way I uninstalled FFMpeg?

@PEMAMETAL Using SSH, check if ffmpeg is left inside /usr/local/bin, then check whether your default ffmpeg command launches the default ffmpeg inside /usr/bin.
Useful command would be which -a ffmepg.

@ChrisAnonymous the current build for apollolake shows following infos on my DS918+

/usr/local/ffmpeg/bin/ffmpeg -version
ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 4.9.3 (crosstool-NG 1.20.0) 20150311 (prerelease)
configuration: --target-os=linux --cross-prefix=/spksrc/toolchains/syno-apollolake-6.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- --prefix=/usr/local/ffmpeg --extra-cflags=-I/spksrc/spk/ffmpeg/work-apollolake-6.1/install/usr/local/ffmpeg/include --extra-ldflags=-L/spksrc/spk/ffmpeg/work-apollolake-6.1/install/usr/local/ffmpeg/lib --extra-libs='-lxml2 -ldl' --pkg-config=/usr/bin/pkg-config --ranlib=/spksrc/toolchains/syno-apollolake-6.1/work/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-ranlib --enable-cross-compile --enable-rpath --enable-pic --enable-shared --enable-optimizations --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-fontconfig --enable-libass --enable-libbluray --enable-avresample --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-openssl --disable-debug --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-static --disable-txtpages --arch=x86_64 --enable-thumb
libavutil      55. 58.100 / 55. 58.100
libavcodec     57. 89.100 / 57. 89.100
libavformat    57. 71.100 / 57. 71.100
libavdevice    57.  6.100 / 57.  6.100
libavfilter     6. 82.100 /  6. 82.100
libavresample   3.  5.  0 /  3.  5.  0
libswscale      4.  6.100 /  4.  6.100
libswresample   2.  7.100 /  2.  7.100
libpostproc    54.  5.100 / 54.  5.100

I dont't know what is missing for the appololake arch to be shown in https://synocommunity.com/package/ffmpeg

It would be awesome if somebody would compile this with --enable-vaapi 馃槃

@stephanlinke @m4tt075 Yes, work is in progress

will this support hevc 10bit transcode?
I'm a noob to this :D

no update yet?

@hgy59 I'm not sure about this.

@cytec @ymartin59 @m4tt075
Is there something else that needs to be done to add the "apollolake" architecture to https://synocommunity.com/package/ffmpeg?

Work is in progress #3136. If I leave vaapi for later, I should publish this week-end.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

R1skNt picture R1skNt  路  6Comments

kraades picture kraades  路  6Comments

zhuchun picture zhuchun  路  7Comments

Mickroz picture Mickroz  路  3Comments

ghost picture ghost  路  4Comments