This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

hvc1 brand HEVC Video Stream for QuickTime Compatibility
#1
Hi,

I had a client ask why the files I'd sent them before worked in QuickTime, but the files from a recent delivery don't.  I've spent half a day pouring through technical docs trying to figure out the difference between the files, and the only thing that is different between them is that the codec id in the video stream in the older files is hvc1, while the codec id in the video stream of the new files is hev1.  Apparently Apple rejects playing any files with the hev1 brand in the video stream, because why wouldn't they.

In both cases the mp4 container uses the hvc1 codec id but apparently that's not enough for Apple.  Since the older version of x265 did flag the content (with the exact same encoding settings) as hvc1 I was wondering if there's a way to signal to x265 to add the hvc1 codec id instead of the hev1 id.  I don't see an option in the current gui, but I'm more than happy to append an attribute to the x265 call if there's one I can add.

I've attached two screenshots showing the old and new files and the only encoding difference between them.

Sam


Attached Files Thumbnail(s)
       
Reply
#2
Under "Config->Output->Container Settings->Mp4 Settings" try changing 'HEVC brand', enabling 'iTunes compatibility' might also help.
(Since Apple abandoned Quicktime on Windows and I don't own a Mac anymore, I can't test.)

Cu Selur
Reply
#3
(05.10.2018, 18:00)Selur Wrote: Under "Config->Output->Container Settings->Mp4 Settings" try changing 'HEVC brand', enabling 'iTunes compatibility' might also help.
(Since Apple abandoned Quicktime on Windows and I don't own a Mac anymore, I can't test.)

Cu Selur

Setting the brand words for changing the brand on the mp4 container to hvc1, but not on the HEVC stream - no matter what I set for that option x265 seems to write an hev1 brand to the video elementary stream.  And it's the stream brand that QuickTime's gawking at, even when I have iTunes compatibility enabled.

If you have any other ideas I'm happy to test them.  If not, I have a workaround for my clients (use mpv instead of QuickTime, which also has the benefit of much better playback performance), but if there's a fix lurking somewhere in the x265 syntax it'd be convenient to have the compatibility.

Sam
Reply
#4
The branding is normally not done by x265 but by the muxer which should be by default MP4Box.

Depending on the setting of "Config->Output->Container Settings->Mp4 Settings->HEVC brand", the MP4Box call should either contain '-brand hvc1' or '-brand hev1'.
When 'hvc1' is used MediaInfo reports:
Codec ID                                 : hvc1
and when 'hev1' is used, Codec ID should be
Codec ID                                 : hev1
but checking it, for some reason it's still hcv1.
-> Seems like this is a bug in MP4Box.
(Reported to the MP4Box devs to fix this, see: https://github.com/gpac/gpac/issues/1151)

=> Enabling "Config->Output->Container Settings->Mp4 Settings->FFmpeg instead of MP4Box" works around the issue in Hybrid.

Cu Selur
Reply
#5
Got a reply from the MP4Box devs:
Quote:You are using the wrong command line. -brand simply sets the brand. It does not change the sample entry or sample format. You have to import the media using the xps_inband option, see MP4Box -h import:

":xps_inband" Sets xPS inband for AVC/H264 and HEVC (for reverse operation, re-import from raw media)
see: https://github.com/gpac/gpac/issues/1151...-429164392

Hybrid will add xps_inband if you enable "Config->Output->Container Settings->Mp4 Settings->XPS" which in older versions was enabled by default, but I removed it when some people using Quicktime complained,..

-> would be nice if you could test it and report back.

Cu Selur
Reply
#6
I've tried a whole bunch of combinations of iTunes compatibility, XPS, FFMPEG, MP4Box and others, and I can't get the brand of the video stream to change away from hev1.  The container follows what I do, but the video stream doesn't.  Still stumped.  Will keep trying when I have more time.

Sam
Reply
#7
Hmm,.. I'll try to look into it over the weekend. Smile
-> will report back

Cu Selur
Reply
#8
Small question, did only use MediaInfo to check this or something else too? (MediaInfo might be wrong)

---

Using ffmpeg seems to work fine here,... see attachment
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)