cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
483 Views
Registered: ‎05-31-2018

4ev board can not encode 4k60fps yuv422 video stream with ctrlsw_encode command

I want use ctrlsw_encode command to encode 3840*2160 60 fps video stream , here is my cfg file :

#--------------------------------------------------------------------------
#                          Configuration file
#--------------------------------------------------------------------------

#--------------------------------------------------------------------------
[INPUT]
#--------------------------------------------------------------------------

# YUVFile : YUV input file
YUVFile = 4k.yuv

# Width, Height: frame width/height in pixels
# width and height shall be multiple of 8 pixels
Width  = 3840
Height = 2160

# Format : FOURCC format of input file
# typical file formats       : I420, I422, I0AL, I2AL...
# hardware supported formats : NV12, NV16, P010, P210... (depends of the hw ip)
# default value : I420
Format = NV16

#--------------------------------------------------------------------------
[OUTPUT]
#--------------------------------------------------------------------------

# BitstreamFile : elementary stream output file
BitstreamFile = bitstream.hevc

# RecFile : optional output file for reconstructed pictures
#RecFile = rec.yuv

#--------------------------------------------------------------------------
[RATE_CONTROL]
#--------------------------------------------------------------------------

# RateCtrlMode : selects the bit rate control mode
# allowed values : CONST_QP, CBR, VBR, ...
# default value  : CONST_QP
RateCtrlMode = CBR

# FrameRate : number of frames per second
# default value : 30
FrameRate = 60

# BitRate: target bitrate in kbit/s (not used when RateCtrlMode = CONST_QP)
# default value : 4000
BitRate = 10000

# MaxBitRate: maximum bitrate in kbit/s used when RateCtrlMode = VBR
# MaxBitRate shall be equal to BitRate when RateCtrlMode = CBR or LOW_LATENCY
# default value : 4000
MaxBitRate = 100000

# SliceQP : Quantization Parameter
# when RateCtrlMode = CONST_QP, it defines the QP for all slices, otherwise it specifies the initial QP
# allowed values : from 0 to 51, AUTO
# default value  : 30
SliceQP = 30

# CPBSize : specifies the size of the Coded Picture Buffer as specified in the HRD model, in seconds (not used when RateCtrlMode = CONST_QP)
# default value : 3.0
CPBSize = 1.0

# InitialDelay : specifies the initial removal delay as specified in the HRD model, in seconds (not used when RateCtrlMode = CONST_QP)
# default value : 1.5
InitialDelay = 1.0

#--------------------------------------------------------------------------
[GOP]
#--------------------------------------------------------------------------

# GopCtrlMode : specifies the Group Of Pictures configuration
# allowed values : DEFAULT_GOP, LOW_DELAY_P, LOW_DELAY_B, PYRAMIDAL_GOP
# default value  : DEFAULT_GOP
GopCtrlMode = DEFAULT_GOP

# Gop.Length : GOP length in frames including the I picture. 0 = Intra only
# default value : 30
Gop.Length = 60

# Gop.NumB : maximum number of consecutive B frames in a GOP (used only when GopCtrlMode = DEFAULT_GOP or PYRAMIDAL_GOP)
# allowed values : 0 to 4    when GopCtrlMode = DEFAULT_GOP
#                  3, 5 or 7 when GopCtrlMode = PYRAMIDAL_GOP
# default value  : 0
Gop.NumB = 4

# Gop.FreqIDR : minimum number of frames between two IDR pictures (IDR insertion depends on the position of the GOP boundary)
# allowed values : positive value or -1 to disable IDR insertion
# default value  : -1
#Gop.FreqIDR = 25

#--------------------------------------------------------------------------
[SETTINGS]
#--------------------------------------------------------------------------

# Profile : specifies the standard/profile to which the bitstream conforms
# allowed values : AVC_BASELINE, AVC_MAIN, AVC_HIGH, AVC_HIGH10, AVC_HIGH_422,
#                  HEVC_MAIN, HEVC_MAIN10, HEVC_MAIN_422_10...
# (Some profile might not be supported by your hardware ip, see hardware ip specification)
Profile = HEVC_MAIN_422_10

# Level : specifies the level to which the bitstream conforms
# allowed values : 1.0 to 5.2 for AVC, 1.0 to 5.1 for HEVC
Level = 5.1

# Tier : specifies the tier to which the bitstream conforms (HEVC only)
# allowed values : MAIN_TIER, HIGH_TIER
#Tier = MAIN_TIER

# ChromaMode : selects the chroma subsampling mode used to encode the stream
# allowed values : CHROMA_MONO, CHROMA_4_2_0, CHROMA_4_2_2
# default value  : CHROMA_4_2_0
ChromaMode = CHROMA_4_2_2

# BitDepth : specifies the bit depth of the luma and chroma samples in the encoded stream
# allowed values : 8, 10
# default value  : 8
BitDepth = 8

# NumSlices : number of row-based slices used for each frame
# allowed values : from 1 up to the number of coding unit rows in the frame
# default value  : 1
NumSlices = 4

# QPCtrlMode : specifies how to generate the QP per coding unit
# allowed values : UNIFORM_QP, AUTO_QP, LOAD_QP, LOAD_QP | RELATIVE_QP
# default value  : UNIFORM_QP
QPCtrlMode = UNIFORM_QP

# ScalingList : specifies the scaling list mode
# allowed values : FLAT, DEFAULT, CUSTOM
# default value  : DEFAULT
ScalingList = FLAT

# EntropyMode : selects the entropy coding mode (AVC only)
# allowed values : MODE_CAVLC, MODE_CABAC
# default value  : MODE_CABAC
EntropyMode = MODE_CABAC

# LoopFilter : enables/disables the deblocking filter
# allowed values : ENABLE, DISABLE
# default value  : ENABLE
LoopFilter = ENABLE

#--------------------------------------------------------------------------
[RUN]
#--------------------------------------------------------------------------

# Loop : specifies whether the encoder should loop back to the beginning of the YUV input stream when it reaches the end of the file
# Allowed values : TRUE, FALSE
# default value  : FALSE
Loop = TRUE

# MaxPicture : number of frames to encode
# Allowed value : ALL, 1 .. 2147483647
# default value : ALL
MaxPicture = 300

# FirstPicture : specifies the first frame to encode
# Allowed value : 0 .. 2147483647
# default value : 0
FirstPicture = 0

but , the results show that it's only 51fps. how to modify cfg file to achieve 60fps

Tags (1)
0 Kudos
7 Replies
Highlighted
Moderator
Moderator
413 Views
Registered: ‎11-09-2015

Re: 4ev board can not encode 4k60fps yuv422 video stream with ctrlsw_encode command

Hi @singlee 

What tool do you use to check the final frame rate?

Can you share the bitstream.hevc you are getting?

Thanks

Regards


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Highlighted
Mentor
Mentor
392 Views
Registered: ‎06-16-2013

Re: 4ev board can not encode 4k60fps yuv422 video stream with ctrlsw_encode command

Hi @singlee 

 

I'm confusing about your configuration file.

Because it is inconsistent for color (bit) depth.

Why do you choose profile as HEVC_MAIN_422_10 even if bitdepth is 8bit ?

 

I suggest to make sure color depth.

 

Best regards,

Highlighted
Moderator
Moderator
355 Views
Registered: ‎11-21-2018

Re: 4ev board can not encode 4k60fps yuv422 video stream with ctrlsw_encode command

Hi @singlee 

Do you have any update on this? 

Regards, 

Aoife
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Highlighted
Observer
Observer
342 Views
Registered: ‎05-31-2018

Re: 4ev board can not encode 4k60fps yuv422 video stream with ctrlsw_encode command

 

Thank you for replay. 

I notice that the hardware ip cannot support H264 YUV422 8BIT (I'm not sure for that) , so i change it to h264 yuv422 8bit ;

Here is my new configuration.

 

#--------------------------------------------------------------------------
#                          Configuration file
#--------------------------------------------------------------------------

#--------------------------------------------------------------------------
[INPUT]
#--------------------------------------------------------------------------

# YUVFile : YUV input file
YUVFile = 4k.yuv

# Width, Height: frame width/height in pixels
# width and height shall be multiple of 8 pixels
Width  = 3840
Height = 2160

# Format : FOURCC format of input file
# typical file formats       : I420, I422, I0AL, I2AL...
# hardware supported formats : NV12, NV16, P010, P210... (depends of the hw ip)
# default value : I420
Format = NV16

#--------------------------------------------------------------------------
[OUTPUT]
#--------------------------------------------------------------------------

# BitstreamFile : elementary stream output file
BitstreamFile = /dev/null

# RecFile : optional output file for reconstructed pictures
#RecFile = rec.yuv

#--------------------------------------------------------------------------
[RATE_CONTROL]
#--------------------------------------------------------------------------

# RateCtrlMode : selects the bit rate control mode
# allowed values : CONST_QP, CBR, VBR, ...
# default value  : CONST_QP
RateCtrlMode = CBR

# FrameRate : number of frames per second
# default value : 30
FrameRate = 60

# BitRate: target bitrate in kbit/s (not used when RateCtrlMode = CONST_QP)
# default value : 4000
BitRate = 4000

# MaxBitRate: maximum bitrate in kbit/s used when RateCtrlMode = VBR
# MaxBitRate shall be equal to BitRate when RateCtrlMode = CBR or LOW_LATENCY
# default value : 4000
MaxBitRate = 40000

# SliceQP : Quantization Parameter
# when RateCtrlMode = CONST_QP, it defines the QP for all slices, otherwise it specifies the initial QP
# allowed values : from 0 to 51, AUTO
# default value  : 30
SliceQP = 51

# CPBSize : specifies the size of the Coded Picture Buffer as specified in the HRD model, in seconds (not used when RateCtrlMode = CONST_QP)
# default value : 3.0
CPBSize = 1.0

# InitialDelay : specifies the initial removal delay as specified in the HRD model, in seconds (not used when RateCtrlMode = CONST_QP)
# default value : 1.5
InitialDelay = 0

#--------------------------------------------------------------------------
[GOP]
#--------------------------------------------------------------------------

# GopCtrlMode : specifies the Group Of Pictures configuration
# allowed values : DEFAULT_GOP, LOW_DELAY_P, LOW_DELAY_B, PYRAMIDAL_GOP
# default value  : DEFAULT_GOP
GopCtrlMode = LOW_DELAY_P

# Gop.Length : GOP length in frames including the I picture. 0 = Intra only
# default value : 30
Gop.Length = 30

# Gop.NumB : maximum number of consecutive B frames in a GOP (used only when GopCtrlMode = DEFAULT_GOP or PYRAMIDAL_GOP)
# allowed values : 0 to 4    when GopCtrlMode = DEFAULT_GOP
#                  3, 5 or 7 when GopCtrlMode = PYRAMIDAL_GOP
# default value  : 0
Gop.NumB = 0

# Gop.FreqIDR : minimum number of frames between two IDR pictures (IDR insertion depends on the position of the GOP boundary)
# allowed values : positive value or -1 to disable IDR insertion
# default value  : -1
Gop.FreqIDR = 60

#--------------------------------------------------------------------------
[SETTINGS]
#--------------------------------------------------------------------------

# Profile : specifies the standard/profile to which the bitstream conforms
# allowed values : AVC_BASELINE, AVC_MAIN, AVC_HIGH, AVC_HIGH10, AVC_HIGH_422,
#                  HEVC_MAIN, HEVC_MAIN10, HEVC_MAIN_422_10...
# (Some profile might not be supported by your hardware ip, see hardware ip specification)
Profile = AVC_HIGH_422

# Level : specifies the level to which the bitstream conforms
# allowed values : 1.0 to 5.2 for AVC, 1.0 to 5.1 for HEVC
Level = 5.2

# Tier : specifies the tier to which the bitstream conforms (HEVC only)
# allowed values : MAIN_TIER, HIGH_TIER
#Tier = HIGH_TIER

# ChromaMode : selects the chroma subsampling mode used to encode the stream
# allowed values : CHROMA_MONO, CHROMA_4_2_0, CHROMA_4_2_2
# default value  : CHROMA_4_2_0
ChromaMode = CHROMA_4_2_2

# BitDepth : specifies the bit depth of the luma and chroma samples in the encoded stream
# allowed values : 8, 10
# default value  : 8
BitDepth = 8

# NumSlices : number of row-based slices used for each frame
# allowed values : from 1 up to the number of coding unit rows in the frame
# default value  : 1
NumSlices = 4

# QPCtrlMode : specifies how to generate the QP per coding unit
# allowed values : UNIFORM_QP, AUTO_QP, LOAD_QP, LOAD_QP | RELATIVE_QP
# default value  : UNIFORM_QP
QPCtrlMode = UNIFORM_QP

# ScalingList : specifies the scaling list mode
# allowed values : FLAT, DEFAULT, CUSTOM
# default value  : DEFAULT
ScalingList = DEFAULT

# EntropyMode : selects the entropy coding mode (AVC only)
# allowed values : MODE_CAVLC, MODE_CABAC
# default value  : MODE_CABAC
EntropyMode = MODE_CABAC

# LoopFilter : enables/disables the deblocking filter
# allowed values : ENABLE, DISABLE
# default value  : ENABLE
LoopFilter = ENABLE

#--------------------------------------------------------------------------
[RUN]
#--------------------------------------------------------------------------

# Loop : specifies whether the encoder should loop back to the beginning of the YUV input stream when it reaches the end of the file
# Allowed values : TRUE, FALSE
# default value  : FALSE
Loop = TRUE

# MaxPicture : number of frames to encode
# Allowed value : ALL, 1 .. 2147483647
# default value : ALL
MaxPicture = 300

# FirstPicture : specifies the first frame to encode
# Allowed value : 0 .. 2147483647
# default value : 0
FirstPicture = 0

 

 

Result shows just 37fps:

root@vcu_uz7ev_cc:/home/work# ctrlsw_encoder -cfg encode.cfg 
Allegro DVT2 - AVC/HEVC Encoder Reference Software v1.0.41 - Copyright (C) 2018
Confidential material

  Encoding picture #299    - Flushing...
Achieved bitrate = 0.0000 Kbps


300 pictures encoded. Average FrameRate = 37.5704 Fps
root@vcu_uz7ev_cc:/home/work# 

 

0 Kudos
Highlighted
Observer
Observer
335 Views
Registered: ‎05-31-2018

Re: 4ev board can not encode 4k60fps yuv422 video stream with ctrlsw_encode command

The ctrlsw_encode command output statistical results.
0 Kudos
Highlighted
Mentor
Mentor
331 Views
Registered: ‎06-16-2013

Re: 4ev board can not encode 4k60fps yuv422 video stream with ctrlsw_encode command

Hi @singlee 

 

You have to concern the following parameters without contradiction.

 

- Format

- Profile

- BitDepth

 

Especially, NV12 and NV16 is for 8bit color depth.

If your input color depth is 10 bit, you must use P010 or P210.

 

NV12 = YUV 4:2:0 8bit

NV16 = YUV 4:2:2 8bit

P010 = YUV 4:2:0 10bit

P210 = YUV 4:2:2 10bit

 

https://docs.microsoft.com/en-us/windows/win32/medfound/10-bit-and-16-bit-yuv-video-formats

 

Best regards,

0 Kudos
Highlighted
Observer
Observer
302 Views
Registered: ‎05-31-2018

Re: 4ev board can not encode 4k60fps yuv422 video stream with ctrlsw_encode command

My bitstream is 8Bit. and i change my configuration file to :

    Format = NV16

    Profile = HEVC_MAIN_422_10 

    ChromaMode = CHROMA_4_2_2

    BitDepth = 8

In my opinion, HEVC_MAIN_422_10 is higher profile, it should be compatible lower profile(such as 422 8bit , cause i can't find that profile, so i use 422 10bit instead of it ). Can this hardware ip encode YUV422 8Bit bitstream to h265 stream ? If it can do, Which one should I choose ? Or can i encode to h264 stream with 60fps ? The result shows h264 have lower fps than h265.

 

0 Kudos