Page 1 of 1

Quick stuttering after upgrade to 1.0.1

PostPosted: Fri Oct 12, 2012 3:46 am
by jperkster
Salutations fellow media lovers. I've been a long time serviio user on Linux, and I haven't used anything else once I found this product. With that said, I'm still happy with it, but I'm having a small issue and I would like some guidance.

After I upgraded my installation to 1.0.1 (from 0.6.2), I found that ffmpeg would error out when it started playing. After a little googling I found that I needed to recompile a newer version of ffmpeg (N-42368-gbf53863) in order to accept the updated commands being sent to the program. Easy enough.

Perfect, everything was working. Then I noticed that HD movies will get a *very* quick 'stutter/skip/pause', about once every 2 seconds when streaming to my Xbox 360. It's just a big enough skip to notice it. It also only happens on the Xbox. I have a WDTV Live and it works fine off of that.

I've got serviio set to use all 4 cores of my server. When it transcodes videos to the xbox, it only uses between 120% - 250% of CPU. I have plenty of idle CPU left, no iowait, the system appears fine. It hums along at a 2 load with no issues. No errors in the logs, etc.

I thought that perhaps my hardware is perhaps setup wrong? My system, which runs headless in a closet, AMD Athlon II X4 640 with 4GB 1333 MHz RAM, I would guess would handle any 720p movie I can throw at it, however movies that worked before great (Avengers for instance) now has a small (very small), but very noticeable skip.

Do I need a stronger processor? I was thinking about upgrading this rig to 16G of ram and throwing the tmpdir for ffmpeg into a ramdisk. I only watch 720p videos, as this setup won't transcode 1080p successfully, so it won't ever get big enough to chew through all of the memory. I feel this is my next step honestly.

I would love anyone's input that could help lead me into some solutions. I don't mind spending some money, but I'd prefer not to =P

TIA

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Mon Oct 15, 2012 1:00 pm
by zip
The XBox profile transcodes to WMV (unless the file is supported natively). The FFmpeg WMV encoder doesn't support multithreading, so having multicore CPU doesn't help.

You could enable detailed logging, play the file, find the FFmpeg command, run it manually and see how many FPS it's doing. If it's somewhere around 25-30 you might be out of luck regarding your processor. Other option might be trying selecting lower transcoding quality on the Transcoding tab.

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Tue Oct 16, 2012 2:40 am
by jperkster
zip wrote:The XBox profile transcodes to WMV (unless the file is supported natively). The FFmpeg WMV encoder doesn't support multithreading, so having multicore CPU doesn't help.

You could enable detailed logging, play the file, find the FFmpeg command, run it manually and see how many FPS it's doing. If it's somewhere around 25-30 you might be out of luck regarding your processor. Other option might be trying selecting lower transcoding quality on the Transcoding tab.


Thanks for the reply :)

The odd thing is this didn't start until I upgraded ffmpeg.

Since ffmpeg doesn't support multi-threading, how would one go about transcoding a 30G mkv on one core? Is there another format we could transcode into that the 360 could read?

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Tue Oct 16, 2012 10:40 am
by zip
No, it doesn't support mpegts so the asf container with wmv is the only choice.

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Mon Oct 29, 2012 8:15 am
by jperkster
zip wrote:No, it doesn't support mpegts so the asf container with wmv is the only choice.


Thinking more about this, would it be possible to have Serviio transcode it ahead of time and replay in a format optimized for the 360? I'm going to download a 1080p video tonight and transcode it and see if it'll stream properly.

I'm curious how others get their HD videos to play. Are processors strong enough to transcode on a single core alone in real-time?

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Thu Nov 01, 2012 2:09 pm
by jperkster
Some tech info. I'm starting off around 40fps, than it's dropping to 20fps.

I'm going to let this transcode the entire video and I'll try to replay in so it won't need transcoding, and if that's a success I guess I'll need to find a way to move these into a wmv format ahead of time.

Do you think I could put in a feature request to have certain vids pre-transcoded?



  Code:
root@media-center ~ # ffmpeg -i "/home/perk/media/Planet Earth BBC 2006 S01E08 Jungles 1080p Bluray DTS VC1 Remux SHiTSoNy/Planet.Earth.BBC.2006.S01E08.Jungles.1080p.Bluray.DTS.VC1.Remux-SHiTSoNy.mkv" -y -copyts -c:v wmv2 -b:v 15360k -maxrate:v 15360k -bufsize:v 15360k -r 24000/1001 -g 15 -c:a wmav2 -b:a 192k -ac 2 -map 0:0 -map 0:1 -sn -f asf /tmp/Serviio/transcoding-temp-38931-3-ORIGINAL.avi
ffmpeg version N-42368-gbf53863 Copyright (c) 2000-2012 the FFmpeg developers
  built on Sep  4 2012 20:52:43 with gcc 4.5.2
  configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-libvpx --enable-librtmp --enable-libxvid
  libavutil      51. 64.100 / 51. 64.100
  libavcodec     54. 33.100 / 54. 33.100
  libavformat    54. 15.102 / 54. 15.102
  libavdevice    54.  1.100 / 54.  1.100
  libavfilter     3.  1.100 /  3.  1.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, matroska,webm, from '/home/perk/media/Planet Earth BBC 2006 S01E08 Jungles 1080p Bluray DTS VC1 Remux SHiTSoNy/Planet.Earth.BBC.2006.S01E08.Jungles.1080p.Bluray.DTS.VC1.Remux-SHiTSoNy.mkv':
  Metadata:
    creation_time   : 2010-04-05 16:40:15
  Duration: 00:51:06.81, start: 0.000000, bitrate: 22061 kb/s
    Stream #0:0: Video: vc1 (Advanced) (WVC1 / 0x31435657), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Stream #0:1(dut): Audio: dts (DTS), 48000 Hz, 5.1(side), s16, 1536 kb/s (default)
    Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), s16, 640 kb/s
    Stream #0:3(dut): Subtitle: text
[graph 0 input from stream 0:0 @ 0xa9febe0] w:1920 h:1080 pixfmt:yuv420p tb:1/1000 fr:24000/1001 sar:1/1 sws_param:flags=2
[output stream 0:0 @ 0xa9fe3c0] No opaque field provided
[graph 1 input from stream 0:1 @ 0xa9fe0a0] tb:1/48000 samplefmt:s16 samplerate:48000 chlayout:0x60f
[auto-inserted resampler 0 @ 0xa9a6f40] chl:5.1(side) fmt:s16 r:48000Hz -> chl:stereo fmt:s16 r:48000Hz
[wmv2 @ 0xa9d0780] impossible bitrate constraints, this will fail
Output #0, asf, to '/tmp/Serviio/transcoding-temp-38931-3-ORIGINAL.avi':
  Metadata:
    WM/EncodingSettings: Lavf54.15.102
    Stream #0:0: Video: wmv2 (WMV2 / 0x32564D57), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 15360 kb/s, 1k tbn, 23.98 tbc
    Stream #0:1(dut): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz, stereo, s16, 192 kb/s (default)
Stream mapping:
  Stream #0:0 -> #0:0 (vc1 -> wmv2)
  Stream #0:1 -> #0:1 (dca -> wmav2)
Press [q] to stop, [?] for help
frame=  474 fps= 39 q=2.0 size=    5298kB time=00:00:19.66 bitrate=2206.5kbits/s dup=1 drop=0

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Thu Nov 01, 2012 3:14 pm
by zip
I don't think I'll be doing any pretranscoding, tbh. BUt you could try to ask the FFMpeg devs to build multithreaded wmv encoder :-)

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Fri Nov 02, 2012 10:54 pm
by jperkster
We'll see if it gets anywhere

https://ffmpeg.org/trac/ffmpeg/ticket/1882

Thanks for your help

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Sun Nov 04, 2012 4:55 pm
by vwalien
Thanks jperkster for your efforts to open a ticket with the FFMpeg devs.

I've just setup serviio and xbox 360 for the first time and came across this issue today... found this thread by searching. I have the exact same symptoms on a windows installation.

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Sat Nov 10, 2012 10:39 pm
by jperkster
Thanks for the updates to the ffmpeg bug thread. I was wondering where we stood with the issue, and if there might be a chance of an improvement?

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Sun Nov 11, 2012 11:37 pm
by zip
It looks like the encoder in single-threaded, or not so efficient as it could be. I've now updated the FFmpeg command line to pass the threads parameter properly, hopefully it'll at least increase the decoder performance.

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Tue Nov 20, 2012 2:50 am
by jperkster
Thanks, is there a patch I could try out or a way to get a newest version? I was hoping it might be git controlled :)

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Tue Nov 20, 2012 2:22 pm
by zip
you can apply for the betatesters group to try it out when it's ready

Re: Quick stuttering after upgrade to 1.0.1

PostPosted: Mon Nov 26, 2012 3:29 am
by jperkster
zip wrote:you can apply for the betatesters group to try it out when it's ready


Done, happen to know when it'll be approved and when the beta might come out?