Swiftfin icon indicating copy to clipboard operation
Swiftfin copied to clipboard

Video player doesn't work on Apple TV HD

Open makoni opened this issue 1 year ago • 18 comments

Describe the bug

The player doesn't start video playback on Apple TV HD running tvOS 16.4

I've cloned the repo and checked on tvOS simulator and it's easy to reproduce:

  1. Run the app on Apple TV HD Simulator
  2. Try to play a video from a server (I've tried a 1080p video). It won't start playing.

At the same time when I try Apple TV 4K Simulator everything works fine.

I've also tried on a real device - the default player and the native player from experimental settings doesn't work.

Application version

1.0.0(74)

Where did you install the app from?

App Store

Device information

Apple TV HD

OS version

tvOS 16.4

Jellyfin server version

10.8.10

makoni avatar Jun 14 '23 14:06 makoni

I want to add that I too have same issue. I have 16.x Tvos on apple tv hd and some videos won't Start playing on the apple tv but if I look at the dashboard using my phone on jellyfin, it says the video is playing on apple tv and time too progresses. But on apple tv, it just shows spinning circle on left side at bottom.

iamnewtogithubhelpme avatar Jun 24 '23 11:06 iamnewtogithubhelpme

What video codec are these videos in? I'd wager that since Apple TV HD has A8 chip, it is being hindered by the current Device profiles. If that is the issue here, https://github.com/jellyfin/Swiftfin/pull/519 will help.

holow29 avatar Jun 28 '23 00:06 holow29

I tried both HEVC and H.264, same result.

makoni avatar Jun 29 '23 19:06 makoni

It's the same on my Apple TV 4.

freaky-m0 avatar Sep 16 '23 07:09 freaky-m0

What's the update on this? Some movies don't even play.

purevertigo avatar Oct 19 '23 11:10 purevertigo

For me its every video that requires transcoding on the Apple TV HD, the same content plays perfectly on the Apple TV 4K's in the house.

gmacarthur avatar Oct 22 '23 22:10 gmacarthur

I have the same issue, looks like if I force direct play, the playback is working.

Settings > Experimental > Force Direct Play

micer avatar Nov 07 '23 14:11 micer

I have the same issue with my Apple TV HD. Some movies are not playing, and I can't narrow it down to one parameter only : it's not consistent with the codec, the resolution, the bitrate...

I made a lot of tests by forcing a low value bitrate streaming at the user level (between 3 and 10Mbps) so that the server transcodes every file in x264 and common codecs for the Apple TV HD. I think I have tested every combination of options with Direct Play / fmp4 with HLS / Native Player but nothing succeed.

My results : Native Player breaks every movies Some movies requires the Direct Play option and play fine. But this option breaks other movies (black screen no sound, sometimes with a navigation bar that shows the movie is playing, sometimes with an infinite spinning wheel) that play well with fmp4 with HLS. And vice & versa.

Overall, I think that the best compromise at the time is everything off in the experimental options. It's very strange because some huge BluRay rips are transcoded and played flawlessly. But "smaller" encoded files aren't.

I can confirm that the same user with Swiftfin works flawlessly on Apple TV 4K / iPad Pro 2018 / iPhone 13 mini without any experimental option and with every level of transcode.

Mickey016 avatar Nov 11 '23 15:11 Mickey016

Other jellyfin clients automatically transcode videos when the current device doesn't work with the file as-is. Together with #678 and #184 I think that currently Swiftfin only pulls the original file without regard for compatibility.

ShadowJonathan avatar Nov 13 '23 09:11 ShadowJonathan

Other jellyfin clients automatically transcode videos when the current device doesn't work with the file as-is. Together with #678 and #184 I think that currently Swiftfin only pulls the original file without regard for compatibility.

I guess you're right. But I wonder if it's the only problem. What surprises me is that, even when forcing a "very low bitrate" transcode (in order to get a x264 file that should be easily OK to process for this device), the playback doesn't work. I would have thought that we could find a solution via transcoding to circumvent this bug till a future fix.

Mickey016 avatar Nov 16 '23 06:11 Mickey016

even when forcing a "very low bitrate" transcode

If you mean the "maximum allowed Mbps" setting in jellyfin, that's exactly what I'm talking about; Swiftfin bypasses even that.

ShadowJonathan avatar Nov 16 '23 07:11 ShadowJonathan

Yes, that's what I meant. What's strange, is that the FFMpeg logs from the server show that the transcode starts with the correct parameters (1616kb/s in this example) :

Output #0, mpegts, to '/config/transcodes/dce8ebdb850e08dbe6b94f5cf581b091.ts':
  Metadata:
    encoder         : Lavf59.27.100
  Stream #0:0: Video: h264, qsv(tv, bt709, progressive), 720x300 [SAR 1:1 DAR 12:5], q=2-31, 1616 kb/s, 23.98 fps, 90k tbn (default)
    Metadata:
      encoder         : Lavc59.37.100 h264_qsv
    Side data:
      cpb: bitrate max/min/avg: 1616000/0/1616000 buffer size: 3232000 vbv_delay: N/A
  Stream #0:1: Audio: aac, 48000 Hz, 5.1, s16, 384 kb/s
    Metadata:
      encoder         : Lavc59.37.100 libfdk_aac
frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.42 bitrate=   0.0kbits/s speed=   5x    
frame=   79 fps=0.0 q=17.0 size=     512kB time=00:00:03.60 bitrate=1163.4kbits/s speed=6.14x 

Despite the transcoding process looks OK and keep on going on the server side, nothing but black screen on the Apple TV :'(

Mickey016 avatar Nov 16 '23 11:11 Mickey016

Might be then that swiftfin simply doesn't send over the correct profile to jellyfin to encode to, hmm.

ShadowJonathan avatar Nov 16 '23 13:11 ShadowJonathan

I found some things:

  1. The way the Transcoding URL got constructed does not work, it causes the player to exit immediately
  2. The profile selection is way too liberal for the Apple TV HD, it requires better tuning, which i will submit

ShadowJonathan avatar Nov 18 '23 13:11 ShadowJonathan

I don't think I understand everything you just said but looks like (great?) progress :) Thanks for your help @ShadowJonathan

Mickey016 avatar Nov 18 '23 13:11 Mickey016

  1. The profile selection is way too liberal for the Apple TV HD, it requires better tuning, which i will submit

Some work on this in #519 as I said earlier in the thread if you want to look.

holow29 avatar Nov 18 '23 13:11 holow29

I'm looking at that PR right now, it seems to fix/work ATVHD for me

ShadowJonathan avatar Nov 18 '23 13:11 ShadowJonathan

I have the same issue, looks like if I force direct play, the playback is working.

Settings > Experimental > Force Direct Play

Worked for me thanks

Ronzkie88 avatar Mar 07 '24 08:03 Ronzkie88