Log in

View Full Version : Improve startup time of x265 video on AppleTV


ShortKatz
8th September 2018, 20:46
If I store a video (normal encoded with x265 using Handbrake) on my NAS and then stream it to an AppleTV, it will take several minutes until the video starts. I was able to improve this startup time a bit by checking the “Web Optimised” checkbox in Handbrake, which seems similar to ffmpeg -movflags faststart.
Is there any x265 command line option (maybe some Bitstream option) to improve the startup time of the video even more?

I found this: https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices#//apple_ref/doc/uid/TP40016596

Blue_MiSfit
9th September 2018, 21:55
HEVC outside of HLS sounds tough to pull off on iOS / tvOS to me. I doubt they've put much emphasis on progressive download.

MeteorRain
14th September 2018, 05:48
Sounds to me like a muxer issue rather than an encoder issue. How do you mux the video?
You should be able to ask the muxer to write moov (index data) before mdat (picture data).
I don't own an apple TV so this is just my guess.

RanmaCanada
15th September 2018, 06:56
You should be using Plex or Emby to feed your content to your Apple TV. Both have their pros and cons and their costs, if any.

benwaggoner
15th September 2018, 12:36
If I store a video (normal encoded with x265 using Handbrake) on my NAS and then stream it to an AppleTV, it will take several minutes until the video starts. I was able to improve this startup time a bit by checking the “Web Optimised” checkbox in Handbrake, which seems similar to ffmpeg -movflags faststart.
Is there any x265 command line option (maybe some Bitstream option) to improve the startup time of the video even more?

That making the movie "Fast Start" helped suggests that it is something to do with demuxing. Or if the bitrate is high and the connection is slow, it might be buffering before it starts progressive download. I'd only expect that to be an issue if you're using iffy WiFi to connect to the NAS.

ShortKatz
24th September 2018, 16:15
Sounds to me like a muxer issue rather than an encoder issue. How do you mux the video?
HandBrake does this for me.


You should be able to ask the muxer to write moov (index data) before mdat (picture data).
How would I do that?

You should be using Plex or Emby to feed your content to your Apple TV. Both have their pros and cons and their costs, if any.
I now use Infuse Pro on my AppleTV. Doing so, the video starts much faster. But I play the original mkv in Infuse instead of converting it with HandBrake to MP4. So, its not a fix, just a workaround.

I'd only expect that to be an issue if you're using iffy WiFi to connect to the NAS.

I do not use WiFi, it is directly connected over a CAT6 cable.

sneaker_ger
24th September 2018, 16:41
You should be able to ask the muxer to write moov (index data) before mdat (picture data).
That's what "Web Optimized" does. (Which he said he already activated)