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 > MPEG-4 Encoder GUIs

Reply
 
Thread Tools Search this Thread Display Modes
Old 27th November 2015, 14:11   #741  |  Link
JohnLai
Registered User
 
Join Date: Mar 2008
Posts: 445
Quote:
Originally Posted by NikosD View Post
For me h264_qsv works fine, but hevc_qsv doesn't seem to work.
It isn't working for my discrete gpu + headless igpu setup, all my 4 cores jumped to max utilization with 0% utilization on HD4000.

As for "Hardware accelerated decoding with frame threading is not supported." solution, you must specify;

ffmpeg -threads 1 -benchmark -hwaccel dxva2 -i test.mkv -an -sn -f null -

But...ffmpeg nvenc_hevc sure leaves a lot to be desired. Nothing much to control except specifying preset, level and tier.

ffmpeg -threads 1 -hwaccel dxva2 -i test.mkv -an -sn -preset slow -tier high -level 4.1 -vcodec nvenc_hevc output.mkv

I was playing around with ffmpeg nvenc_hevc and using the best possible option I can find from https://github.com/FFmpeg/FFmpeg/blo...vcodec/nvenc.c , the end encoded video quality is downright abysmal. Full of visible blocking artifacts. Preset 'slow' has two pass enabled judging from the nvenc.c code and it should be the best preset ;

slow, medium, fast, hq, hp, bd, ll, llhp, llhq, lossless, losslesshp and default

Lack of user configurable option? How to select rate control mode? Where to specify CQP value? MinQP and MaxQP? How to specify b-frame value for H264 and number of reference frame?

I prefer rigaya NVencC encoder in this case. His encoder has more functions and produce way better video quality than ffmpeg right now.

I am hoping for the h264_qsv decoder to be working so that stax76 can include it once ffmpeg developers got the VPP resize working as ffmpeg video filter. >.> But, h264_qsv decoder doesn't seem to work in my case. Back to zero again T_T
JohnLai is offline   Reply With Quote
Old 27th November 2015, 14:32   #742  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,352
Quote:
Originally Posted by JohnLai View Post

As for "Hardware accelerated decoding with frame threading is not supported." solution, you must specify;

ffmpeg -threads 1 -benchmark -hwaccel dxva2 -i test.mkv -an -sn -f null -
No, it doesn't work for me. No HW acceleration, it falls back to SW.
__________________
Win 10 x64 (17134.81) - Core i3-4170/ iGPU HD 4400 (v.4835)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all
NikosD is offline   Reply With Quote
Old 27th November 2015, 16:13   #743  |  Link
JohnLai
Registered User
 
Join Date: Mar 2008
Posts: 445
Quote:
Originally Posted by NikosD View Post
No, it doesn't work for me. No HW acceleration, it falls back to SW.
Strange, it works on mine though (GTX970). Oh well, I surrender.....I shall leave the hard work figuring it out to stax76.....
JohnLai is offline   Reply With Quote
Old 28th November 2015, 02:06   #744  |  Link
Magik Mark
Registered User
 
Join Date: Dec 2014
Posts: 516
Quote:
Originally Posted by JohnLai View Post
Asus X99 Sabertooth - i7 5820 - Asus Strix GTX 960 4G - DDR4 16GB Predator - Pioneer KRP 600M (isf calibrated) - Windows 10 x64 - Kodi with DSplayer - Lav - MadVR - XYsubtitle


Your system;
Decode(GTX 960)---->(post processing) CPU based resizer (I7-5820K)---->Encode(GTX 960).


Generally, in your case;

"%app:ffmpeg%" -hwaccel dxva2 -i "%script_file%" -f yuv4mpegpipe -pix_fmt yuv420p -loglevel error - | "%app:NVEncC%" --sar %target_sar% --codec h265 --y4m --cqp 20:23:25 --cu-min 8 --cu-max 32 --aq --ref 5 --level 4.1 --bframes 0 --input - --output "%encoder_out_file%"

Free free to use different rate control method, such as --cqp 20:23:25 to --VBR2 4500 (Note, nvenc VBR 2 pass encode is really slow, gtx 970 = 150fps for encoding HEVC 1080P)
John, --y4m does not work with vbr2. Needed to remove that

Are there any other settings, parameters, filters that we can use to enhance the image and improve quality using vbr2?
__________________
Asus X99 Sabertooth - Xeon E5 2695 - Asus Strix GTX 960 4G - DDR4 16GB Predator - Pioneer KRP 600M (isf calibrated) - Yamaha A3030 - Windows 10 x64 - Kodi with DSplayer - Lav - MadVR - XYsubtitle
Magik Mark is offline   Reply With Quote
Old 28th November 2015, 04:52   #745  |  Link
JohnLai
Registered User
 
Join Date: Mar 2008
Posts: 445
Quote:
Originally Posted by Magik Mark View Post
John, --y4m does not work with vbr2. Needed to remove that

Are there any other settings, parameters, filters that we can use to enhance the image and improve quality using vbr2?
@Magik Mark,
Download stax76 test build from here.
https://drive.google.com/folderview?...kE&usp=sharing

Staxrip test build H265 Nvidia preset has the vbr2 and AQ option now.
To replace the ffmpeg dxva2, go Filters--->Source, right click and select FFVideoSource. Much more easier.

As bearer of bad news, there is nothing more we can do to enhance and improve the quality using nvenc vbr2......





@NikosD,
I can confirm the -threads 1 with -hwaccel dxva2 doesn't work on my Core I3-4330 with only IGPU HD4600 being connected to display. It falls back to software decode as you mentioned. Noteworthy, the h264_qsv decode + encode with -hwaccel qsv actually works with great speed. (GPUZ report 85-93% utilization with -hwaccel qsv enabled for complete QSV transcode)

However, on my gaming system with GTX970 (connected to display) with I5-3570K igpu HD4000(headless), h264_qsv totally fall back to software decode. But the -threads 1 -hwaccel dxva2 works for the GTX970.

Sigh.....oh well, rigaya did mention he might implement all in one fully accelerated nvencc transcode (decode + nvenc resize + zero copy + nvenc). I hope he can successfully implement it.

Although I do think future upcoming FFMPEG video filter for QSV VPP has better quality than Nvidia ffmpeg resize filter sample patch.

From ffmpeg patch note;
QSV VPP resize = VPP uses a separable 8-tap poly-phase scaling filter with adaptive filter ringing suppression.

Nvidia Nvenc resize = From the patch code, I only saw Subsample_Bilinear ? =.=""
JohnLai is offline   Reply With Quote
Old 28th November 2015, 05:11   #746  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,352
Quote:
Originally Posted by JohnLai View Post
@NikosD,
Noteworthy, the h264_qsv decode + encode with -hwaccel qsv actually works with great speed. (GPUZ report 85-93% utilization with -hwaccel qsv enabled for complete QSV transcode)
Yes, -hwaccel qsv is exactly that.
Full speed transcoding without copy-back but without using any VPP filters.

When ffmpeg implements VPP, they have to keep using GPU memory only without copying to system ram, in order to be fast.

Quote:
Originally Posted by JohnLai View Post
Although I do think future upcoming FFMPEG video filter for QSV VPP has better quality than Nvidia ffmpeg resize filter sample patch.

From ffmpeg patch note;
QSV VPP resize = VPP uses a separable 8-tap poly-phase scaling filter with adaptive filter ringing suppression.

Nvidia Nvenc resize = From the patch code, I only saw Subsample_Bilinear ? =.=""
It is true that even since SandyBridge at 2011, Intel had better HW implemented algorithms for everything regarding VPP (resizing, deinterlacing, scaling etc)
__________________
Win 10 x64 (17134.81) - Core i3-4170/ iGPU HD 4400 (v.4835)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all
NikosD is offline   Reply With Quote
Old 28th November 2015, 10:46   #747  |  Link
Magik Mark
Registered User
 
Join Date: Dec 2014
Posts: 516
Quote:
Originally Posted by JohnLai View Post

@Magik Mark,
Download stax76 test build from here.
https://drive.google.com/folderview?...kE&usp=sharing

Staxrip test build H265 Nvidia preset has the vbr2 and AQ option now.
To replace the ffmpeg dxva2, go Filters--->Source, right click and select FFVideoSource. Much more easier.

As bearer of bad news, there is nothing more we can do to enhance and improve the quality using nvenc vbr2......
Can any other graphics card do better in x265 encoding with video enhancements, filters or processing? Something similar to CPU based encoding? How about SLI based encoding? Is this even possible with results similar to CPU?
__________________
Asus X99 Sabertooth - Xeon E5 2695 - Asus Strix GTX 960 4G - DDR4 16GB Predator - Pioneer KRP 600M (isf calibrated) - Yamaha A3030 - Windows 10 x64 - Kodi with DSplayer - Lav - MadVR - XYsubtitle
Magik Mark is offline   Reply With Quote
Old 28th November 2015, 11:44   #748  |  Link
JohnLai
Registered User
 
Join Date: Mar 2008
Posts: 445
Quote:
Originally Posted by Magik Mark View Post
Can any other graphics card do better in x265 encoding with video enhancements, filters or processing? Something similar to CPU based encoding? How about SLI based encoding? Is this even possible with results similar to CPU?
-.- I think you are confused about something.

HEVC/H.265 is a video compression standard.
x265 = software to encode HEVC compliant video.

As for your question, the ONLY alternative in which there might be better in hardware HEVC encoding with all those video processing done in hardware style (deinterlacing,sharpening, high quality resizing, color conversion, bla bla bla bla.......) is Intel Quicksync available only for Skylake microarchitecture. Yet......no hardware can ever beat software based encoding in term of quality.

SLI based encoding? Nvenc SDK only designed for single gpu so far.
JohnLai is offline   Reply With Quote
Old 28th November 2015, 13:25   #749  |  Link
deekey777
Registered User
 
Join Date: Jan 2008
Posts: 92
I cannot use AMD VCE:
Quote:
Error Encoding using VCEEncC

Encoding using VCEEncC failed with error code 1

Unknow Options: "--input"



StaxRip.ErrorAbortException: Encoding using VCEEncC failed with error code 1

Unknow Options: "--input"


bei StaxRip.Proc.Start() in D:\Projekte\GitHub\staxrip\General\Proc.vb:Zeile 233.
bei StaxRip.AMDEncoder.Encode(String args) in D:\Projekte\GitHub\staxrip\General\VideoEncoder.vb:Zeile 1643.
bei StaxRip.AMDEncoder.Encode() in D:\Projekte\GitHub\staxrip\General\VideoEncoder.vb:Zeile 1633.
bei StaxRip.MainForm.Encode() in D:\Projekte\GitHub\staxrip\Forms\MainForm.vb:Zeile 2292.
bei StaxRip.MainForm.RunJobRecursive() in D:\Projekte\GitHub\staxrip\Forms\MainForm.vb:Zeile 3587.
Here is the Log:
Quote:
------------------------------------------------------------
Encoding using VCEEncC
------------------------------------------------------------

"C:\Users\Denis x64\Downloads\StaxRip_x64_1.3.1.7_beta\Apps\VCEEncC\VCEEncC64.exe" --quality slow --cqp 22:24:27 --input "E:\Videos\HDTV-1080p-H264_007-Casino-Royale_AC3 temp files\HDTV-1080p-H264_007-Casino-Royale_AC3_new.avs" --output "E:\Videos\HDTV-1080p-H264_007-Casino-Royale_AC3 temp files\HDTV-1080p-H264_007-Casino-Royale_AC3_new_out.h264"

Unknow Options: "--input"

------------------------------------------------------------
Error Encoding using VCEEncC
------------------------------------------------------------

Encoding using VCEEncC failed with error code 1

Unknow Options: "--input"


Start: 13:21:09
End: 13:21:09
Duration: 00:00:00
PC: Windows 10 Pro x64 1511, R7 260X with the Crimson driver.

Quote:
Originally Posted by stax76 View Post
Here is a build with VCEEncC support for AMD H.264 encoding, I could not test it so I hope it works.

The build also fixes the issue with dialogs showing in command line mode.

http://www.mediafire.com/download/si..._2015-09-28.7z
Oh, missed this posting. Give me 10 minutes.

Doesn't work.

Last edited by deekey777; 28th November 2015 at 13:29.
deekey777 is offline   Reply With Quote
Old 28th November 2015, 22:42   #750  |  Link
Magik Mark
Registered User
 
Join Date: Dec 2014
Posts: 516
Quote:
Originally Posted by JohnLai View Post
-.- I think you are confused about something.

HEVC/H.265 is a video compression standard.
x265 = software to encode HEVC compliant video.

As for your question, the ONLY alternative in which there might be better in hardware HEVC encoding with all those video processing done in hardware style (deinterlacing,sharpening, high quality resizing, color conversion, bla bla bla bla.......) is Intel Quicksync available only for Skylake microarchitecture. Yet......no hardware can ever beat software based encoding in term of quality.

SLI based encoding? Nvenc SDK only designed for single gpu so far.
As always, Thanks a lot for the info!
__________________
Asus X99 Sabertooth - Xeon E5 2695 - Asus Strix GTX 960 4G - DDR4 16GB Predator - Pioneer KRP 600M (isf calibrated) - Yamaha A3030 - Windows 10 x64 - Kodi with DSplayer - Lav - MadVR - XYsubtitle
Magik Mark is offline   Reply With Quote
Old 29th November 2015, 07:45   #751  |  Link
Magik Mark
Registered User
 
Join Date: Dec 2014
Posts: 516
JohnLai,

I'm now experimenting on CPU based encoding for x265. Can you assist on an optimum setting focusing on very good quality and very small file size. Thanks
__________________
Asus X99 Sabertooth - Xeon E5 2695 - Asus Strix GTX 960 4G - DDR4 16GB Predator - Pioneer KRP 600M (isf calibrated) - Yamaha A3030 - Windows 10 x64 - Kodi with DSplayer - Lav - MadVR - XYsubtitle
Magik Mark is offline   Reply With Quote
Old 29th November 2015, 08:54   #752  |  Link
JohnLai
Registered User
 
Join Date: Mar 2008
Posts: 445
Quote:
Originally Posted by Magik Mark View Post
JohnLai,

I'm now experimenting on CPU based encoding for x265. Can you assist on an optimum setting focusing on very good quality and very small file size. Thanks
-.-.....you should ask this question on (HEVC) subforum.

Anyway, I would propose you to use x264. Yes, you read it right. Reason being x264 is faster, mature, higher encoding speed (definition of higher encoding speed for software based encoding = real time 30fps or so..) and most importantly, better quality than x265 encoding right now.

x264 with slow preset, set higher reference frame (1080p = 4 frames, 720p = 9 frames, CRF = 20, use 10bit encoding (get x264 with --bit-depth=10, specifying -profile high10 later)
JohnLai is offline   Reply With Quote
Old 29th November 2015, 15:00   #753  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,352
New NVEncC v2.00β1 is out supporting HW decode and HW resize using CUVID.

HW accelerated codecs supported are:
H.264, MPEG1, MPEG2
__________________
Win 10 x64 (17134.81) - Core i3-4170/ iGPU HD 4400 (v.4835)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all
NikosD is offline   Reply With Quote
Old 29th November 2015, 16:38   #754  |  Link
cegy
Registered User
 
Join Date: Dec 2009
Posts: 98
@stax76 it seems i've came across a few bugs firstly... if you do set your demuxer/indexer to your favor demuxer/indexer it can cause issues when it comes to using the video comparison as it will try and use that demuxer/indexer which you set which can fail quite alot or badly however if its left as default (auto detect?) it will use ffms2 like it should do.... so would it be possible to set the default indexer only for the video comparison to ffms2 so there isn't any issues like this and works like it "should" do ever time no matter what demuxer/indexer you use ?

i've also notice that the default audio language being set for mkv/mp4 isn't being respected for some odd reason if i load a encoded audio file it will change from the default english (which i set) to undetermined which i find very odd as the only way to over come this is setting it to english every single time (not ideal if you only use one audio language) however... in 1.1.8 this wasn't an issue at all as it did respect the settings that the user set i.e english as even if the audio was encoded or the audio was auto loaded by itself it will keep it as english (both of these issues are still there even in the latest test version 2015-11-24)

p.s. i understand how you want the language detection to work when reading from the file to try and detect what language the audio is

Last edited by cegy; 29th November 2015 at 16:49.
cegy is offline   Reply With Quote
Old 29th November 2015, 16:48   #755  |  Link
JohnLai
Registered User
 
Join Date: Mar 2008
Posts: 445
Quote:
Originally Posted by NikosD View Post
New NVEncC v2.00β1 is out supporting HW decode and HW resize using CUVID.

HW accelerated codecs supported are:
H.264, MPEG1, MPEG2
Wow, I am totally amazed by nvencc v2.00β1 resizing speed.....[From 1080p to 720p]

nvencc64.exe -i test.mkv --avcuvid --output-res 1280x720 --codec h265 --cqp 20:22:25 -o output.mkv
Max B frames are 0 frames.
[100.0%] 34362 frames: 398.46 fps, 2136.07 kb/s, remain 0:00:00 2:13

encoded 34410 frames, 398.69 fps, 2133.29 kbps, 364.98 MB
encode time 0:01:26 / CPU Usage: 5.05


For comparison, staxrip with DSS2 LAVFilter DXVA Copy-Back + its built-in Bilinear resizer with setting below;

NVEncC64.exe --codec h265 --level 4.1 --bframes 0 --ref 0 --cqp 20:22:25


encoded 34409 frames, 314.94 fps, 2049.56 kbps, 350.64 MB
encode time 0:01:49 / CPU Usage: 29.87



Very impressive.....

Edit : CPU info = I5 3570K 4.2Ghz OC, just in case if someone wanna compare the Staxrip CPU based bilinear resizer.......and GTX970 in case anyone wanna check the gpu resizer?
Edit V2 : Hohoho........I wonder if rigaya can implement other form of resizing algorithm (bicubic? lanzcos? Catmul?), all hail rigaya!!~~
Edit V3 : Stax76~~~~I hope you can implement this functionality as soon as possible, seem like rigaya adds custom CUVID decoder to be used in conjunction with the gpu resizer. You might need to do extra coding XD.

Last edited by JohnLai; 30th November 2015 at 04:16.
JohnLai is offline   Reply With Quote
Old 29th November 2015, 16:54   #756  |  Link
NikosD
Registered User
 
Join Date: Aug 2010
Location: Athens, Greece
Posts: 2,352
If you pipe QSV decoding and resizing with NVEncC encoding what is the speed ?
__________________
Win 10 x64 (17134.81) - Core i3-4170/ iGPU HD 4400 (v.4835)
HEVC decoding benchmarks
H.264 DXVA Benchmarks for all
NikosD is offline   Reply With Quote
Old 29th November 2015, 17:04   #757  |  Link
JohnLai
Registered User
 
Join Date: Mar 2008
Posts: 445
Quote:
Originally Posted by NikosD View Post
If you pipe QSV decoding and resizing with NVEncC encoding what is the speed ?
So, I simply check the staxrip's "Use QSVEncC as decoder", setting the resize and same nvenc encode options;

encoded 34404 frames, 338.14 fps, 265155.64 kbps, 45356.84 MB
encode time 0:01:42 / CPU Usage: 12.72
frame type IDR 34404
frame type I 34404, total size 45356.84 MB
encoded 34404 frames, 340.86 fps, 2255.76 kbps, 385.86 MB
encode time 0:01:41 / CPU Usage: 9.13


First 338.14fps with crazy amount of bitrate and size is QSVEncC decode usage.

Second 340.86fps is NvEncC encode usage.

But, QSVEncC VPP resizer is using better quality...the 8 tap polyphase thing?

Edit: In case you wanna know, it is a 24 minutes H.264 video without audio. So, I will not encounter the dreadful "Error in encoding pipeline".

Last edited by JohnLai; 29th November 2015 at 17:07.
JohnLai is offline   Reply With Quote
Old 29th November 2015, 23:04   #758  |  Link
Magik Mark
Registered User
 
Join Date: Dec 2014
Posts: 516
John can you assist on converting this handbrake preset to staxrip?

Preset 1
x265 Medium
CRF 26.5
aq_mode=1: aq_strength=2.00: qcomp=0.8: psy_rdoq=14.00
Denoise -> NLMeans -> Preset Ultra light -> Tune Film
Detelecine -> Default

Preset 2
x265 Fast
2 pass Ave bitrate 900kbps
aq_mode=1: aq_strength=2.00: qcomp=0.8: psy_rdoq=14.00
Denoise -> NLMeans -> Preset Ultra light -> Tune Film
Detelecine -> Default
__________________
Asus X99 Sabertooth - Xeon E5 2695 - Asus Strix GTX 960 4G - DDR4 16GB Predator - Pioneer KRP 600M (isf calibrated) - Yamaha A3030 - Windows 10 x64 - Kodi with DSplayer - Lav - MadVR - XYsubtitle

Last edited by Magik Mark; 29th November 2015 at 23:09.
Magik Mark is offline   Reply With Quote
Old 30th November 2015, 09:54   #759  |  Link
JohnLai
Registered User
 
Join Date: Mar 2008
Posts: 445
Quote:
Originally Posted by Magik Mark View Post
John can you assist on converting this handbrake preset to staxrip?

Preset 1
x265 Medium
CRF 26.5
aq_mode=1: aq_strength=2.00: qcomp=0.8: psy_rdoq=14.00
Denoise -> NLMeans -> Preset Ultra light -> Tune Film
Detelecine -> Default

Preset 2
x265 Fast
2 pass Ave bitrate 900kbps
aq_mode=1: aq_strength=2.00: qcomp=0.8: psy_rdoq=14.00
Denoise -> NLMeans -> Preset Ultra light -> Tune Film
Detelecine -> Default
Wait a minute here......There are few problem with your so called "preset".

Preset 1 and 2
x265 Medium (x265 default preset, no issue here)
CRF 26.5 (The default recommended factor from x265 documentation is 28)
PHP Code:
aq_mode=1aq_strength=2.00qcomp=0.8psy_rdoq=14.00
  Denoise 
-> NLMeans -> Preset Ultra light -> Tune Film 
-.-? Why would you use these if you can simply use --tune grain

Oh...about deinterlacing part...........I wonder if you can use LAVF CUVID for the deinterlacing.....either this or wait rigaya to come out with his version of HW deinterlacing. Any comment before proceeding to staxrip guide or you wanna setup DSS2 LAVF CUVID?

Last edited by JohnLai; 30th November 2015 at 09:58.
JohnLai is offline   Reply With Quote
Old 1st December 2015, 01:53   #760  |  Link
Magik Mark
Registered User
 
Join Date: Dec 2014
Posts: 516
Thanks. I think CPU encoding is a lot better. We just have to be patient. Do you know any guides using x265 in transcoding videos? Maybe presets for different type of videos. Dark, action, dram etc.
__________________
Asus X99 Sabertooth - Xeon E5 2695 - Asus Strix GTX 960 4G - DDR4 16GB Predator - Pioneer KRP 600M (isf calibrated) - Yamaha A3030 - Windows 10 x64 - Kodi with DSplayer - Lav - MadVR - XYsubtitle
Magik Mark is offline   Reply With Quote
Reply

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 08:05.


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