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 > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th April 2021, 16:56   #1  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
XAVC Intra Class 300 and 480 in x264 (test volunteers required)

Hi there,
I'm looking for volunteers to test XAVC Intra Class 300 and 480 in x264 as they're not officially supported as classes.

XAVC Intra is a set of profile established by Sony that encode all frames as Intra according to the framerate of the profile.

The classes are:

XAVC Intra Class 50, XAVC Intra Class 100, XAVC Intra Class 200, XAVC Intra Class 300, XAVC Intra Class 480.

The number refers to the bitrate of a 29.970fps stream and is adjusted accordingly.
For instance, XAVC Intra Class 300 has a bitrate of 300 Mbit/s for 29.970fps and it doubles up to 600 Mbit/s if the framerate doubles to 59.940fps.
The bit depth is 10bit planar and the sampling is 4:2:2 planar (except for a particular case in which, for Class 50, 4:2:0 planar is also accepted).

The table shows the framerates relative to the classes:




Reference: Sony XAVC Specs

Classes are divided between XAVC Intra Class HD and XAVC Intra Class 4K where for the 4K ones interlaced encode is not supported.
Those classes have been implemented in x264 and can be called using:

Code:
x264.exe "AVS Script.avs" --avcintra 50 --avcintra-flavor sony
Code:
x264.exe "AVS Script.avs" --avcintra 100 --avcintra-flavor sony
Code:
x264.exe "AVS Script.avs" --avcintra 200 --avcintra-flavor sony
Code:
x264.exe "AVS Script.avs" --avcintra 300 --avcintra-flavor sony
Code:
x264.exe "AVS Script.avs" --avcintra 480 --avcintra-flavor sony
provided that the AVS Script takes care of the resolution, bit depth and sampling specs as specified before, otherwise either a warning or an error is gonna be displayed to the user.

The reason for the latter command "--avcintra-flavor sony" is that there are two flavors: the sony one, namely XAVC Intra and the Panasonic one, namely AVC Intra. The specifications for the Panasonic one differ from the Sony one, for instance the value for "--slices" is different. The Panasonic specs can be found here: AVC Intra Specs.


Encoding in x264 with classes 50, 100, 200 is currently officially supported, while classes 300 and 480 support is experimental.

Builds: Link

Source code: Link


This is how the MediaInfo of an XAVC Intra Class 480 50p PAL HLG HDR 1000 nits 3840x2160 Level 5.2 Profile Intra 4:2:2 planar 10bit 800 Mbit/s looks like after it has been encoded with x264 and muxed with BBC BMX in mxf:




This file has been successfully tested on the Versio UHD Playout Ports at Sky.



Such file has also been tried on AVID and it was recognized correctly as XAVC Intra Class 480.

If you're not willing to use the pseudo-official implementation and you would rather like to call the official x264 and encode it yourself, you can try to force the parameters yourself, however you won't be using things like the ad hoc quantization matrix:

Code:
avs4x264mod.exe "AVS Script.avs" --x264-binary "x264-10b.exe" --input-depth 16 --preset medium --profile high422 --level 5.2 
--keyint 1 --no-cabac --slices 8 --bitrate 500000 --vbv-maxrate 500000 --vbv-bufsize 10000 --overscan show --colormatrix bt2020nc 
--range tv --log-level info --thread-input --transfer arib-std-b67 --colorprim bt2020 --videoformat component --nal-hrd cbr --output-csp i422 
--output-depth 10 --output "raw_video.h264"

ffmpeg.exe -i "raw_video.h264" -i "AVS Script.avs" -map 0:0 -c:v copy -map 1:1 -c:a pcm_s24le -ar 48000 -f mxf "pre-final_output_UHD.mxf"

bmxtranswrap.exe --umid-type uuid -p -y 10:00:00:00 -o "final_output_UHD.mxf" "pre-final_output_UHD.mxf"

pause
Also remember that buffersize is bitrate divided by FPS (in my case 50fps for PAL UHD)


All credits to "ifb" for showing us the quantization matrix and implementing the code in his branch hoping it to be merged, to JPSD (Jean Philippe Scotto di Rinaldi) for actually merging the code to his branch and provide t_mod builds, to Steipal (Steinar Apalnes), emcodem and momocampo (Benjamin Dissoubret) for allowing me to code and implement the Sony Class Support in FFAStrans and to algie (Livio Aloja) for testing on NLE.






I would very much like to see it merged in the official master, so what I'm asking the community is:

A) If you're a broadcaster or a professional working in the field which owns a playout server (so hardware playout ports) which play official XAVC Intra Class 300 or 480 files just fine, please try to encode a sample yourself x264 and try to play it on your hardware playout port.

B) Report the result here so that we can gather a list of which servers actually support it and see if there are any incompatibilities and if we can tackle them somehow before committing a patch.


The current list is:

- Versio Playout Server: Ok, recognized and played fine
- AVID Media Composer: Ok, recognized and played fine


Thanks everyone,
Frank

Last edited by FranceBB; 11th February 2023 at 00:12.
FranceBB is offline   Reply With Quote
Old 13th April 2021, 21:09   #2  |  Link
ifb
Registered User
 
Join Date: Dec 2009
Posts: 72
No need to reinvent the wheel. There's an existing merge request on GitLab to add XAVC 300/480 if you want something to test:
https://code.videolan.org/videolan/x...rge_requests/6

Current builds here.

Code:
x264 "inputfile.y4m" --avcintra 300 --avcintra-flavor sony --output-depth 10 --output-csp i422 -o "raw_video.h264"
or
Code:
x264 "inputfile.y4m" --avcintra 480 --avcintra-flavor sony --output-depth 10 --output-csp i422 -o "raw_video.h264"
The patch tries to match the output of an EVS XT playback server. I don't know that all the CQM trickery it does is strictly necessary. That's why this patch is 3 years old and still marked WIP. It worked for me, but needs to be tested more.

Last edited by ifb; 13th April 2021 at 22:18. Reason: add example
ifb is offline   Reply With Quote
Old 14th April 2021, 00:11   #3  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Perfect. I'm gonna test it as soon as I get back to the office and I'll come back to you. If it works, I'll come back to you and post it here.
FranceBB is offline   Reply With Quote
Old 25th April 2021, 19:40   #4  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
All results were fine. I also modified the first post and commented in the branch.
I really hope this is merged to the master on GitLab, but I think we're gonna need more and more people to test it and comment there.
FranceBB is offline   Reply With Quote
Old 27th April 2021, 18:22   #5  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
After encoding with x264, I've tested the file in AVID, works like a charm:

FranceBB is offline   Reply With Quote
Old 29th April 2021, 17:23   #6  |  Link
Mitra
Registered User
 
Join Date: Mar 2021
Posts: 40
Using this build has not any Sony License issue?
Mitra is offline   Reply With Quote
Old 29th April 2021, 18:11   #7  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
I don't think so. Intra Class 50, 100, 200 were already there, so if those were available in the official master, I don't see anything preventing us from adding Class 300 and 480 as well, so... I don't think there's any problem in using those builds.
FranceBB is offline   Reply With Quote
Old 10th May 2021, 16:34   #8  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,309
New build r3059.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 11th May 2021, 17:25   #9  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by jpsdr View Post
New build r3059.
Great!
FranceBB is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:29.


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