Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add apollolake support to ffmpeg package for DSx18+ Series [$40] #2939

Closed
ChrisAnonymous opened this issue Oct 2, 2017 · 22 comments
Closed

Comments

@ChrisAnonymous
Copy link

ChrisAnonymous commented Oct 2, 2017

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.

@ChrisAnonymous ChrisAnonymous changed the title Add apollolake to ffmpeg package [REQ] Add apollolake to ffmpeg package Oct 2, 2017
@ChrisAnonymous ChrisAnonymous changed the title [REQ] Add apollolake to ffmpeg package Adding apollolake to ffmpeg package Oct 2, 2017
@ChrisAnonymous ChrisAnonymous changed the title Adding apollolake to ffmpeg package Adding apollolake support to ffmpeg package for DSx18+ Series Oct 4, 2017
@ChrisAnonymous ChrisAnonymous changed the title Adding apollolake support to ffmpeg package for DSx18+ Series Add apollolake support to ffmpeg package for DSx18+ Series Oct 4, 2017
@ChrisAnonymous
Copy link
Author

ChrisAnonymous commented Oct 4, 2017

Bounty Added for this.

@Diaoul Diaoul added the bounty label Oct 4, 2017
@Diaoul Diaoul changed the title Add apollolake support to ffmpeg package for DSx18+ Series Add apollolake support to ffmpeg package for DSx18+ Series [$40] Oct 4, 2017
@ymartin59
Copy link
Contributor

ymartin59 commented Oct 4, 2017

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.

@m4tt075
Copy link
Contributor

m4tt075 commented Oct 4, 2017

@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.

@ymartin59
Copy link
Contributor

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

@m4tt075
Copy link
Contributor

m4tt075 commented Oct 4, 2017

@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.

@ChrisAnonymous
Copy link
Author

@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.

@ChrisAnonymous
Copy link
Author

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}...

@m4tt075
Copy link
Contributor

m4tt075 commented Oct 5, 2017

@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...

@ChrisAnonymous
Copy link
Author

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. :)

@ymartin59
Copy link
Contributor

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

@ymartin59
Copy link
Contributor

ymartin59 commented Oct 12, 2017

@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/

@t20u71
Copy link

t20u71 commented Nov 3, 2017

@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

@epitaxy
Copy link

epitaxy commented Nov 18, 2017

@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!!!

@PEMAMETAL
Copy link

"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?

@minostauros
Copy link

minostauros commented Jan 6, 2018

@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.

@hgy59
Copy link
Contributor

hgy59 commented Feb 2, 2018

@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

@stephanlinke
Copy link

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

@ymartin59
Copy link
Contributor

@stephanlinke @m4tt075 Yes, work is in progress

@wyapples
Copy link

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

@Tweaqer
Copy link

Tweaqer commented Feb 14, 2018

no update yet?

@ChrisAnonymous
Copy link
Author

@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?

@ymartin59
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests