Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Videoplayback is jumpy on ATV2 #30

Closed
henke66 opened this issue Oct 23, 2012 · 40 comments
Closed

Videoplayback is jumpy on ATV2 #30

henke66 opened this issue Oct 23, 2012 · 40 comments
Assignees

Comments

@henke66
Copy link

henke66 commented Oct 23, 2012

I downloaded your updated addon (3.0.0) on my ATV2. It was running but the videoplayback was jumpy on all (3) tested programs. The audio was ok.
The old version played fine on the former SVT-Play site on ATV2.
Any clue why video playback is now degraded?

@kokangit
Copy link
Contributor

Agree! I have the same experience. I tried to upgrade to a nightly frodo build for Apple TV 2 and it was the same problem. So, jumpy video on eden and frodo fo Apple TV2.

@linqcan
Copy link
Collaborator

linqcan commented Oct 25, 2012

We know.

This is SVT and XBMC related and not related to the plugin (it uses core XBMC functionality to play HLS streams).
It seems like SVT changed codec settings around October 16th which causes programs to stutter. Try the videos in the link below and you should see a difference.

I have asked SVT and I am awaiting feedback from them.

http://kontakt.svtplay.se/org/svt-play/d/har-ni-bytt-codec-installningar-den-senaste-veckan/

To repeat; playback issues etc are NOT related to the plugin. The plugin merely picks out the URL to the programs and feeds it to XBMC's video player. All bugs regarding playback should be filed in the XBMC forums.

@henke66
Copy link
Author

henke66 commented Oct 25, 2012

Thanks for the clarification. I assume you already reqported this in the XBMC forum.

@linqcan
Copy link
Collaborator

linqcan commented Oct 25, 2012

Nope. Haven't had time yet. Maybe this weekend. And I also need SVT's info for the XBMC team to be able to comment it.

@linqcan
Copy link
Collaborator

linqcan commented Oct 27, 2012

From the info SVT gave us, it seems like the ATV2 should support this codec configuration.
Would be interesting to see if ATV3 has the same problem.

My log was useless and I don't have an ATV2 here to take new logs from. If you have an ATV2; please generate a log file and open an issue over at the XBMC support forum.

Thinking about doing a test version of the plugin where we add an option to force the ATV2 to use the other streams (avc1.66.30) instead. Will see if I find time to test that...

Sources:
http://www.anandtech.com/show/5687/apple-tv-3-2012-mini-review/4
http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC
http://wiki.xbmc.org/index.php?title=Log_file
http://forum.xbmc.org/forumdisplay.php?fid=137

@nilzen
Copy link
Collaborator

nilzen commented Oct 28, 2012

Perhaps we should add a setting for maximum resolution and then the user can select a lower quality on ATV2?

@linqcan
Copy link
Collaborator

linqcan commented Oct 28, 2012

Yes, that's sort of what I was thinking about too. Was thinking about just
stripping out the "avc1.77.30" version from the playlist. But then you need
to be able to save the new playlist to disk to feed it to XBMC. Unsure if
we can/are allowed to save data to disk.
We could also just pick out one stream from the playlist according to the
user's preferred resolution, as you mention. Though, the HLS magic
(adaptable stream) is lost in that case but maybe that's something the user
can live with...

On Sun, Oct 28, 2012 at 12:44 PM, nilzen notifications@github.com wrote:

Perhaps we should add a setting for maximum resolution and then the user
can select a lower quality on ATV2?


Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-9844939.

@nilzen
Copy link
Collaborator

nilzen commented Oct 28, 2012

As far as I know there is no "HLS magic" built in to Xbmc, it just selects the highest quality stream allowed by the bitrate settings in Xbmc. xbmc/xbmc@8f043b4

@linqcan
Copy link
Collaborator

linqcan commented Oct 28, 2012

Oh, then we can ignore that issue then (for now) =)

On Sun, Oct 28, 2012 at 12:54 PM, nilzen notifications@github.com wrote:

As far as I know there is no "HLS magic" built in to Xbmc, it just selects
the highest quality stream allowed by the bitrate settings in Xbmc.
xbmc/xbmc@8f043b4xbmc/xbmc@8f043b4


Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-9845011.

@linqcan
Copy link
Collaborator

linqcan commented Oct 28, 2012

I've picked up an ATV2, about to create a temporary fix for the stream issue.
Issue is present on latest XBMC nightly, so I will try and produce a useful log and report the issue as soon as possible. But will do the patch before, so we can use our XBMC boxes again =)

@henke66
Copy link
Author

henke66 commented Oct 28, 2012

I have created a new thread in xbmc forum (ios support). http://forum.xbmc.org/showthread.php?tid=143832 and provided a xbmc.log file.

When looking at an episode on the web it seems that there are only two quality options (högsta and begränsad). Is this true or does "Automatisk" means that it will select from additional quality settings? When trying "begränsad" the video quality is just terrible. So I don't think using that selection is an option.

@linqcan
Copy link
Collaborator

linqcan commented Oct 28, 2012

Nice one with the fault report!
Hope it catches some attention from the maintainers.

I have now created a hack/fix for this issue.
What I do is that I strip the avc1.77.30 stream from the HLS playlist and feed XBMC with the stripped version.
This means that the maximum available resolution for the streams is 1024x576 (fairly watchable on my 42", and at least better than nothing). The option can be turned on in the settings menu.
It might need some more testing, my tests so far have been successful though.

Will create pull request for review.

@kokangit
Copy link
Contributor

I have tested to limit the bandwith to see if it makes any difference on my ATV2. I found that if I set the limit to 2560 kbps the tested film works fine. Setting it higher makes it stutter. I'm talking about the XBMC setting: Settings/System/Internet access/Internet connection bandwidth limitation.
The film I tested was "Moraeus med mera - del 8 av 8".

@linqcan
Copy link
Collaborator

linqcan commented Oct 29, 2012

New update on pull 34, takes kokangit's findings into account.

@linqcan
Copy link
Collaborator

linqcan commented Nov 2, 2012

Now merged.

@linqcan
Copy link
Collaborator

linqcan commented Nov 6, 2012

Think I know what the issue is with the avc1.77.30 streams from SVT. They use 720p@25fps but ATV2 only supports 720p@30fps. Suspecting this to be the issue, but I am not 100% sure, I could have misunderstood the frame rate limit...

http://www.anandtech.com/show/5687/apple-tv-3-2012-mini-review/4

@nilzen
Copy link
Collaborator

nilzen commented Nov 6, 2012

Not sure about that, since it says "Max Decode Parameters" I guess that 30fps is the maximum fps it can decode. 25fps < 30fps... or? :)

@linqcan
Copy link
Collaborator

linqcan commented Nov 6, 2012

Yeah, I read it the other way around...
On Nov 6, 2012 10:50 AM, "nilzen" notifications@github.com wrote:

Not sure about that, since it says "Max Decode Parameters" I guess that
30fps is the maximum fps it can decode. 25fps < 30fps... or? :)


Reply to this email directly or view it on GitHubhttps://github.com//issues/30#issuecomment-10104531.

@kokangit
Copy link
Contributor

kokangit commented Nov 9, 2012

Gah! Trying this video: Dokument inifrån - Thomas Quick del 1. Jumpy! Looking at the m3u8 reveals that there is only avc1.77.30. Out of luck I suppose!

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=836000,RESOLUTION=640x360,CODECS="avc1.77.30, mp4a.40.5"
http://svtplay3f-f.akamaihd.net/i/20120831/107904/PG-1130460-001A-QUICK-02-mp4-,c,d,e,-v1.mp4.csmil/index_0_av.m3u8?null=&e=b2a7ace1bf661c32&id=
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1386000,RESOLUTION=1024x576,CODECS="avc1.77.30, mp4a.40.5"
http://svtplay3f-f.akamaihd.net/i/20120831/107904/PG-1130460-001A-QUICK-02-mp4-,c,d,e,-v1.mp4.csmil/index_1_av.m3u8?null=&e=b2a7ace1bf661c32&id=
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2386000,RESOLUTION=1280x720,CODECS="avc1.77.30, mp4a.40.5"
http://svtplay3f-f.akamaihd.net/i/20120831/107904/PG-1130460-001A-QUICK-02-mp4-,c,d,e,-v1.mp4.csmil/index_2_av.m3u8?null=&e=b2a7ace1bf661c32&id=

@linqcan
Copy link
Collaborator

linqcan commented Nov 9, 2012

Yep :(
Strange though, maybe they were mixing with the codecs for some shows, or does this apply to everything in "öppet arkiv"?

@kokangit
Copy link
Contributor

kokangit commented Nov 9, 2012

I got there from Kategorier/Dokumentär/...
Looked in Öppet Arkiv and found at least one film with avc1.66.30

By the way, there seems to be no paging in öppet arkiv. Only got 8 rows?

@linqcan
Copy link
Collaborator

linqcan commented Nov 9, 2012

@kokangit Pull request #39 should fix the paging! =)

@kokangit
Copy link
Contributor

Thanks! This works fine!

@nilzen
Copy link
Collaborator

nilzen commented Nov 11, 2012

I've had a quick chat with memphiz on IRC and he said "this one has an incomplete sps data block as it seems (well based on the ffmpeg output) …"

@linqcan
Copy link
Collaborator

linqcan commented Nov 11, 2012

Seems strange. Assuming that the sources on SVT's servers are OK, then it seems like ffmpeg on Darwin can't handle it properly?
Has anyone tried on Windows? (My VirtualBox machine can't handle video playback... :-/)

(Btw: I don't have an ATV anymore to test on. Still aiming on implementing "Search" in the near future though.)

@kokangit
Copy link
Contributor

A stupid question: why not try the flash link? Will it not work? Worse quality?

@linqcan
Copy link
Collaborator

linqcan commented Nov 12, 2012

Can't access the f4m files, and quality is potentially worse...

wget http://svtplay4a-f.akamaihd.net/z/world/open/20121108/1240328-002A/GASTER_MED_GEST-002A-b91d4b30ab6dcf80_,900,320,420,620,1660,2760,.mp4.csmil/manifest.f4m
--2012-11-12 17:27:11-- http://svtplay4a-f.akamaihd.net/z/world/open/20121108/1240328-002A/GASTER_MED_GEST-002A-b91d4b30ab6dcf80_,900,320,420,620,1660,2760,.mp4.csmil/manifest.f4m
Resolving svtplay4a-f.akamaihd.net... 213.248.111.43, 213.248.111.10
Connecting to svtplay4a-f.akamaihd.net|213.248.111.43|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2012-11-12 17:27:11 ERROR 403: Forbidden.

@kokangit
Copy link
Contributor

http://svtplay3f-f.akamaihd.net/z/20120831/107904/PG-1130460-001A-QUICK-02-mp4-,c,d,e,-v1.mp4.csmil/manifest.f4m?hdcore=2.10.3&g=FFHZYRXUEEVL

Above got from inspection in chrome when playing svtplay. wget above link works. Remove parameters "hdcore=" and "g=" results in 403.

Haven't found out how to get the correct parameters yet though.

@linqcan
Copy link
Collaborator

linqcan commented Dec 2, 2012

They have started to use avc1.77.30 on more streams than just the 1280x720 now...
That is; less streams that work on ATV2...

A new and improved "stripper" is needed I guess...

Examples:
http://www.svtplay.se/video/880498/del-1-av-10?type=embed
http://www.svtplay.se/video/882287/del-5-av-5-detroit-usa?type=embed

@ghost ghost assigned linqcan Dec 2, 2012
@martinetc
Copy link

Thanks for a great job with the addon!
I tried Kokangits tip to change limit the xbmc bandwith settings - and it worked fine. For a while. Now most new videos are jumpy again.
Before Frodo there was an option in the svt play-addon settings to set quality - just like on the youtube app. Im stuck with slow adsl (6-8mbit) and had to settle for a poorer quality in order not for the addon to buffer constantly. Now with Frodo I rarely see the videos buffer even though the video quality is high - but constant stuttering. Could such a manual choice of quality be a solution?

@kokangit
Copy link
Contributor

kokangit commented Dec 7, 2012

My experience is that streams of type avc1.77.30 are jumpy on ATV2, but other streams (avc1.66.30) are OK. The fix made by linqcan filters the manifest so avc1.77.30 will never be used. This works for videos where there are avc1.66.30 streams available. Unfortunately there has been proof for videos with only avc1.77.30 streams. These videos will not work with ATV2 since there are no OK streams at all.

@linqcan
Copy link
Collaborator

linqcan commented Dec 7, 2012

SVTPlay offers two streaming variants in their webapp. The first variant is using Flash for streaming and is available for devices with Flash support. The second variant is using HLS streaming and is available to devices without Flash support, mainly iOS and Android devices. This plugin is taking advantage of the HLS variant.
HLS is offering the possibility to distribute different streams depending on the device's bandwidth. This is done by using a playlist file (m3u8) where streams can be coupled to a specified bandwidth. The client, XBMC, then decides the current available bandwidth and chooses the appropriate stream from the playlist file.
Furthermore, the HLS standard is also offering the possibility to use several different codecs or codec settings for streaming h264 stream. The codec information is also specified in the playlist file so that clients can choose, if alternative versions are specified.

In the case of SVTPlay they are offering different versions depending on bandwidth but only one codec setting per stream. They started off by using the avc1.66.30 codec setting for h264 which works well on all XBMC platforms. However, lately they have switched to avc1.77.30, which does not work properly on Apple TV2 (don't know about other platforms, yet). For a while this new codec setting was only used for the 720p streams, which lead to our "hack" where we used the second highest version instead. But a week or so ago they started using avc1.77.30 for all streams except the lowest quality streams. This change breaks the "hack" and also makes the SVTPlay on XBMC+Apple TV2 less than enjoyable.
The Apple TV2 hardware should be able to handle the avc1.77.30 codec setting, but there seem to be some issue with the XBMC player, which haven't been resolved (reported in the forums). Until that is resolved, there is unfortunately nothing we can do to enable an enjoyable SVTPlay experience on XBMC+Apple TV2. Note, that a lot of the older content is still working in <720p resolution. The latest codec changes just applies to programs published since the change.

Update: 1 second too late...

http://tools.ietf.org/html/draft-pantos-http-live-streaming-10#section-3.4.10
https://developer.apple.com/library/ios/#documentation/networkinginternet/conceptual/streamingmediaguide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html#//apple_ref/doc/uid/TP40008332-CH102-SW1

@linqcan
Copy link
Collaborator

linqcan commented Dec 7, 2012

Updated the stripping function, can be found on this branch: https://github.com/linqcan/xbmc-svtplay/commits/atv
Haven't tested it on ATV2 yet, but it (the stripping) seemed to work on a Windows machine. Could not judge the quality though since I am running Windows in a virtual machine with crappy video playback.
Might get my hands on an ATV2 this weekend that I can test on...

@linqcan
Copy link
Collaborator

linqcan commented Dec 9, 2012

Oh, and the issue is tracked here: http://forum.xbmc.org/showthread.php?tid=95495
And the XBMC team gives a short explanation of the issue here: http://forum.xbmc.org/showthread.php?tid=95495&pid=1202337#pid1202337

Hopefully my latest patch will ensure that ATV2 will see anything (though low resolution), but as stated above; HD will probably not happen for a while...

@linqcan
Copy link
Collaborator

linqcan commented Dec 9, 2012

Also, I tested my ATV branch on an ATV2 and it worked well. "All" programs were playable, though it is not HD but it works at least.

@MagerValp
Copy link

I just want to add that I have the exact same issue on XBMC 12.0b3 with xbmc-svtplay 3.1.2 running on my 2010 Mac Mini (MacMini4,1). Using the advanced option to not use 1.77.30 streams fixes it.

@linqcan
Copy link
Collaborator

linqcan commented Dec 16, 2012

Ok, but it runs the normal Mac builds right?
Maybe the hardware is not good enough for decoding 720p ts-files.

Anyhow, tested XBMC 12.0 RC1 on a Nvidia ION powered HTPC (XBMCbuntu) and it could handle the avc1.77.30 files properly. That is; 1280x720 streams work flawlessly.

To conclude; this is not a plugin issue but a XBMC/hardware/software issue. The "workaround" we offer in the settings will get you streaming for as long as SVT provides non-avc1.77.30 content.

@MagerValp
Copy link

It's a 2.4 GHz Intel Core 2 Duo, with GeForce 320M. Performance is not a problem with any other sources, and I can play the same stream using flash in Safari.

@linqcan
Copy link
Collaborator

linqcan commented Dec 16, 2012

Recommend you to post in XBMC forums, seems to be something going on/wrong. Also, upgrade to RC1 first before posting. Otherwise your issue won't be taken seriously. Lastly, don't forget to enable debugging and provide a log for them to dissect! =)

@linqcan
Copy link
Collaborator

linqcan commented Jan 14, 2013

Closing since it is not plugin related. Latest update to our HLS stripping mechanism will work as a workaround for as long as SVT provides compatible streams.

@linqcan linqcan closed this as completed Jan 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants