FAQ  •  Register  •  Login

Transcoding issues on Bravia 2010

<<

ext3

Serviio newbie

Posts: 11

Joined: Sun Nov 10, 2013 10:56 pm

Post Mon Nov 11, 2013 3:08 am

Transcoding issues on Bravia 2010

Hello guys, I've been trying to use serviio with my Bravia 40EX605 (latam) for a while to play mkv files but had no success. I get constant stuttering on high-detailed or high-fps scenes. I'm running Serviio 1.3.1 with Bravia 2010 profile on Ubuntu 12.04, recently builded ffmpeg on a Athlon X2 with 2gb and copper network. The TV has the latest firm available for the region.
This is what I could find and what I tested so far:
FLAC, MP3, AVI plays just fine, no issues and no problems.
MKV files stutter constantly as follows:
- Movie appears as AVC if use the default 2010 Bravia profile, or MPEG if I use the "- MKV" profile in the FAQ for Bravia. Fails equally in both modes.
- Stutters on any of the movies I have, they're 1080p and around 10-12gb each. CPU usage is quite high, but not 100% and disk I/O is normal. If I kill ffmpeg process, cpu idles and the movie continues to play so there's encoding "buffer" even with this old CPU, but I still have stuttering
- ifstat shows that the network usage is around 2mb/s, so it's hitting the DLNA limit I assume

However, if I copy the temporary .srt file FFMPEG is generating and rename it with .AVI extension, it appears as AVC (or MPEG2 if using the other profile) and it plays perfectly, no stuttering at all and ifstat shows a network usage above 2.1mb/s almost constantly with 6mb/s peaks.
I believe this might have something to do with the mime type renaming, but I'm quite a newbie in all this and couldn't get any further with the troubleshooting.

Notes:
- I'm using external subtitles
- FFMPEG is being called with this parameters:
ffmpeg -threads 2 -i /Storage/Movies/Seen/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3.mkv -y -threads 2 -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -vf pad=1920:1080:0:132:black,setdar=4:3,subtitles=filename='/Storage/Movies/UnSeen/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3.srt':original_size=1920x816:charenc=UTF-8 -r 24000/1001 -g 15 -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /Storage/tmp/Serviio/transcoding-temp-11017-sonymkv-ORIGINAL-c0ce38ebd5a275216473cb73862ef185.stf

- FFMPEG -i of the original file:
ffmpeg version git-2013-11-04-6cf0c41 Copyright (c) 2000-2013 the FFmpeg developers
built on Nov 4 2013 04:25:56 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
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-librtmp --enable-libxvid --enable-libass
libavutil 52. 49.100 / 52. 49.100
libavcodec 55. 40.101 / 55. 40.101
libavformat 55. 21.100 / 55. 21.100
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, matroska,webm, from '/Storage/Movies/UnSeen/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3.mkv':
Metadata:
creation_time : 2011-09-03 11:11:46
Duration: 01:54:55.20, start: 0.000000, bitrate: 15333 kb/s

- FFMPEG of the temp file
ffmpeg version git-2013-11-04-6cf0c41 Copyright (c) 2000-2013 the FFmpeg developers
built on Nov 4 2013 04:25:56 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
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-librtmp --enable-libxvid --enable-libass
libavutil 52. 49.100 / 52. 49.100
libavcodec 55. 40.101 / 55. 40.101
libavformat 55. 21.100 / 55. 21.100
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Input #0, mpegts, from 'transcoding2.avi':
Duration: 01:38:20.45, start: 1.436378, bitrate: 14639 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv), 1920x1080 [SAR 3:4 DAR 4:3], max. 17000 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
Stream #0:1[0x101](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s

I didn't let the FFMPEG transcoding to finish to save some time, but I've done it before while troubleshooting and works OK.
- I've tested it many times with different movies.

Is there any reason on why there is a difference between playing the transcoding on the fly or by playing it renamed? The temp is being taken as native and doesn't runs ffmpeg.

Thanks, appreciate your help and time.
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Mon Nov 11, 2013 9:06 am

Re: Transcoding issues on Bravia 2010

Could you try in a local windows terminal (cmd) the same command line, check and post the ffmpeg log result here ?
I suspect a low transcoding process framerate...should be >x3 of movie framerate)
  Code:
ffmpeg -threads 2 -i /Storage/Movies/Seen/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3.mkv -y -threads 2 -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -vf pad=1920:1080:0:132:black,setdar=4:3,subtitles=filename='/Storage/Movies/UnSeen/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3.srt':original_size=1920x816:charenc=UTF-8 -r 24000/1001 -g 15 -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /Storage/tmp/Serviio/transcoding-temp-11017-sonymkv-ORIGINAL-c0ce38ebd5a275216473cb73862ef185.stf


Another test with a lower bitrate :
  Code:
ffmpeg -threads 2 -i /Storage/Movies/Seen/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3.mkv -y -threads 2 -c:v mpeg2video -b:v 5000k -maxrate:v 5000k -bufsize:v 5000k -vf pad=1920:1080:0:132:black,setdar=4:3,subtitles=filename='/Storage/Movies/UnSeen/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3/Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3.srt':original_size=1920x816:charenc=UTF-8 -r 24000/1001 -g 15 -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /Storage/tmp/Serviio/transcoding-temp-11017-sonymkv-ORIGINAL-c0ce38ebd5a275216473cb73862ef185.stf
<<

ext3

Serviio newbie

Posts: 11

Joined: Sun Nov 10, 2013 10:56 pm

Post Mon Nov 11, 2013 12:55 pm

Re: Transcoding issues on Bravia 2010

Thanks for your reply Illico, I'm at work ATM and can't SSH my ubuntu from here to paste your results. I suspected the same, but when I was troubleshooting I did that and even if I wasn't getting a high FPS, it was quite normal and stable.
If I pause the movie and let FFMPEG transcode for a while, stutter continues right after I resume it, and network keeps showing it's reaching 2mb/s and not going any further. If I kill FFMPEG but leave serviio running, I can still watch the movie for another 4 / 5 minutes until reaches end of temporary file so I'm pretty sure I have enough power to transcode it.

I will post the results once I get home, but I'm still betting on the network limit... :)
<<

ext3

Serviio newbie

Posts: 11

Joined: Sun Nov 10, 2013 10:56 pm

Post Tue Nov 12, 2013 4:13 am

Re: Transcoding issues on Bravia 2010

Ok, with those lines I get very low FPS, (around 30). So I decided to install Serviio in my laptop (Win 7, Ivy i3) and using the built in ffmpeg with the same line I get the same FPS (30 - 32).
Besides that, if I play the same movie from my laptop the FFMPEG is executed the following way:
ffmpeg.exe -fflags +genpts -threads auto -i C:\Thor.2011.1080p.BluRay.DTS-ES.x264.D-Z0N3.mkv -y -threads auto -c:v copy -bsf:v h264_mp4toannexb -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts C:\Windows\TEMP\Serviio\transcoding-temp-1-sony2010-ORIGINAL.stf

And running it with that command I get a better FPS ratio, also little CPU stress (btw)
frame= 223 fps=0.0 q=-1.0 size= 11193kB time=00:00:09.33 bitrate=9819.2kbits/
frame= 591 fps=576 q=-1.0 size= 29625kB time=00:00:24.63 bitrate=9851.8kbits/
frame= 815 fps=534 q=-1.0 size= 54361kB time=00:00:34.07 bitrate=13069.1kbits
frame= 1219 fps=602 q=-1.0 size= 76453kB time=00:00:50.90 bitrate=12303.1kbits
frame= 1418 fps=554 q=-1.0 size= 90443kB time=00:00:59.09 bitrate=12536.9kbits
frame= 1876 fps=613 q=-1.0 size= 115498kB time=00:01:18.36 bitrate=12074.1kbits


However!, I have the very exact same issue. Movie stutters in the same scenes as it stuters from my Ubuntu, and again, I copied the temporary file, renamed it to .avi and it plays smoothly... I don't have ifstat on windows, but as for the performance counter I see that the network is being limited to around 1.8/2 mb/s... Two different machines, different OS, same issue... this Bravia rendered is damned!
Any ideas on how can I overcome this issue? Thanks!
<<

ext3

Serviio newbie

Posts: 11

Joined: Sun Nov 10, 2013 10:56 pm

Post Wed Nov 13, 2013 8:43 pm

Re: Transcoding issues on Bravia 2010

Anyone? :oops:
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Thu Nov 14, 2013 9:48 am

Re: Transcoding issues on Bravia 2010

You have better encoding fps with your second PC, because there were no external subtitle file, so stream is only remuxed (-c:v copy) and not transcoded to burn sub (-c:v mpeg2video).

However, I don't understand why when you copy the temporary .srt file (change the extension by .ts, this is not an avi file) it plays perfectly.
When you copy the temp .srt file, this one was delivered in native format, so without ffmpeg processing, then serviio delivered the stream by device request rate.
If you press, pause, then resume after a minute, you should have the same behavior.

Do you have automatic library refresh enabled on serviio console ? I suggest to disable it, and only enable it when you add new files...because when enabled, some ffmpeg process use CPU load in background.
<<

ext3

Serviio newbie

Posts: 11

Joined: Sun Nov 10, 2013 10:56 pm

Post Thu Nov 14, 2013 7:07 pm

Re: Transcoding issues on Bravia 2010

Didn't thought of the subtitle, you're right that it has better FPS because of that remux.
If I pause the movie in any case (from ubuntu or windows, with or without subs), stutter begins automatically after resuming, and I see a network traffic reaching 2mb/s and not going any further. Also the TV is VERY unresponsive (I have to press pause several times before it reacts)
Library autorefresh is disabled, I noticed a severe disk I/O impact when it runs as it does a lot of random access, but not close to collapse my disks.

I will test later tonight replacing the name with .ts instead of .avi and see what happens. I believe that there is something odd limiting the transfer rate to 2mb/s when transcoding on the fly...

BTW, I don't understand either... I've been working as an IT Admin for several years and I've seen a lot of weird issues with databases, servers, domain controllers, networks... but this is totally out of my scope!

Thanks for the comeback
<<

ext3

Serviio newbie

Posts: 11

Joined: Sun Nov 10, 2013 10:56 pm

Post Sun Nov 17, 2013 6:18 am

Re: Transcoding issues on Bravia 2010

Sorry for the delay in the answer to your suggested test, I copied the file as .ts instead of .avi, it works perfectly, here is an extract of the ifstat
KB/s in KB/s out
6.80 543.91
6.50 543.32
7.01 826.08
7.72 3606.46
9.20 4262.38
11.64 5257.26
10.42 4889.76
10.23 4757.86
10.94 4957.21
11.32 5302.37
10.35 4556.42
7.91 3809.22
8.23 3684.96
9.91 4689.40


But still, if I play the original:
KB/s in KB/s out
34.00 1221.90
60.76 1976.01
44.73 1584.52
50.64 1635.28
59.03 1919.86
50.44 1812.67
47.44 1532.62
40.87 1431.58
43.86 1518.27
13.83 596.87
31.24 1004.84
30.57 1155.10

And it´s stuttering badly... I don't know what else to test, I'd like to understand a little bit more on how is the MIME renaming made to give it a few shots


----- EDIT -----
I downloaded the UPnP tools and found the following:
While playing the video COPY I get the following ProtocolInfo string:
http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HD_60_AC3_ISO;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01500000000000000000000000000000


and when I play the mkv file directly I get the following:
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_NA_ISO;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000


so I modified the profile with:
<MediaFormatProfiles>
<MediaFormatProfile mime-type="video/mpeg.DLNA.ORG_PN" name="AVC_TS_MP_HD_AC3_ISO">MPEG_TS_SD_NA_ISO</MediaFormatProfile>
</MediaFormatProfiles>


Re-played the file, and got the following (still stuttering, and network reaching 2mb/s and not going further)
http-get:*:video/mpeg:DLNA.ORG_PN=AVC_TS_HD_60_AC3_ISO;DLNA.ORG_OP=10;DLNA.ORG_CI=1;DLNA.ORG_FLAGS=01500000000000000000000000000000


So, the main difference between the copy, and playing the original file seems to be:
DLNA.ORG_OP=10;DLNA.ORG_CI=1 (stuttering)
VS
DLNA.ORG_OP=01;DLNA.ORG_CI=0 (playing correctly)

I've read that ORG_OP is related on how the file will be seeked on FF action, but ORG_CI header is related to the file being transcoded (1) or not (0). Is there any chance that my tv is limiting the network on 2mb/s while it's receiving a transcoded file? is there any way around this to force that value on 0 to test?

Thanks guys,
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Sun Nov 17, 2013 1:01 pm

Re: Transcoding issues on Bravia 2010

ext3 wrote:...ORG_CI header is related to the file being transcoded (1) or not (0).

Yes
ext3 wrote: Is there any chance that my tv is limiting the network on 2mb/s while it's receiving a transcoded file?

I don't know, but this is a good point...
ext3 wrote: is there any way around this to force that value on 0 to test?

I'm not sure that Zip would like to do it, because this is not DLNA compliant.
<<

ext3

Serviio newbie

Posts: 11

Joined: Sun Nov 10, 2013 10:56 pm

Post Sun Nov 17, 2013 10:43 pm

Re: Transcoding issues on Bravia 2010

Agree that modifying that is not compliant, and we all know that doing those "fixes" only lead to more pain than gain... My intention was to be sure that I've narrowed the issue to the renderer, if that's the case, I'd buy an external renderer or upgrade my tv (I live in Argentina, things are not cheap around here heh).
I'd appreciate if you can contact Zip (or maybe if he's around in this thread), I would really like to make that final test :)

thanks.
<<

wxchaser

Serviio newbie

Posts: 1

Joined: Mon Jan 20, 2014 12:45 pm

Location: Nottingham - UK

Post Mon Jan 20, 2014 12:55 pm

Re: Transcoding issues on Bravia 2010

Is there any update to this, I'm having the exact same problem on a Sony 40EX403.

Original mkv in avc and ac3 so simple remux required.
Serviio creates the temp file but the stream stutters, waiting for remuxing to complete before re-requesting file makes no difference.
Copying remuxed file to library and it plays fine.

Just as ext3, seeing the transcoded file being tightly limited in bandwidth, the copy put in to the library plays without the restriction.

Rob
<<

ext3

Serviio newbie

Posts: 11

Joined: Sun Nov 10, 2013 10:56 pm

Post Mon Jan 20, 2014 3:07 pm

Re: Transcoding issues on Bravia 2010

Unfortunately I haven't had time lately to keep on troubleshooting the issue. Last thing I've tried was to forge the parameters sent to the TV by using the Intel DLNA tool, however with no success, always having the same behavior.
Also, I haven't updated to the latest version yet, I will follow up on this probably this week or the next one, let me know if you want to troubleshoot we can probably PM the results and share ideas...
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Mon Jan 20, 2014 7:56 pm

Re: Transcoding issues on Bravia 2010

ext3 wrote:So, the main difference between the copy, and playing the original file seems to be:
DLNA.ORG_OP=10;DLNA.ORG_CI=1 (stuttering)
VS
DLNA.ORG_OP=01;DLNA.ORG_CI=0 (playing correctly)


Zip, do you have any ideas what are the difference between these two use case ? Do you have a different buffer management? what else?
Thanks
<<

neige

Serviio newbie

Posts: 1

Joined: Tue Jan 21, 2014 10:23 pm

Post Wed Jan 22, 2014 2:33 am

Re: Transcoding issues on Bravia 2010

Although not a Bravia issue per se, I'm experiencing the exact same problem with a Sony BDP S790 while trying to play avi wrapped dv files.

Using either the BDP x90 profile or the Bravia 2012 (us) profile, the video plays with horrendous stuttering - sometimes freezing. As ext3 reported, the serviio’s transcoded *.srt file, when copied and re-named as a *.ts, plays normally. The outbound network traffic when playing the original *.avi is essentially limited to 2Mbps while when the *.ts plays the traffic frequently is over 3MB/s and sometimes over 4MB/s (from ifstat). Note: the dv .avi contains no audio and no subtitles. Serviio is running on a windows PC with a wired network.

Serviio transcodes the dv .avi (residing on a nas) using the following ffmpeg parameters:
  Code:
ffmpeg.exe -threads auto -i \\Nas-a9-c7-18\media\Video_Archive\8mm_transfers\0020 Verscio, Matterhorn\0020 Verscio, Matterhorn_0002_SD_18_fps.avi -y -threads auto -c:v mpeg2video -pix_fmt yuv420p -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -vf pad=960:480:120:0:black,setdar=4:3,setsar=8:9 -r 30000/1001 -g 15 -an -map 0:0 -sn -f mpegts D:\TEMP\Serviio\transcoding-temp-28-sony2012us-ORIGINAL.stf


Running ffmpeg directly in a dos cmd window with the serviio parameters shows it working at around 70 fps with bitrate around 12Mbps (max 12.8, min 10.5). The original *.avi plays at 29.970 fps, with encoded bit rate 28.8Mbps (SD dv, 720x480).

Using UpnP tools (AV Media Controller) to examine the original file I get:
  Code:
http-get:*:video/x-msvideo:DLNA.ORG_PN=AVI;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=015000000000000000000000000000

The transcoded file shows:
  Code:
http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_TS_SD_EU_ISO;DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=015000000000000000000000000


(So both are showing ORG_OP=01 and ORG_CI=0)

A few other possibly germane observations - if during a stuttering scene I hit the pause on the Sony and wait a few seconds, resuming play is smooth for a couple of seconds but the stuttering begins again. Also, like ext3, if I hit pause and let the *.srt file build to completion, resuming play continues to stutter as before. Occasionally the video will freeze and control over the Sony can only be achieved by hitting the stop play button on the remote. Then, when re-launching the video, it starts playing not from the beginning but from the freeze point - again with stuttering and with network data never really exceeding 2MB/s.

Maybe my machine is too slow transcoding at 70fps to keep up with a 30fps video but like ext3, I suspect the problem is a forced reduction in network bandwith when Serviio is running in transcoding mode.

It would be nice if we can figure this one out!

Return to Sony

Who is online

Users browsing this forum: No registered users and 29 guests

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