Page 1 of 1

Configuring FFMPEG performance

PostPosted: Thu Jun 30, 2011 1:38 am
by glennsfield
Hi guys,

Firstly I'd like to say Serviio is faaaaantastic!
I have a Samsung B series and have got everything working pretty much exactly the way I want (using a custom profile) with all media files except MKVs.

My profile.xml is setup very basic, it's set to force transcode everything. The reason for this is because I found some video files I could not fast forward/rewind (especially MKVs). Forcing the transcoding enabled skipping functions to work.
For your typical average quality xvid movies I don't really have a problem but for 720/1080P MKVs, when I try to fast forward too quickly it will often bomb out and return me to the DLNA main menu. I'm assuming this is because ffmpeg can't cope with transcoding these HD movies on the fly and in fast forward! (not on my hardware at least).

Before I go out and buy a faster processor, I was thinking maybe there are some configuration options with FFMPEG to improve performance. I have an AMD X2 processor which is pretty budget. I've set Serviio console to use two CPU Cores.

In researching FFMPEG there appears to be many configuration options when doing the transcoding from command line (e.g. how many cpu threads to use). I'm guessing Serviio sends its own parameters to FFMPEG when it needs to transcode something, is there someway to modify these settings that Serviio is asking FFMPEG to use?

My last resort will be to change my profile.xml to reduce the bitrate etc to put less load on the CPU.

Oh and one last thing, I have a decent ATI graphics card in the machine doing the transcoding, anyone know of a way to force Serviio/FFMPEG to utilize the GPU?

Thanks in advance!

Re: Configuring FFMPEG performance

PostPosted: Thu Jun 30, 2011 6:57 am
by Illico
glennsfield wrote:...I was thinking maybe there are some configuration options with FFMPEG to improve performance. I have an AMD X2 processor which is pretty budget. I've set Serviio console to use two CPU Cores.

Set two -> ffmpeg used two threads

glennsfield wrote:My last resort will be to change my profile.xml to reduce the bitrate etc to put less load on the CPU.

Read : http://www.serviio.org/index.php?option ... icle&id=24
use maxVBitrate option

Re: Configuring FFMPEG performance

PostPosted: Sun Jul 10, 2011 4:18 pm
by herick
glennsfield wrote:Hi guys,

Firstly I'd like to say Serviio is faaaaantastic!
I have a Samsung B series and have got everything working pretty much exactly the way I want (using a custom profile) with all media files except MKVs.

My profile.xml is setup very basic, it's set to force transcode everything. The reason for this is because I found some video files I could not fast forward/rewind (especially MKVs). Forcing the transcoding enabled skipping functions to work.
For your typical average quality xvid movies I don't really have a problem but for 720/1080P MKVs, when I try to fast forward too quickly it will often bomb out and return me to the DLNA main menu. I'm assuming this is because ffmpeg can't cope with transcoding these HD movies on the fly and in fast forward! (not on my hardware at least).

Before I go out and buy a faster processor, I was thinking maybe there are some configuration options with FFMPEG to improve performance. I have an AMD X2 processor which is pretty budget. I've set Serviio console to use two CPU Cores.

In researching FFMPEG there appears to be many configuration options when doing the transcoding from command line (e.g. how many cpu threads to use). I'm guessing Serviio sends its own parameters to FFMPEG when it needs to transcode something, is there someway to modify these settings that Serviio is asking FFMPEG to use?

My last resort will be to change my profile.xml to reduce the bitrate etc to put less load on the CPU.

Oh and one last thing, I have a decent ATI graphics card in the machine doing the transcoding, anyone know of a way to force Serviio/FFMPEG to utilize the GPU?

Thanks in advance!


There is an option to enable hardware acceleration in ffmpeg. The setting is under "DXVA video decoder configuration". I think this setting enables GPU decoding.

Re: Configuring FFMPEG performance

PostPosted: Sat Aug 06, 2011 2:39 pm
by abubin
another option is to use linux. It should be faster than windows.

Re: Configuring FFMPEG performance

PostPosted: Fri Sep 16, 2011 12:10 pm
by Negcreep
Has anyone here got GPU transcoding to work in windows?

I am running Serviio on a Atom/Nvidia Ion netbox PC with windows 7 x64. It seems struggle a bit with 1080p transcoding. Strangely the playback is smooth for about 1-2 minutes, then it starts stuttering like mad. That's using all 4 threads on the Atom D525 1.8ghz dual core CPU.

I think GPU transcoding could really help a system like this.

I see upgrading FFMpeg is an option. I've downloaded the windows version but I have no idea how to replace the version included with serviio or how to turn on the hardware acceleration.

I apologise for my noobishness but any help you can give would be appreciated.

Thanks

Ps. Great effort with Serviio btw. It really is fantastic and your effort is appreciated. :)

Re: Configuring FFMPEG performance

PostPosted: Fri Sep 16, 2011 12:32 pm
by Illico
Negcreep wrote:I see upgrading FFMpeg is an option. I've downloaded the windows version but I have no idea how to replace the version included with serviio or how to turn on the hardware acceleration.

For windows user, "ffmpeg.exe" is into ./serviio/lib folder, you can backup the ffmpeg delivered with serviio, then copy/past the new one in the same folder.
But
- Sometime, last ffmpeg, change the syntax then serviio could not use it properly.
- You could not add other extra option with Serviio.
Nevertheless,
- You could try locally (in a cmd windows terminal) some new option and post here your experience, this could become an evolution in next serviio version.

Re: Configuring FFMPEG performance

PostPosted: Fri Sep 16, 2011 12:58 pm
by zip
or wrap ffmpeg.exe in a bat file in which you add your own parameters

Re: Configuring FFMPEG performance

PostPosted: Fri Sep 16, 2011 2:58 pm
by Negcreep
OK this will either make you laugh or hold your head in your hands ...

I just realised I was using a the wireless connection for the Netbox instead of the Ethernet cable. :)

Opps!

It appears a 1.8ghz atom is enough for 1080p transcoding in windows after all. ;)

Re: Configuring FFMPEG performance

PostPosted: Fri Sep 16, 2011 4:39 pm
by moltra
You had me wondering if my 2004 AMD running linux was faster than an atom processor. I have never seen more than 5% CPU usage on my serviio system, even when sending video to 4 devices.

Re: Configuring FFMPEG performance

PostPosted: Fri Sep 16, 2011 4:45 pm
by Cerberus
abubin wrote:another option is to use linux. It should be faster than windows.


wont make blind bit of difference.

Re: Configuring FFMPEG performance

PostPosted: Sun Oct 16, 2011 4:47 pm
by TarsTarkas
I realize that this is a little off-topic for this thread, but since it was the closest I've found to an answer to my question I was wondering...

My profile.xml is setup very basic, it's set to force transcode everything.

How would I go about doing this? I've noticed some of the same problems glennsfield mentioned, so I wanted to give this solution a try, but I'm not sure how to modify the profiles.xml file. I can see where the xml file has a bunch of settings for doing various transcoding operations, but I don't know what I'd need to change to make it force transcoding of everything...

I was hoping there was maybe a place here on the forums where people post their profiles.xml files with various configurations such as this for people to try out, but I've not been able to find anything like that so far... Perhaps a new forums section to consider?

In case it makes any difference, I am using a Samsung UN46B8500... According to the console, this is a B series television...

Re: Configuring FFMPEG performance

PostPosted: Mon Oct 17, 2011 8:07 am
by zip
Look at the DirecTV profile, that transcodes (almost) everything

Re: Configuring FFMPEG performance

PostPosted: Wed Oct 19, 2011 2:37 am
by TarsTarkas
Ok, thanks for the tip... one more question... For going to my television, would you suggest using the same target video and audio codecs as the DirecTV setup uses? Or should I use something more like this:

  Code:
<Video targetContainer="mpegts" targetACodec="ac3" targetVCodec="mpeg2video">


Thanks again for the help, and for the excellent app!

Re: Configuring FFMPEG performance

PostPosted: Wed Oct 19, 2011 10:26 am
by zip
up to you, tery both and see what gives you best results (playback, quality, ffwd, pause, CPU, etc)

Re: Configuring FFMPEG performance

PostPosted: Tue Nov 15, 2011 8:46 pm
by rcooper5908
Cerberus wrote:
abubin wrote:another option is to use linux. It should be faster than windows.


wont make blind bit of difference.



It appears to make a difference to me, but it's to be expected since ffmpeg does not (and according to the authors will never) compile natively on windows. You have a couple choices, cygwin or mingw (which is a real pain in the ass but easier to compile a stand alone .exe without need of other DLLs). So you are running an interpreted version for all intents and purposes and even the threading is kind of a kludge. I get better performance running serviio on a pretty much mid to lower end machine with the files on a win7 host than I do hosting directly off of windows.

Re: Configuring FFMPEG performance

PostPosted: Mon Nov 28, 2011 3:35 am
by Macgyver33
moltra wrote:You had me wondering if my 2004 AMD running linux was faster than an atom processor. I have never seen more than 5% CPU usage on my serviio system, even when sending video to 4 devices.


So is it possible that something like an AMD E-350 1.6GHz (equal to an Intel Atom) would have enough horsepower to handle a couple of devices transcoding 1080i files from it?

I want to build a new server and make it as low power as possible but was worried these 18W TDP processors wouldn't have enough juice to handle transcoding HD files to devices.

Re: Configuring FFMPEG performance

PostPosted: Mon Nov 28, 2011 9:01 am
by Illico
Macgyver33 wrote:I want to build a new server and make it as low power as possible but was worried these 18W TDP processors wouldn't have enough juice to handle transcoding HD files to devices.

You can try a transcoding HD file locally and check the ffmpeg "fps" rate computing, must be > frame rate (25, 30 or 50), >100 fps is a good value.

Re: Configuring FFMPEG performance

PostPosted: Mon Nov 28, 2011 10:25 am
by zip
Macgyver33 wrote:So is it possible that something like an AMD E-350 1.6GHz (equal to an Intel Atom) would have enough horsepower to handle a couple of devices transcoding 1080i files from it?

I doubt it very much, especially couple of devices at the same time. If you're talking about remuxing then probably yes.