increase quality of h.265 encoding (question)

hi everyone,

i’ve been trying to increase the quality of my h.264 to h.265 gstreamer transcoding on the jetson nano. obviously the bitrate has a great effect, but are there any other ways to tweak the outcome? encoding performance is not an issue (i don’t care how long it takes). so far i have come up with this:

/usr/bin/gst-launch-1.0 filesrc location="$1" ! \
   matroskademux name=demux ! queue ! \
   h264parse ! \
   omxh264dec ! progressreport update-freq=1 ! \
   videorate ! video/x-raw,framerate=23/1 ! \
   omxh265enc bitrate=1300000 preset-level=3 EnableTwopassCBR=1 control-rate=2 iframeinterval=50 ! \
   matroskamux name=mux ! \
   filesink location="$2"

i have also tried to use 10-bit encoding by supplying the “I420_10LE” format string, but that doesn’t work. however, using “I420” instead does work. so, does anyone know how to use the 10-bit colourspace when transcoding from h.264?
the following example fails with a coredump:

/usr/bin/gst-launch-1.0 filesrc location="$1" ! \
   matroskademux name=demux ! queue ! \
   h264parse ! \
   omxh264dec ! progressreport update-freq=1 ! \
   nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)<b>I420_10LE</b>' ! \
   omxh265enc bitrate=1300000 preset-level=3 EnableTwopassCBR=1 control-rate=2 iframeinterval=50 ! \
   matroskamux name=mux ! \
   filesink location="$2"

Hi,
It shall not bring you better quality to convert 8-bit content to 10-bit content. Another property about quality is qp-range:

qp-range            : Qunatization range for P and I frame,
                     Use string with values of Qunatization Range
                     in MinQpP-MaxQpP:MinQpI-MaxQpP:MinQpB-MaxQpB order, to set the property.

Please try to set it into small values.

For HD resolutions(720p, 1080p), 1.3Mbps may not be large enough. Suggest you try larger values.

  • preset-level=4
  • qp-range="25,35:21,28:-1,-1"

Works well here…