PatchWorKs
9th May 2023, 12:07
Asked it to write an "anime content" transcoding commandline from AVC to HEVC:
Here's an example command using QSVencc to transcode anime content from AVC to HEVC:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --qp 18 --vbr-quality 3 --audio-copy
Then we asked to rewrite by considering quality parameters discussed here (https://forum.redfox.bz/threads/qsvenc-hevc.86690/):
Here's an updated command using QSVencc to transcode anime content from AVC to HEVC with additional quality parameters:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --max-bitrate 8000 --vbv-bufsize 16000 --qp 18 --aq-mode 2 --vbr-quality 3 --gop-len 120 --bframes 3 --b-adapt 2 --audio-copy
In this updated command, I've included several additional quality parameters that can help improve the visual quality of the output video. Here's what each parameter does:
--max-bitrate 8000: specifies the maximum video bitrate in kilobits per second (kbps) for the output file. This value should be set based on the resolution and framerate of the source video, as well as the desired output file size and quality. In this example, I've used a value of 8000 kbps, which should be suitable for most 1080p videos.
--vbv-bufsize 16000: specifies the video buffer size in kilobits. This value should be set to twice the maximum bitrate value, so in this case, I've set it to 16000 kbps to match the max-bitrate value of 8000 kbps.
--aq-mode 2: specifies the adaptive quantization mode to use. Adaptive quantization can help improve the visual quality of the output video by adjusting the quantization level for different areas of the video frame based on their complexity. A value of 2 indicates a high quality adaptive mode.
--gop-len 120: specifies the GOP (group of pictures) length, which is the number of frames between each keyframe. A longer GOP length can help improve compression efficiency, but can also reduce the visual quality of the output video. In this example, I've set the GOP length to 120 frames, which should be suitable for most videos.
--bframes 3: specifies the number of B-frames to use. B-frames are a type of inter-frame compression that can help improve compression efficiency and visual quality, but can also increase encoding time and require more computational resources. In this example, I've set the number of B-frames to 3, which should be suitable for most videos.
--b-adapt 2: specifies the B-frame adaptive mode to use. B-frame adaptive mode can help optimize the use of B-frames based on the complexity of the video content. A value of 2 indicates a high quality adaptive mode.
Then we asked to add the best --tune preset to the previous commandline according to this page (https://github.com/rigaya/QSVEnc/blob/master/QSVEncC_Options.en.md#--tune-stringstring):
Certainly! Here's the updated command using QSVencc to transcode anime content from AVC to HEVC with the recommended `animation` tune preset:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --max-bitrate 8000 --vbv-bufsize 16000 --qp 18 --aq-mode 2 --vbr-quality 3 --gop-len 120 --bframes 3 --b-adapt 2 --tune animation --audio-copy
In this updated command, I've included the `--tune animation` parameter to enable the `animation` tune preset. The `animation` preset is specifically designed for animated content such as anime, and can help improve the visual quality of the output video by optimizing the encoding settings for animated content.
We also asked to optimize according to oneVPL's guidelines (https://github.com/intel/media-delivery/blob/master/doc/quality.rst#enctools-and-extbrc):
Sure, here's an updated command using QSVencc optimized for the best quality achievable according to Intel's oneVPL encoding guidelines:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --extbrc --la-depth 8 --tier high --rc-mode 2-pass --max-bitrate 8000 --vbv-bufsize 16000 --qp 18 --aq-mode 2 --vbr-quality 3 --gop-len 120 --bframes 3 --b-adapt 2 --tune animation --audio-copy
In this updated command, I've included the `--extbrc` parameter to enable Intel's Enhanced Targeted Bitrate Control (eTBC) algorithm for bitrate control, which can help achieve higher video quality at lower bitrates. I've also set `--la-depth` to 8 to enable Lookahead-based bitrate control and `--tier` to high to enable High-tier encoding, which can help improve visual quality. Additionally, I've set `--rc-mode` to 2-pass for better bitrate control and `--bitrate` to 1500 kbps as per your requirement.
In the end, basing on FastFlix (https://github.com/cdgriffith/FastFlix/)-generated commandline, we suggested it to add more parameters that should help to increase the result quality:
Here's the updated command using QSVencc to transcode anime content from AVC to HEVC with the additional quality parameters you specified:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --extbrc --la-depth 8 --tier high --rc-mode 2-pass --max-bitrate 8000 --vbv-bufsize 16000 --qp 18 --aq-mode 2 --vbr-quality 3 --gop-len 120 --bframes 3 --b-adapt 2 --tune animation --quality best --profile auto --level auto --chromaloc auto --colorrange auto --colormatrix auto --transfer auto --colorprim auto --output-depth 10 --avsync cfr --adapt-ref --adapt-ltr --adapt-cqm --audio-copy
In this updated command, I've added the following parameters:
--quality best: sets the encoding quality to the highest possible setting
--profile auto: selects the appropriate profile based on the input content and encoding settings
--level auto: selects the appropriate level based on the encoding settings
--chromaloc auto: automatically selects the chroma sample location based on the input content
--colorrange auto: automatically selects the color range based on the input content
--colormatrix auto: automatically selects the color matrix based on the input content
--transfer auto: automatically selects the transfer function based on the input content
--colorprim auto: automatically selects the color primaries based on the input content
--output-depth 10: sets the output bit depth to 10 bits
--avsync cfr: forces a constant frame rate output
--adapt-ref: enables adaptive reference frame insertion
--adapt-ltr: enables adaptive long-term reference frame insertion
--adapt-cqm: enables adaptive chroma quantization matrix selection
From what we've understood, it mixed up ffmpeg_QSV and QSVEnc encoding parameters (where did it get "--tune animation" or 2pass, for example ?), so could someone help fix/finetune it correctly ?
What resources do you suggest to provide it for better results ?
Thanks !
Here's an example command using QSVencc to transcode anime content from AVC to HEVC:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --qp 18 --vbr-quality 3 --audio-copy
Then we asked to rewrite by considering quality parameters discussed here (https://forum.redfox.bz/threads/qsvenc-hevc.86690/):
Here's an updated command using QSVencc to transcode anime content from AVC to HEVC with additional quality parameters:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --max-bitrate 8000 --vbv-bufsize 16000 --qp 18 --aq-mode 2 --vbr-quality 3 --gop-len 120 --bframes 3 --b-adapt 2 --audio-copy
In this updated command, I've included several additional quality parameters that can help improve the visual quality of the output video. Here's what each parameter does:
--max-bitrate 8000: specifies the maximum video bitrate in kilobits per second (kbps) for the output file. This value should be set based on the resolution and framerate of the source video, as well as the desired output file size and quality. In this example, I've used a value of 8000 kbps, which should be suitable for most 1080p videos.
--vbv-bufsize 16000: specifies the video buffer size in kilobits. This value should be set to twice the maximum bitrate value, so in this case, I've set it to 16000 kbps to match the max-bitrate value of 8000 kbps.
--aq-mode 2: specifies the adaptive quantization mode to use. Adaptive quantization can help improve the visual quality of the output video by adjusting the quantization level for different areas of the video frame based on their complexity. A value of 2 indicates a high quality adaptive mode.
--gop-len 120: specifies the GOP (group of pictures) length, which is the number of frames between each keyframe. A longer GOP length can help improve compression efficiency, but can also reduce the visual quality of the output video. In this example, I've set the GOP length to 120 frames, which should be suitable for most videos.
--bframes 3: specifies the number of B-frames to use. B-frames are a type of inter-frame compression that can help improve compression efficiency and visual quality, but can also increase encoding time and require more computational resources. In this example, I've set the number of B-frames to 3, which should be suitable for most videos.
--b-adapt 2: specifies the B-frame adaptive mode to use. B-frame adaptive mode can help optimize the use of B-frames based on the complexity of the video content. A value of 2 indicates a high quality adaptive mode.
Then we asked to add the best --tune preset to the previous commandline according to this page (https://github.com/rigaya/QSVEnc/blob/master/QSVEncC_Options.en.md#--tune-stringstring):
Certainly! Here's the updated command using QSVencc to transcode anime content from AVC to HEVC with the recommended `animation` tune preset:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --max-bitrate 8000 --vbv-bufsize 16000 --qp 18 --aq-mode 2 --vbr-quality 3 --gop-len 120 --bframes 3 --b-adapt 2 --tune animation --audio-copy
In this updated command, I've included the `--tune animation` parameter to enable the `animation` tune preset. The `animation` preset is specifically designed for animated content such as anime, and can help improve the visual quality of the output video by optimizing the encoding settings for animated content.
We also asked to optimize according to oneVPL's guidelines (https://github.com/intel/media-delivery/blob/master/doc/quality.rst#enctools-and-extbrc):
Sure, here's an updated command using QSVencc optimized for the best quality achievable according to Intel's oneVPL encoding guidelines:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --extbrc --la-depth 8 --tier high --rc-mode 2-pass --max-bitrate 8000 --vbv-bufsize 16000 --qp 18 --aq-mode 2 --vbr-quality 3 --gop-len 120 --bframes 3 --b-adapt 2 --tune animation --audio-copy
In this updated command, I've included the `--extbrc` parameter to enable Intel's Enhanced Targeted Bitrate Control (eTBC) algorithm for bitrate control, which can help achieve higher video quality at lower bitrates. I've also set `--la-depth` to 8 to enable Lookahead-based bitrate control and `--tier` to high to enable High-tier encoding, which can help improve visual quality. Additionally, I've set `--rc-mode` to 2-pass for better bitrate control and `--bitrate` to 1500 kbps as per your requirement.
In the end, basing on FastFlix (https://github.com/cdgriffith/FastFlix/)-generated commandline, we suggested it to add more parameters that should help to increase the result quality:
Here's the updated command using QSVencc to transcode anime content from AVC to HEVC with the additional quality parameters you specified:
qsvencc64.exe --input "input_file.avi" --output "output_file.mkv" --codec hevc --preset slower --extbrc --la-depth 8 --tier high --rc-mode 2-pass --max-bitrate 8000 --vbv-bufsize 16000 --qp 18 --aq-mode 2 --vbr-quality 3 --gop-len 120 --bframes 3 --b-adapt 2 --tune animation --quality best --profile auto --level auto --chromaloc auto --colorrange auto --colormatrix auto --transfer auto --colorprim auto --output-depth 10 --avsync cfr --adapt-ref --adapt-ltr --adapt-cqm --audio-copy
In this updated command, I've added the following parameters:
--quality best: sets the encoding quality to the highest possible setting
--profile auto: selects the appropriate profile based on the input content and encoding settings
--level auto: selects the appropriate level based on the encoding settings
--chromaloc auto: automatically selects the chroma sample location based on the input content
--colorrange auto: automatically selects the color range based on the input content
--colormatrix auto: automatically selects the color matrix based on the input content
--transfer auto: automatically selects the transfer function based on the input content
--colorprim auto: automatically selects the color primaries based on the input content
--output-depth 10: sets the output bit depth to 10 bits
--avsync cfr: forces a constant frame rate output
--adapt-ref: enables adaptive reference frame insertion
--adapt-ltr: enables adaptive long-term reference frame insertion
--adapt-cqm: enables adaptive chroma quantization matrix selection
From what we've understood, it mixed up ffmpeg_QSV and QSVEnc encoding parameters (where did it get "--tune animation" or 2pass, for example ?), so could someone help fix/finetune it correctly ?
What resources do you suggest to provide it for better results ?
Thanks !