Multi-Thread ffmpeg

Questions about using 3rd party Media Streaming software may go here
Forum rules
Please note the disclaimer before modifying your Synology Product.
n0pa
Trainee
Trainee
Posts: 11
Joined: Mon Mar 28, 2011 4:23 pm

Multi-Thread ffmpeg

Postby n0pa » Mon May 02, 2011 7:36 pm

I have a DS411+ and love the fact that there are 2 core's. However After doing some testing, it appears that both the ffmpeg provided by Synology and the one in the bootstrap (ipkg) are not compiled for multi-threads (throws the following "Warning, not compiled with thread support, using thread emulation"). Anyone have any idea how to compile it with thread support?

Thanks
n0pa
Trainee
Trainee
Posts: 11
Joined: Mon Mar 28, 2011 4:23 pm

Re: Multi-Thread ffmpeg

Postby n0pa » Tue May 03, 2011 4:54 pm

I did some research into this and got it working on my 411+. Most likely, this will only work with atom dual core or higher. Here is what I did to enable it.

First I had to setup the environment. After performing the bootstrap I did the following in SSH.

Code: Select all

cp /opt/bin/wget /volume1/Downloads/copy-wget (make sure I created Downloads/copy-wget location)
ipkg remove wget
cp /volume1/Downloads/copy-wget/* /opt/bin/wget
cp /volume1/Downloads/copy-wget/* /usr/syno/bin/wget
ipkg install wget-ssl
ipkg update
ipkg upgrade
ipkg install optware-devel
ipkg install yasm
cp /opt/lib/libbz2.so.1.0 /lib
cp /opt/lib/libz.so.1 /lib


Then I compiled and installed ffmpeg-mt (ffmpeg multi-thread version)

Code: Select all

ipkg install lame
cd /volume1/@tmp
wget http://gitorious.org/ffmpeg/ffmpeg-mt/archive-tarball/master
tar xvzf master
cd ffmpeg-ffmpeg-mt
./configure --arch=x86_64 --enable-ssse3 --prefix=/opt --extra-cflags='-I/opt/include' --extra-ldflags='-L/opt/lib' --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-libmp3lame
make (should be no errors, warnings are ok/expected)
make install

Note that the ./configure and the line below it should all be on one line. I see a pretty big improvement in speed when I use pyTivo to transcode video, say 66% Let me know if you have any questions. I am still doing some tests as the 411+ is dual core, but supports 4 threads (2 threads per core).
klen
Versed
Versed
Posts: 200
Joined: Wed Oct 21, 2009 3:05 pm

Re: Multi-Thread ffmpeg

Postby klen » Tue May 03, 2011 11:23 pm

Nice post, thanks for sharing.
One question: what is the need for the copy/restore of the wget binary and the ipkg remove in between them?
DS-412+
DSM latest
DS-107+
DSM 2.3-1157
DS-112j
DSM latest
n0pa
Trainee
Trainee
Posts: 11
Joined: Mon Mar 28, 2011 4:23 pm

Re: Multi-Thread ffmpeg

Postby n0pa » Wed May 04, 2011 1:42 am

It's a little of a chicken and egg thing. wget is needed to install anything, however, installing wget-ssl will fail because wget is installed (it's seen as the same thing to the system). However once wget is removed, it cannot be restored unless a re-bootstrap occurs (or you backup). So a backup is made, it is formally removed, then informally replaced. wget-ssl will then successfully install. It took a lot of trial and error to figure that out.

At this point I am interested in testing if ffmpeg-mt is needed or if regular ffmpeg will work. I have read that regular ffmpeg, during compile, will check to see if multiple threads is supported, and when it is, enables it.

There is still some more testing to do, but I am happy with the results so far. Much better then the release of ffmpeg that is installed with ipkg or is provided by Synology.
Anger
I'm New!
I'm New!
Posts: 9
Joined: Mon Nov 25, 2013 10:41 pm

Re: Multi-Thread ffmpeg

Postby Anger » Mon Nov 25, 2013 10:46 pm

I know is an old thread, but was very usefull for me on XPEnologi build, with Intel Celeron Dual Core.

BTW, the last step is

Code: Select all

cp /volume1/@tmp/ffmpeg-ffmpeg-mt/ffmpeg /usr/syno/bin/ffmpeg


My problem is that I want to compile FFMPEG with subtitle support.
For this, I need to add "--enable-libass" , but all I get is

Unknown option "--enable-libass".
See ./configure --help for available options.


I've installed a lot of dependencies and I'm running out of ideas :(

Return to “Media Streaming Mods”

Who is online

Users browsing this forum: No registered users and 1 guest