Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th April 2018, 20:46   #41  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by lauguru View Post
hello

How would you write the tweak for x265 of this encode?thanks


Chroma subsampling : 4:2:0 (Type 2)
Out of interest... What is 4.2.0 'type 2' all about? I've noticed it cropping up in a few of my sample files...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 5th April 2018, 20:49   #42  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
Quote:
Originally Posted by SeeMoreDigital View Post
Out of interest... What is 4.2.0 'type 2' all about? I've noticed it cropping up in a few of my sample files...
same as yuv420p10.
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 5th April 2018, 20:59   #43  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
Quote:
Originally Posted by SeeMoreDigital View Post
Out of interest... What is 4.2.0 'type 2' all about? I've noticed it cropping up in a few of my sample files...
Its the value of chroma_sample_loc_type_top_field/bottom_field. Basically the location of the subsampled chroma sample. When you reduce 4 samples to just one, you need to remember which location you sampled at.

Type 0 is the "normal" type for 4:2:0 which we've been using for years, also known as the MPEG2-type (MPEG1 was different) - for every 4 Luma samples, the Chroma sample sits in between the two Luma samples on the left

Like this, Luma being X, Chroma o
Code:
X X
o
X X
Type 2 is the "new" standard userd in certain UHD specifications, where the Chroma sample sits right on top of the top left Luma sample, ie:
(Chroma location in red)
Code:
X X
X X
This distinction is important when upscaling Chroma, because doing it wrong can introduce a slight shift in the chroma.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders

Last edited by nevcairiel; 5th April 2018 at 21:05.
nevcairiel is offline   Reply With Quote
Old 5th April 2018, 21:02   #44  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by froggy1 View Post
same as yuv420p10.
Thanks.

Does 'type 2' offer any benefit over regular 4.2.0?
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 5th April 2018, 21:25   #45  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,844
Quote:
Originally Posted by SeeMoreDigital View Post
Thanks.

Does 'type 2' offer any benefit over regular 4.2.0?
I'm not sure but nev explained it above much better than my extremely short post. What i meant as yuv420p10 is that you'll only come it across on 10 bits files. I've never seen a Type 2 on 8 bits ones, like never
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 5th April 2018, 21:27   #46  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,346
I don't know why they decided to change it. Maybe because its simpler? But basically, unless you are downsampling your own chroma, you just have to use the value that matches your content.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old 5th April 2018, 21:29   #47  |  Link
sneaker_ger
Registered User
 
Join Date: Dec 2002
Posts: 5,565
Some specs may even require it. E.g. UltraHD Blu-Ray demands type 2 for all BT.2020 content.
sneaker_ger is offline   Reply With Quote
Old 5th April 2018, 21:42   #48  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Sorry Nev, I missed your post in between posting my reply to froggy.

There's a guy over on the AVforum who's having a problem playing certain "Nvidia Encoded HEVC files" on his LG Oled B6. I asked him to upload a MediaInfo file report and the only odd thing I could see was the 'type 2' tag.

I looked through my HEVC samples and found a few a 'type 2' tag files that play fine on my humble LG 65UH770V.

Anyway, I've asked him to provide some samples.


Many thanks for the replies everyone
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 6th April 2018, 20:49   #49  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
Quote:
Originally Posted by nevcairiel View Post
I don't know why they decided to change it. Maybe because its simpler? But basically, unless you are downsampling your own chroma, you just have to use the value that matches your content.
I think it must be this. Scaling for all planes can be done relative to 0,0 at the top left.



Edit: Would 50% downscaling be faster and better quality? After all we already have all the exact chroma samples we need without any shifts or interpolation. This would be pretty common, displaying UHD on FHD displays.
__________________
madVR options explained

Last edited by Asmodian; 6th April 2018 at 20:54.
Asmodian is offline   Reply With Quote
Old 7th April 2018, 11:00   #50  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Quote:
Originally Posted by SeeMoreDigital View Post
...There's a guy over on the AVforum who's having a problem playing certain "Nvidia Encoded HEVC files" on his LG Oled B6. I asked him to upload a MediaInfo file report and the only odd thing I could see was the 'type 2' tag.

Anyway, I've asked him to provide some samples.
Update time... After receiving three samples and running them through eac3to v3.34, it reported the following: -
Code:
MKV, 1 video track, 1 audio track, 0:00:29, 48i /1.001
1: h265/HEVC, 3840x2176 48i /1.001 (30:17), 10 bits
2: AC3, 5.1 channels, 640kbps, 48kHz
[v01] Extracting video track number 1...
[a02] Extracting audio track number 2...
[v01] This doesn't seem to be a valid h265/HEVC stream (3).  <ERROR>
Aborted at file position 44040192.  <ERROR>
As you guys can see, not only has the HEVC video stream been encoded with 2176 (instead of 2160) pixels, it's reported as being 48i... Crazy!

And just to make matters even stranger... When I re-muxed his samples into the .m2ts container using TSmuxer GUI v2.6.12, they actually played on my LG 65UH770V
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 7th April 2018 at 11:04.
SeeMoreDigital is offline   Reply With Quote
Old 7th April 2018, 17:16   #51  |  Link
gonca
Registered User
 
Join Date: Jul 2012
Posts: 1,213
Quote:
Originally Posted by SeeMoreDigital View Post
Update time... After receiving three samples and running them through eac3to v3.34, it reported the following: -
Code:
MKV, 1 video track, 1 audio track, 0:00:29, 48i /1.001
1: h265/HEVC, 3840x2176 48i /1.001 (30:17), 10 bits
2: AC3, 5.1 channels, 640kbps, 48kHz
[v01] Extracting video track number 1...
[a02] Extracting audio track number 2...
[v01] This doesn't seem to be a valid h265/HEVC stream (3).  <ERROR>
Aborted at file position 44040192.  <ERROR>
As you guys can see, not only has the HEVC video stream been encoded with 2176 (instead of 2160) pixels, it's reported as being 48i... Crazy!

And just to make matters even stranger... When I re-muxed his samples into the .m2ts container using TSmuxer GUI v2.6.12, they actually played on my LG 65UH770V
I encode a lot of 4k with NVEnc and I never got those weird results
Could be cmd line or source filter issue
gonca is offline   Reply With Quote
Old 7th May 2018, 02:01   #52  |  Link
Qarmaa
Registered User
 
Join Date: Sep 2017
Posts: 5
Can someone explain why --uhd-bd option is forcing --no-open-gop option? The problem is Scenarist UHD can't mux seamless connected clips with closed-gop encoded streams. Sure I can turn off --uhd-bd option and manually set parameters that makes compliant UHD BD stream, but with open GOP. That way Scenarist can mux seamless, I'm just aware of compatibility with hardware players.

Last edited by Qarmaa; 7th May 2018 at 02:16.
Qarmaa is offline   Reply With Quote
Old 7th May 2018, 08:21   #53  |  Link
Qarmaa
Registered User
 
Join Date: Sep 2017
Posts: 5
In addition to previous post. I'm getting following error when trying to mux stream encoded with --uhd-bd (closed GOP):

Code:
Error : [MUX] Can not write MUX file(s) : Could not create MUX XML File(Video data in TS2 does not start with a closed GOP.[PlayList: PlayList#1, PlayItem : Clip#2, Clip: Clip#2])
Qarmaa is offline   Reply With Quote
Old 7th May 2018, 09:14   #54  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
@Qarmaa... I think it's to increase compatibility with some players that might have difficulties with a GOP that is too long. In broadcast, a closed GOP is required, not sure about UHD BDs.
FranceBB is offline   Reply With Quote
Old 7th May 2018, 12:31   #55  |  Link
Qarmaa
Registered User
 
Join Date: Sep 2017
Posts: 5
Problem solved using last build (not stable). Now video encoded with --uhd-bd mux in seamless correctly.
Qarmaa is offline   Reply With Quote
Old 8th May 2018, 06:57   #56  |  Link
TEB
Registered User
 
Join Date: Feb 2003
Location: Palmcoast of Norway
Posts: 363
Quote:
Originally Posted by FranceBB View Post
@Qarmaa... I think it's to increase compatibility with some players that might have difficulties with a GOP that is too long. In broadcast, a closed GOP is required, not sure about UHD BDs.
Where did u read that in broadcast Closed Gop is required? Ive been working with broadcast for 16 years and ive never closed a gop (besides in ABR stacks)
TEB is offline   Reply With Quote
Old 8th May 2018, 07:30   #57  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 325
Quote:
Originally Posted by TEB View Post
Where did u read that in broadcast Closed Gop is required? Ive been working with broadcast for 16 years and ive never closed a gop (besides in ABR stacks)
Ye, we use opened GOP on our HEVC-UHD hw-encoder as well. Fixed GOP though.
excellentswordfight is offline   Reply With Quote
Old 9th May 2018, 05:00   #58  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,904
@TEB and @excellentswordfight... I guess our playout playback ports are just particularly picky and demand it, then. For instance, the oldish ones we used for XDCAM50 1080i and the very old ones we used for DV25 576i required closed GOP. They were actually able to play open GOP files, but it wasn't recommended by specs and they said that it should have been avoided, in fact we tried with open GOP files and they took like a lot to seek, they were almost unseekable and this created issues coming back from a commercial break to resume playback at a specific timecode. They are probably one of the cheapest, yet crappiest playout ports. I wouldn't be surprised if other ports used by other companies (like yours) were able to play Open GOP files flawlessly.

Last edited by FranceBB; 9th May 2018 at 05:27.
FranceBB is offline   Reply With Quote
Old 9th May 2018, 14:47   #59  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 325
Quote:
Originally Posted by FranceBB View Post
@TEB and @excellentswordfight... I guess our playout playback ports are just particularly picky and demand it, then. For instance, the oldish ones we used for XDCAM50 1080i and the very old ones we used for DV25 576i required closed GOP. They were actually able to play open GOP files, but it wasn't recommended by specs and they said that it should have been avoided, in fact we tried with open GOP files and they took like a lot to seek, they were almost unseekable and this created issues coming back from a commercial break to resume playback at a specific timecode. They are probably one of the cheapest, yet crappiest playout ports. I wouldn't be surprised if other ports used by other companies (like yours) were able to play Open GOP files flawlessly.
We have videoservers for XDCAM as well that needs closed GOP, I was talking about contribution encoders.
excellentswordfight is offline   Reply With Quote
Old 17th May 2018, 17:27   #60  |  Link
user1085
Registered User
 
Join Date: Apr 2018
Posts: 22
I see that Google has an official documentation page for VP9 HDR encoding with ffmpeg

https://developers.google.com/media/vp9/hdr-encoding/

I took most of the settings from here and changed libvpx-vp9 to libx265 and my Vizio TV detects and plays HDR10 (shows HDR10 info).

Code:
ffmpeg -i strobe_scientist_18Mbps.webm -b:v 18000000 -pass 1 \
  -pix_fmt yuv420p10le \
  -color_primaries 9 -color_trc 16 -colorspace 9 -color_range 1 \
  -maxrate 26800000 -minrate 8040000 -profile:v 2 -vcodec libvpx-vp9 /dev/null && \
   ffmpeg -i strobe_scientist_18Mbps.webm -b:v 18000000 -pass 2 \
   -pix_fmt yuv420p10le \
   -color_primaries 9 -color_trc 16 -colorspace 9 -color_range 1 \
   -maxrate 26800000 -minrate 8040000 -profile:v 2 -vcodec libvpx-vp9 \
   strobe_scientist_18Mbps.webm
Few follow up questions on this
  • Are the settings above completely different from what's being discussed in this thread? I didn't see discussion around -color_primaries, -color_trc, -colorspace, -color_range
  • Is there anything I can add to above command line to improve the encodes?
  • The page mentions "HDR requires 2-pass encoding". Is that just for VP9 or is that true for x265 as well?because I'd like to use CRF if possible
user1085 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.