Repository navigation
Nvenc encoder - #971
Nvenc encoder#971sgothel wants to merge 27 commits into
Conversation
… and mirror qsv_h264 values
Basically working: - h264_nvenc - hevc_nvenc Possible optimization: - Even in constant quality mode, a user ceiling bit_rate might be desirable, currently only the maximum is used like in VP8/9: w x h x fps Remaining issues: 1) Muxer issue with h264_nvenc + MKV, ffprobe shows: [h264 @ 0x55ae4dedacc0] sps_id 32 out of range [h264 @ 0x55ae4dedacc0] Invalid nal size 1677734572 [h264 @ 0x55ae4dedacc0] missing picture in access unit with size 40644 Notable: This does not happen with hevc_nvenc Tested: - GNU/Linux Debian 9 - GeForce GTX 950 - BD 1080p source, cropped: Around 70fps h264 + hevc
Adding 'rc-lookahead 32, init_qp 1, spatial_aq 1, aq-strength 8' for h264 and hevc in case of VBR CQ mode, see <https://devtalk.nvidia.com/default/topic/1013152/video-technologies/crf-for-nvenc/post/5179877/#5179877> and NVENC_VideoEncoder_API_ProgGuide.pdf v08 Chapter 8 p27, as well as Table 1 p33.
|
We currently use libav and don't have the capacity to be changing that short term, so we'll need to look at integrating any required fixes into libav. (or porting patches until such time libav pick them up) I can handle any Windows UI components, so don't need to worry about that. |
|
Depends on feature request 'issue' #974 |
| av_dict_set( &av_opts, "cq", quality, 0 ); | ||
|
|
||
| // further Advanced Quality Settings in Constant Quality Mode | ||
| av_dict_set( &av_opts, "init_qpP", "1", 0 ); |
There was a problem hiding this comment.
The UI's have an extra arguments box to allow strings to be passed through to configure the encoder. so we probably want to wire that in.
There was a problem hiding this comment.
yes, we can add those .. additionally. At the commented point these are for proper adaptive constant quality like x264
|
|
||
| # To build with nvenc: | ||
| # See <https://dwijaybane.wordpress.com/2017/07/19/ffmpeg-with-nvidia-acceleration-on-ubuntu-16-04-nvenc-sdk/> | ||
| # 1) Copy NVENC SDK's Video_Codec_SDK_8.0.14/Samples/common/inc/*.h to /usr/local/include/ |
There was a problem hiding this comment.
See, this is where I got a bit confused. Those headers I downloaded were NOT GPL compatible. FFMpeg seems to inlclude the required headers in another folder to avoid needing the SDK for this reason. libav currently does not.
There was a problem hiding this comment.
Ah, this would be for libav right?
| # See <https://dwijaybane.wordpress.com/2017/07/19/ffmpeg-with-nvidia-acceleration-on-ubuntu-16-04-nvenc-sdk/> | ||
| # 1) Copy NVENC SDK's Video_Codec_SDK_8.0.14/Samples/common/inc/*.h to /usr/local/include/ | ||
| # 2) Build cudautils | ||
| # wget http://developer.download.nvidia.com/compute/redist/ffmpeg/1511-patch/cudautils.zip |
There was a problem hiding this comment.
What are these headers required for?
There was a problem hiding this comment.
They are actually no more needed, since included in FFMPEG yup.
I copied these instruction earlier for myself .. should remove it.
There has been a somewhat heated discussion over this lately on the ffmpeg mailing list. The discussion was kicked off by the inclusion of external headers with the proposed AMD AMF patch. The thread below is the ongoing discussion after that patch was submitted. The consensus seems to be that allowing this inclusion of external headers into the ffmpeg code base was a mistake. But it's not clear yet what the outcome will be. |
|
@sr55 @jstebbins w/o having read above convo, AFAIK current state of the art and law is that simple declarations in headers w/o any algorithms is fine to be included (or re-written). |
…ad, header inclusion etc). FFMPEG 3.4 includes them all.
commit 0466852 moving to ffmpeg 3.4 enabled it's libx264 codec. Removed.
|
@sr55 @jstebbins reading a bit .. looks like the compromise indeed is to include basic headers and to dynamically link against system libraries. Good. |
|
I am w/ Timo here (include MIT licensed headers).. sometimes I believe discussions simply get out of hand. |
cherry picked patches from my '259-add-nvenc-encoder' branch, see https://github.com/sgothel/HandBrake/commits/259-add-nvenc-encoder
applicable on official master branch
I have not picked @compninja28 patches regarding windows components
due to heavy collisions:
Hopefully @compninja28 can help re-merging them.
+++
NVENC: Remaining fixes for a 1st working draft on GNU/Linux (GTK)
Basically working:
Remaining issues:
[h264 @ 0x55ae4dedacc0] sps_id 32 out of range
[h264 @ 0x55ae4dedacc0] Invalid nal size 1677734572
[h264 @ 0x55ae4dedacc0] missing picture in access unit with size 40644
Notable: This does not happen with hevc_nvenc
Tested: