Synchronise HEVC 10bit to iOS 6s

The actual Transcode job request is:

Jul 22, 2018 20:10:46.451 [0x7f2e27bff700] DEBUG - TPU: hardware transcoding: final decoder: vaapi, final encoder: vaapi
Jul 22, 2018 20:10:46.454 [0x7f2e27bff700] DEBUG - Job running: EAE_ROOT='/volume1/Plex/tmp_transcoding/pms-0c52d34d-394d-4496-b1d0-65c7c8dc80d7/EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='/volume1/Plex/Library/Application\ Support/Plex\ Media\ Server/Codecs/e944d3a-1309-linux-ubuntu-x86_64/' XDG_CACHE_HOME='/volume1/Plex/Library/Application Support/Plex Media Server/Cache' XDG_DATA_HOME='/volume1/@appstore/Plex Media Server/Resources' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/volume1/@appstore/Plex Media Server/Plex Transcoder' '-codec:0' 'hevc' '-hwaccel:0' 'vaapi' '-hwaccel_fallback_threshold:0' '10' '-hwaccel_output_format:0' 'vaapi' '-codec:1' 'ac3' '-i' '/volume1/video/Series/Handmaid'\''s tale/T2/2x13 - The Handmaid'\''s Tale [x265].mkv' '-filter_complex' '[0:0]hwupload[0];[0]scale_vaapi=w=1920:h=1080:format=nv12[1];[1]hwupload[2]' '-filter_complex' '[0:1] aresample=async=1:ocl='\''stereo'\'':osr=48000[3]' '-map' '[2]' '-codec:0' 'h264_vaapi' '-b:0' '3938k' '-maxrate:0' '5251k' '-bufsize:0' '10502k' '-r:0' '23.975999999999999' '-map' '[3]' '-metadata:s:1' 'language=spa' '-codec:1' 'aac' '-b:1' '256k' '-map' '0:2' '-metadata:s:2' 'language=eng' '-codec:2' 'copy' '-copypriorss:2' '0' '-map' '0:3' '-metadata:s:3' 'language=spa' '-codec:3' 'mov_text' '-map' '0:4' '-metadata:s:4' 'language=eng' '-codec:4' 'mov_text' '-f' 'mp4' '-map_metadata' '-1' '-map_chapters' '-1' '-movflags' '+faststart' '/volume1/Plex/Library/Application Support/Plex Media Server/Cache/Transcode/Sync+/18215335/53/32571.mp4.temp' '-y' '-vaapi_device' '/dev/dri/renderD128' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/eae2c6b6-3d36-425e-9a72-a6d101019744/6a3c7d9c-aae7-4bd3-af50-5afce273a3a5/progress'

This has selected the AC-3 track audio and will map it down to stereo (it has the better source audio quality).

You’ll also notice PMS is preparing to output in Apple optimized MP4 so it will, after processing, (SDR and Stereo) be ready .

In order for HEVC to work on your Synology, you simply need to turn Hardware Transcoding off.
Be advised, HEVC is the most difficult to transcode. It was designed as a hardware only codec by the video industry for whatever reason .

@ChuckPa Ok, let me see if I understand the issue.

Plex tries to transcode the file for some odd reason (not really sure why it tries to do that, since my iPhone can play the file as-is, so just sending the raw file to my phone should work). Anyway, Plex tries to transcode the file via hardware (?) and since my Synology CPU doesn’t support that, it fails?

That’s where you’re not understanding what PMS must do.

You might be able to sync it via iTunes but that’s an Apple-Apple internal and usually undocumented API. They have direct access and can copy the file into position in your Videos section.

Plex can’t do that. It must live within the same constraints as as a browser or other 3rd party app.
Plex must call Apple’s media player interface and pass it the data as it expects it.
For the iPhone 6s, that means FMP4 format and SDR. This is what mandates the conversion .

Ok, understood. The file needs to be transcoded somehow because of limitations of how iOS works. Let’s accept that as granted.

But I still don’t see where the problem is. Why PMS is failing at transcoding the file? Is it because my Synology’s CPU isn’t able to transcode HEVC via hardware?

Correct.

Your DS916+ has (quoting Synology.com)
DS916+ Intel Pentium N3710 Quad Core 4 Yes Braswell DDR3 2 / 8 GB

Per the specification sheet from Intel:

While it does have Quick Sync Video support (H.264), it lacks support for HEVC. This is typically indicated by the ‘HD 500 graphics’ designation or higher specification.

Consider the graphics specification for the J3455 CPU in the DS918+ which can decode HEVC HDR.
Processor Graphics: Intel® HD Graphics 500

See the difference?

Okey, great. We’re moving to somewhere.

From what you’re saying I understand that my CPU can’t encode/decode to HEVC via hardware. But can it decode from HEVC to any other format via software? (I understand that encoding, not decoding, to HEVC must be done only via hardware).

Your NAS can do HEVC only in software. It will never encode to HEVC. It will, at most DECODE only.

Your NAS can encode to or decode from H.264 in hardware. That will be a trivial task.

This might help you understand what each of the models can and can’t do. I spent a great deal of time compiling this list. https://support.plex.tv/articles/201373803-nas-compatibility-list/ (follow the link on that page)

Great! So now you’re ready for the second question I made in this topic.

Why PMS can’t fallback from “Use hardware accel. when available” and decode via software my HEVC file and encode it via hardware to whatever format my iPhone 6s supports? (instead of failing).

Some things in HW transcoding aren’t perfect. That’s why it’s limited to Intel CPUs only right now. No sense in adding everything until ALL the issues are resolved.

In your case, HW transcoding is available. The question is: Why did it try to apply hardware transcoding to HEVC to a CPU not capable of it? That’s what I will be testing and likely submitting a ticket on.

If it had correctly determined “HW can’t be used”, it would have fallen back. I can go into the OS, flip the hardware flag and deny PMS access to it after it’s used it a few times and it properly falls back just as it should. The question is: How did this instance slip through?

Good question. Unfortunately I don’t have an answer to that. But I’ll gladly help you debug the problem if you give me instructions.

Thanks but I have everything here I need to debug and isolate with the appropriate Steps To Reproduce for the PMS and transcoding team.

My only challenge is to make the time away from everything else to dedicate and write this all up. :slight_smile: Today was supposed to be my day off. LOL

@ChuckPa Is there a public issue tracker that I can subscribe when you’ve created the issue?

Not at this time. Because of how I submit the trouble ticket, I reference source modules and specific lines of code (if known). Source code is, of course, company confidential.

@ChuckPa were you able to create the report? How is it going? Any ETA for when a fix might be ready?

It has been submitted.

Engineering doesn’t give me any visibility into their planning schedule.
I only see what’s coming after they have finished “Unit Test” (where the developer has just signed off on the work and is now passing it forward for further testing)

Hi @ChuckPa ! Any news on this?

I am now detailed to Engineering. That tell you something ? :smiley:

I can’t say more but hope you ‘hear me’ ?

@ChuckPa It has been some time since I last asked! Any news on this one? :slight_smile:

Didn’t that get implemented in the new iOS app? I thought it was scheduled.
Fragmented MP4, required for HEVC streaming, has been implemented in the server.
I do it here on my iPad Pro. Perhaps your 6s doesn’t support HEVC?

That might be it. From: Using HEIF or HEVC media on Apple devices - Apple Support

Working with this media

Support for HEIF and HEVC is built into iOS 11 and macOS High Sierra, letting you work with this media in a variety of apps, including Photos, iMovie, and QuickTime Player.

On some older devices, support for HEVC is also affected by the resolution and frame rate (fps) of the video:

  • iPhone 6, iPhone 6 Plus, and iPad Air 2 work with HEVC video that was captured at no greater than 1080p/240 fps.
  • iPhone 5s, iPad Air, and iPad mini (Retina models) work with HEVC video that was captured at no greater than 1080p/60 fps or 720p/240 fps.