FAQ  •  Register  •  Login

MediaBrowser FFmpeg Issues

<<

flickster

Serviio newbie

Posts: 3

Joined: Tue Aug 21, 2012 12:01 pm

Post Tue Aug 21, 2012 12:51 pm

MediaBrowser FFmpeg Issues

Hi All,

First I want to start by congratulating the Serviio development team, they have created a great lightweight media streaming software and I hope they continue to improve it.

Now to the reason for my post: It looks like the new Media Browser feature is got some major bugs, at least on my system.

I am running Windows Vista Ultimate SP2 on a older Intel Core 2 Duo laptop. When I go to the Media Browser on the local system (http://localhost:23424/mediabrowser/) everything seems to be working OK at first but once I start having a further look into what is happening with the background system processes the problems start to show.

1st:
Even after stopping any streaming videos from playing and exiting the media browser, the CPU load continues to be high, it turns out this is because the "ffmpeg" process is still running in the background, even when no video is being streamed and the media browser is closed, the process continues to run and use considerable CPU resources on my system.

2nd: (Possible Bug)
This one I am not too sure about and excuse my ignorance in some of these areas but:

When streaming an .mp4 video using the media browser feature, even with the quality set to "ORGINAL" "ffmpeg" is being called to transcode the file, why is this happening? .mp4 is supported in both flash and HTML 5, if the quality is set to Original I see no reason why the video should be transcoded, is this a bug or the way it should be working? - When I view other streamed .mp4 files using Firefox and flowplayer the only process that consumes high CPU loads is the "plugin-container.exe". Like I said before, it is my understanding that .mp4 (X264) playback is natively supported by both HTML 5 and now also Flash hence I don't understand why "ffmpeg" should need to get involved in the playback process unless you are changing the quality of the playback file and transcoding is required, but if the quality is set to ORIGINAL should it not simply let the browser take care of the playback?

Thank you in advance for looking into this.
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Tue Aug 21, 2012 1:00 pm

Re: MediaBrowser FFmpeg Issues

1) This has always happened and is the intended behavior. Serviio will continue to transcode a video until either the video finishes transcoding OR the same client requests another video. This is because DLNA devices do not distinguish between i've paused vs i've stopped playing. It also means you can quickly resume a video where you left off. While this isn't possible in the first version of MediaBrowser, seeking etc will be in later versions hopefully and this behavior will then be required.

2) Depending on the video inside the container, it won't transcode it, but will re-package it. If you want to further investigate it, turn on detailed logging (see my sig), and post the lines from the log around where it says executing ffmpeg which will include the command line.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

flickster

Serviio newbie

Posts: 3

Joined: Tue Aug 21, 2012 12:01 pm

Post Tue Aug 21, 2012 1:53 pm

Re: MediaBrowser FFmpeg Issues

Hi Will,

Thanks for the prompt reply.

1) - If I stop the video playback and exit Media Browser should that not send a signal to Serviio to stop transcoding? I am guessing this would not be difficult to do, looking at the debug logs I can see that an entry is created when Media Browser is exited. I don't see why CPU resources should be wasted in the background transcoding a file that you no longer wish the view or stream. I could stop viewing a video file and move on to editing files in photoshop, audio in CuBase or even playing a computer game, all in the while I have Serviio still running "ffmpeg" in the background wasting CPU cycles on a process that is no longer relevant to the user, doesn't seem right.

Only solution at the moment is to completely shutdown and exit Serviio. I don't know what the majority of users think about this "standard" behavior with this new media browser feature but it doesn't seem like the best approach to me for the above reasons.

2) I was having a look at the log and you are right. The video is a H264 codec and .MP4 container, it looks like it re-packages it to .FLV, can it not just leave it in .MP4? I know HTML5 supports that container and H264 and thought Flash now did the same, why the need to transcode? I know some people don't care too much about CPU usage as long as it does not affect their viewing experience but to me it is important that the software I use be efficient and put the least load on my system as possible.

I have always believed that lean optimized software which makes best use of the available resources by trying to leave the smallest possible footprint is always a sign of good software developers and well written code. - But this is another subject and a little off the track. :)
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Tue Aug 21, 2012 2:13 pm

Re: MediaBrowser FFmpeg Issues

1) It does seem unneeded at the moment when you cannot skip forward, but once you can it will be needed. Additionally, I think the idea was to avoid having different behaviour for content accessed via DLNA vs the Intenet enabled API. If you simply close the web browser, does it have a chance to say stop? This boils down to not making the user wait to resume a video that they were watching that got interupted for some reason. I think some people have used a batch file to kill ffmpeg, alternatively initiating playback of a very short clip also has the same effect.

2) Re-packaging a video into a new container does not take very long. However, if you are up for it you can try removing the rule to re-package the video from config/application-profiles.xml so that it sends the video as is, but I belive it is required, at least for the current vesrion of flowplayer. I haven't spent that much time with the MediaBrowser becuase of working on my android version of it. Lots of users run Serviio on a NAS or some form of low powered hardware (myself included), so there is definately a desire to minimise CPU intensive transcoding. But when trying to make the software easy to use for normal users who do not understand/do not want to understand the difference between file formats, it is easier for them to start off with a slightly wide set of matching rules, and refine them based on user feedback. If you look in profiles.xml you will see that a lot of effort has been put into supporting devices as best as possible while minimising transcoding.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

flickster

Serviio newbie

Posts: 3

Joined: Tue Aug 21, 2012 12:01 pm

Post Tue Aug 21, 2012 3:19 pm

Re: MediaBrowser FFmpeg Issues

Hi Will,

Your response to my first point makes sense to me now that I think about it. You obviously know the software much better than I do and the direction developers want to take with future releases etc so I place trust in you guys knowing what you are doing when it comes to this behavior. I also have to remember that the Media Browser feature was not really developed for local host playback, rather for streaming over a network, I was simply testing it on my laptop, if I really need to view a video file stored locally I have plenty of ways of doing it that are more practical.

I am glad to hear that minimizing CPU load is high on the priority list, like you mentioned many people will want to use this type of application on low power devices that are availabile 24/7 like a NAS which often don't have the most powerful processors so it is very important to cut down on transcoding unless it's really needed, hence I am not sure why Serviio is using ffmpeg to remux .MP4 to .FLV when quality is set to "original" unless it's something to do with transcoding the audio, even so in this case I was using a file that had AAC audio which is also supported by flowplayer so there was no need to transcode at all, maybe they need to update this in the profiles?

These are the supported video/audio formats for Flowplayer:

Video:FLV (H263) Audio: MP3
Video:MP4 (H264) Audio: AAC
Video:F4V (H264) Audio: AAC

Here is a snip of the log from my playback:
  Code:
2012-08-21 21:10:55,243 DEBUG [AbstractTranscodingDeliveryEngine] No suitable transcoding job exists yet, start one for client 'IPAddress=/127.0.0.1, Profile=Flash player'
2012-08-21 21:10:55,243 DEBUG [MediaItemDAOImpl] Getting file of media item 419
2012-08-21 21:10:55,244 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: F:\Downloads\Torrents\Finished\Falling Skies\Falling.Skies.S02E10.HDTV.x264-ASAP.mp4
2012-08-21 21:10:55,265 DEBUG [ProcessExecutor] Starting F:\Program Files\Serviio\bin\\..\lib/ffmpeg.exe -i F:\Downloads\Torrents\Finished\Falling Skies\Falling.Skies.S02E10.HDTV.x264-ASAP.mp4 -y -copyts -c:v copy -c:a libmp3lame -b:a 128k -ar 44100 -ac 2 -map 0:0 -map 0:1 -sn -f flv F:\Temp\Videos\Serviio\Serviio\transcoding-temp-419-flv_player-ORIGINAL.stf
2012-08-21 21:10:56,927 DEBUG [FileBasedTranscodingDeliveryStrategy] Sending transcoding stream
2012-08-21 21:10:56,927 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file Falling.Skies.S02E10.HDTV.x264-ASAP.mp4: FLV
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Aug 27, 2012 10:02 pm

Re: MediaBrowser FFmpeg Issues

can you post ffmpeg -i of the file? ATM it transcodes the audio to stereo mp3. So if the original video is multichannel it has to be made stereo.
<<

x2416x

Serviio newbie

Posts: 2

Joined: Wed Nov 14, 2012 6:04 pm

Post Wed Nov 14, 2012 6:15 pm

Re: MediaBrowser FFmpeg Issues

Hello,

I've also noticed this problem, and make a simple suggestion.

Is it possible to keep track of transcoding going on from a specific ip address and user agent. Once the ip address and user agent hit the browse page again, have it stop all ffmpeg processes?

I know of family members which will be watching a video and just close their browser. This of course happens on a multi-hour video file which then keeps the CPU pegged completely.

There's no way to tell if they've closed the browser or not, but they can be trained to hit the back button back to the file listing before closing the browser. This shouldn't affect skipping ahead or behind when that feature becomes available so long as someone doesn't go back to the files index.

Alternatively have the X that closes the flowplayer window kill off all ffmpeg processes spawned by that user.

Follow me?
<<

chrismallia

Serviio lover

Posts: 92

Joined: Tue Jan 15, 2013 1:10 am

Location: Malta

Post Sat Sep 07, 2013 12:01 pm

Re: MediaBrowser FFmpeg Issues

Hi guys I have the same problem when streaming over media browser it takes to much cpu power if 2 devices use media browser it kills my server which is running a dual Intel dual core 3.0ghz with 8gb ddr3 ram please help us solve this can I stop ffmpeg from repackaging and if yes how can I do it? thanks
server running serviio PRO and media browser Intel dual core g2030 3.0Ghz 8gb dd3 ram Microsoft windows server 2012 gigabit network . Devices Sony KDL55W805A, ps3, 2 sony bravia 2011, 5 android devices 2 of them samsung galaxy s3 running bubble upnp and serviigo, netgem netbox , 2 laptops XBMC windows 8
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Sep 08, 2013 6:57 pm

Re: MediaBrowser FFmpeg Issues

If it's only repackaging, the CPU will be negligible. If it's transcoding video, you will see high usage. If you are confident most of your files are h264, you can keep ORIGINAL quality which only repackages, all other qualities transcode. But you will need a decent internet uplink to support the original bitrate.

If I remember correctly, it uses ffmpeg even on supported files, to properly handle seeking (which is handled by ffmpeg in this case, ie starting transcoding from a given timestamp).
<<

mbenson1000

Serviio newbie

Posts: 1

Joined: Sun Nov 17, 2013 5:45 pm

Post Sun Nov 17, 2013 5:49 pm

Re: MediaBrowser FFmpeg Issues

I'm having a similar issue however I'm getting high ffmpeg cpu usage on system startup with no steraming having being started.
Is this considered normal?

If I stop serviio ffmpeg cpu usage stops.
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Mon Nov 18, 2013 12:28 am

Re: MediaBrowser FFmpeg Issues

I suspect your issue is very different - as a new user I suspect Serviio is still in the process of building your library. The library build process uses ffmpeg, and for the initial build can be both CPU intensive and take a few hours to complete (depending on the size of your library).

Unfortunately killing the ffmpeg process is probably only making this process take a lot longer - you need to let this build process complete. It's a once off hit, once finished everything should settle down.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

aloha22

Serviio newbie

Posts: 1

Joined: Fri Nov 22, 2013 12:36 pm

Post Fri Nov 22, 2013 12:48 pm

Re: MediaBrowser FFmpeg Issues

the issue has been fix ?

Return to Serviio Support & Help

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 81 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.