magmastonealex / ffproc

A batch transcoding system. Supports multiple remote workers.
Apache License 2.0
46 stars 4 forks source link

Feature Request: Apple-compatible HEVC videos #16

Closed aassaly closed 5 years ago

aassaly commented 6 years ago

Let me start by saying I have yet to actually try transcoding anything. That said, I'm really excited to give this thing a try!

I looked at the source code, and searched through the repository using GitHub. I'm lead to believe that the transcoded x265 output from the scripts are not compatible with Apple devices. I say this because I don't see the hvc1 tag configured anywhere.

All HEVC-capable Apple devices require the hvc1 tag to be set instead of the default ffmpeg tag hev1. ffmpeg's command to do this is: -tag:v hvc1

I don't know if enabling this would adversely affect HEVC playback on any non-Apple devices. So maybe a setting which can be added to the profiles could work as a way to control this.

Apple's docs have many other recommendations and can be found here: https://developer.apple.com/library/content/documentation/General/Reference/HLSAuthoringSpec/Requirements.html

magmastonealex commented 6 years ago

Thanks for checking out ffproc, and for doing the research on this!

That certainly seems doable - on a basic test, Plex, Android, Intel hardware, and ffplay software decode all seem to have no issues with the alternative packing format. I'll apply the option to my transcodes for a couple of days and see if I wind up with issues on any of the other platforms I use, but if that goes well, then I'll stick it on all hevc files output by ffproc.

The only downside to that is that it seems to require a fairly new ffmpeg, otherwise it only works with .mov files (basing that on the issue here). I use a modified Homebrew build on my Mac transcode machines, and whatever's newest in the Arch repos for Linux, and both seem alright with the flag, but I imagine Ubuntu based machines may have issues.

magmastonealex commented 6 years ago

Alright, I've pushed a commit to master to resolve this. I've tested on pretty much every device I own (I've spent long enough tweaking h.264 to have a process to do it pretty quick :smile: ), and everything seems happy with the files.

Let me know if this works for you! I don't have a new enough Apple device to test with.