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)

Reply
 
Thread Tools Search this Thread Display Modes
Old 9th May 2023, 12:07   #1  |  Link
PatchWorKs
Registered User
 
PatchWorKs's Avatar
 
Join Date: Aug 2002
Location: Italy
Posts: 299
[FUN] ChatGPT writes QSVEnc commandline

Asked it to write an "anime content" transcoding commandline from AVC to HEVC:
Quote:
Here's an example command using QSVencc to transcode anime content from AVC to HEVC:
Code:
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:
Quote:
Here's an updated command using QSVencc to transcode anime content from AVC to HEVC with additional quality parameters:
Code:
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:
Quote:
Certainly! Here's the updated command using QSVencc to transcode anime content from AVC to HEVC with the recommended `animation` tune preset:
Code:
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:
Quote:
Sure, here's an updated command using QSVencc optimized for the best quality achievable according to Intel's oneVPL encoding guidelines:
Code:
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-generated commandline, we suggested it to add more parameters that should help to increase the result quality:
Quote:
Here's the updated command using QSVencc to transcode anime content from AVC to HEVC with the additional quality parameters you specified:
Code:
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 !
__________________
HYbrid Multimedia Production Suite page @ GitHub
PatchWorKs is offline   Reply With Quote
Old 9th May 2023, 13:49   #2  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 322
There are a lot of odd things going on here:

* There is no "preset" slower for qsvencc64, the preset/quality level is set by --quality were "best" is the highest quality preset.
* --tier high makes no sense when setting vbv limitis bellow main tier
* max-bitrate and bufsize parameters seems to be taken for streaming tuning. Unless tuning for specific constrains use what is dictated by level and tier used.
* b-frames 3 is low for animation, at least 8 should be used.
* --b-adapt is an on/off switch as far as i know.
* --tune animition dont exist in qsvencc64 as far as i know
* 8 frames is a tiny lookahead.
* aq-mode doesnt exist in qsvencc64

etc etc...

Last edited by excellentswordfight; 9th May 2023 at 14:03.
excellentswordfight is offline   Reply With Quote
Old 9th May 2023, 17:15   #3  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 339
Looks like I'll not be obsolete in the next 3-5 years. Yay.
rwill is offline   Reply With Quote
Old 9th May 2023, 19:13   #4  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,525
It is called chat for a reason.
chat!=expert
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 9th May 2023, 19:15   #5  |  Link
microchip8
ffx264/ffhevc author
 
microchip8's Avatar
 
Join Date: May 2007
Location: /dev/video0
Posts: 1,843
Que?

What's the point of this? You think ChatGPT can outsmart a human?
__________________
ffx264 || ffhevc || ffxvid || microenc
microchip8 is offline   Reply With Quote
Old 9th May 2023, 19:19   #6  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,525
If that was directed to me:
I meant != -> not equal to
(If not directed to me, please don't mind)
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're that issue working on. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 9th May 2023, 19:45   #7  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 339
Quote:
Originally Posted by microchip8 View Post
Que?

What's the point of this? You think ChatGPT can outsmart a human?
I think ChatGPT can outsmart a really stupid human tho...
rwill is offline   Reply With Quote
Old 17th May 2023, 18:19   #8  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,725
Generative AI is really good at predicting what a human would answer to questions, for questions within the bounds of the data it was trained on. Mixing up parts of different common answers to the same sort of question is pretty common.

Generative AI isn't going to create settings better than the best common knowledge, alas. I hope they scrape Doom9, which would help a bunch!
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 10th June 2023, 19:14   #9  |  Link
Balling
Registered User
 
Join Date: Feb 2020
Posts: 535
Quote:
Originally Posted by benwaggoner View Post
Generative AI is really good at predicting what a human would answer to questions, for questions within the bounds of the data it was trained on. Mixing up parts of different common answers to the same sort of question is pretty common.

Generative AI isn't going to create settings better than the best common knowledge, alas. I hope they scrape Doom9, which would help a bunch!
Wrong. It has all source code of the world there too.
Balling is offline   Reply With Quote
Reply

Tags
chatgpt, encode, hardware, hevc, quick sync

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 23:55.


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