Closed Milincho closed 1 year ago
The CPU is used for other filter steps like resizing. So it's possible to have the CPU bottleneck the encode. What sizing and filter settings are you using?
The CPU is used for other filter steps like resizing. So it's possible to have the CPU bottleneck the encode. What sizing and filter settings are you using?
I'm not using any filters or resizing at all:
and these are my settings:
Hmm, it looks like the frame rate options are cut off in the UI. Are you using an increased font size in Windows?
But I see you have set it to a constant frame rate. If the source didn't match the listed frame rate on the container the CPU might be doing work to interpolate frames to get it to match the desired constant frame rate. Choosing Variable frame rate here should result in less CPU work.
If that doesn't work I would suggest asking the HandBrake team about it, as they are more familiar with the encode engine internals.
Hmm, it looks like the frame rate options are cut off in the UI. Are you using an increased font size in Windows?
But I see you have set it to a constant frame rate. If the source didn't match the listed frame rate on the container the CPU might be doing work to interpolate frames to get it to match the desired constant frame rate. Choosing Variable frame rate here should result in less CPU work.
If that doesn't work I would suggest asking the HandBrake team about it, as they are more familiar with the encode engine internals.
Sources are all constant framerate, not variable. And the fps setting is "Same as source".
That's another problem with VidCoder, the UI gets cropped at 225% scaling and bigger fonts:
Scaling the whole UI generally works better than just increasing font size. The ribbon at the top is the Fluent Ribbon library; I've reported the font size issue to them but nobody has stepped up to fix.
Other issues I can give a shot at fixing, like the hidden VFR option. Anyway about the Constant frame rate option, my understanding is the encoder enforces a constant frame rate, and picks that frame rate based on what's indicated on the container. But the actual video stream might not have that exact frame rate, and cause some extra work. But if you pick VFR, it can just happily encode the video frames at whatever time they show up in the stream. Anyway, it's just something to check. If setting VFR doesn't help, you'll need to ask HandBrake about it because CFR is the only setting I saw that might possibly cause high CPU use.
Scaling the whole UI generally works better than just increasing font size. The ribbon at the top is the Fluent Ribbon library; I've reported the font size issue to them but nobody has stepped up to fix.
Other issues I can give a shot at fixing, like the hidden VFR option. Anyway about the Constant frame rate option, my understanding is the encoder enforces a constant frame rate, and picks that frame rate based on what's indicated on the container. But the actual video stream might not have that exact frame rate, and cause some extra work. But if you pick VFR, it can just happily encode the video frames at whatever time they show up in the stream. Anyway, it's just something to check. If setting VFR doesn't help, you'll need to ask HandBrake about it because CFR is the only setting I saw that might possibly cause high CPU use.
Just checked out this log from one of the files:
VC [17:02:14] VidCoder 9.3 Beta VC [17:02:14] Starting job 1/62 VC [17:02:14] Source path: X:\AI\mvsd00254.mp4 VC [17:02:14] Destination path: X:\AI\Mvsd00254.mkv VC [17:02:14] Title: 1 VC [17:02:14] Range: All VC [17:02:14] Preset: Bombadil AI Remaster VC [17:02:14] Worker ready: Pipe 'VidCoderWorker.92f83c78-d2fb-4559-a2c5-72129787619e' is open VC [17:02:14] Connecting to process 8404 on pipe VidCoderWorker.92f83c78-d2fb-4559-a2c5-72129787619e HB [17:02:15] hb_init: starting libhb thread [17:02:15] CPU: AMD Ryzen 9 3900X 12-Core Processor [17:02:15] - logical processor count: 24 [17:02:15] Intel Quick Sync Video support: no [17:02:15] hb_scan: path=X:\AI\mvsd00254.mp4, title_index=1 HB udfread ERROR: ECMA 167 Volume Recognition failed src/libbluray/disc/disc.c:333: failed opening UDF image X:\AI\mvsd00254.mp4 src/libbluray/disc/disc.c:437: error opening file BDMV\index.bdmv src/libbluray/disc/disc.c:437: error opening file BDMV\BACKUP\index.bdmv [17:02:15] bd: not a bd - trying as a stream/file instead libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed libdvdnav: vm: vm: failed to read VIDEO_TS.IFO [17:02:15] dvd: not a dvd - trying as a stream/file instead HB Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'X:\AI\mvsd00254.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 Duration: 02:29:30.40, start: 0.000000, bitrate: 6005 kb/s Stream #0:00x1: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 5738 kb/s, 29.97 fps, 29.97 tbr, 90k tbn (default) Metadata: vendor_id : [0][0][0][0] Stream #0:10x2: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 256 kb/s (default) Metadata: vendor_id : [0][0][0][0] [17:02:16] scan: decoding previews for title 1 [17:02:16] scan: audio 0x1: aac, rate=44100Hz, bitrate=256000 ??? (AAC LC) (2.0 ch) (256 kbps) HB [17:02:17] scan: 10 previews, 1920x1080, 29.970 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left [17:02:17] scan: supported video decoders: avcodec nvdec [17:02:17] libhb: scan thread found 1 valid title(s) HB [17:02:17] Starting work at: Fri Apr 07 17:02:17 2023 [17:02:17] 1 job(s) to process [17:02:17] json job: { "Audio": { "AudioList": [ { "DRC": 0, "Encoder": "copy:aac", "Gain": 0, "Mixdown": 0, "NormalizeMixLevel": false, "Samplerate": 0, "Track": 0, "DitherMethod": 0 } ], "CopyMask": [ "copy:aac", "copy:ac3", "copy:eac3", "copy:truehd", "copy:dts", "copy:dtshd", "copy:mp2", "copy:mp3", "copy:flac", "copy:opus" ] }, "Destination": { "ChapterList": [ { "Name": "Chapter 1" } ], "ChapterMarkers": true, "AlignAVStart": false, "File": "X:\AI\Mvsd00254.part.mkv", "Mp4Options": { "IpodAtom": false, "Mp4Optimize": true }, "Mux": "av_mkv" }, "Filters": { "FilterList": [ { "ID": 7, "Settings": { "mode": "1" } }, { "ID": 14, "Settings": { "crop-bottom": "0", "crop-left": "0", "crop-right": "0", "crop-top": "0", "height": "1080", "width": "1920" } } ] }, "PAR": { "Num": 1, "Den": 1 }, "Metadata": {}, "SequenceID": 0, "Source": { "Angle": 0, "Range": { "Type": "chapter", "Start": 1, "End": 1 }, "Title": 1, "Path": "X:\AI\mvsd00254.mp4" }, "Subtitle": { "Search": { "Burn": false, "Default": false, "Enable": false, "Forced": false }, "SubtitleList": [] }, "Video": { "Encoder": "nvenc_av1_10bit", "Level": "auto", "Bitrate": 4000, "TwoPass": false, "Turbo": false, "ColorMatrixCode": 0, "Options": "rc-lookahead=60", "Preset": "slowest", "Profile": "auto", "Tune": "fastdecode", "QSV": { "Decode": false }, "HardwareDecode": 0 } } [17:02:17] Starting Task: Encoding Pass [17:02:17] Skipping crop/scale filter [17:02:17] work: only 1 chapter, disabling chapter markers [17:02:17] job configuration: [17:02:17] source [17:02:17] + X:\AI\mvsd00254.mp4 [17:02:17] + title 1, chapter(s) 1 to 1 [17:02:17] + container: mov,mp4,m4a,3gp,3g2,mj2 [17:02:17] + data rate: 6005 kbps [17:02:17] destination [17:02:17] + X:\AI\Mvsd00254.part.mkv [17:02:17] + container: Matroska (libavformat) [17:02:17] video track [17:02:17] + decoder: h264 8-bit (yuv420p) [17:02:17] + bitrate 5738 kbps [17:02:17] + filters [17:02:17] + Framerate Shaper (mode=1) [17:02:17] + frame rate: 29.970 fps -> constant 29.970 fps [17:02:17] + Format (format=p010le) [17:02:17] + Output geometry [17:02:17] + storage dimensions: 1920 x 1080 [17:02:17] + pixel aspect ratio: 1 : 1 [17:02:17] + display dimensions: 1920 x 1080 [17:02:17] + encoder: AV1 10-bit (NVEnc) [17:02:17] + preset: slowest [17:02:17] + options: rc-lookahead=60 [17:02:17] + profile: auto [17:02:17] + level: auto [17:02:17] + bitrate: 4000 kbps, pass: 0 [17:02:17] + color profile: 1-1-1 [17:02:17] + chroma location: left [17:02:17] audio track 1 [17:02:17] + decoder: ??? (AAC LC) (2.0 ch) (256 kbps) (track 1, id 0x1) [17:02:17] + bitrate: 256 kbps, samplerate: 44100 Hz [17:02:17] + AAC Passthru [17:02:17] sync: expecting 268843 video frames [17:02:17] encavcodecInit: AV1 (Nvidia NVENC) [17:02:17] encavcodec: encoding at rc=vbr, Bitrate 4000 [17:02:17] encavcodec: encoding with stored aspect 1/1 HB [17:02:17] sync: first pts audio 0x1 is 0 [17:02:17] sync: first pts video is 2970 [17:02:17] sync: "Chapter 1" (1) at frame 1 time 2970 HB [17:42:45] reader: done. 1 scr changes HB [17:42:46] work: average encoding speed for job is 110.689262 fps HB [17:42:47] vfr: 268842 frames output, 0 dropped and 0 duped for CFR/PFR [17:42:47] vfr: lost time: 0 (0 frames) [17:42:47] vfr: gained time: 0 (0 frames) (0 not accounted for) [17:42:47] aac-decoder done: 386323 frames, 0 decoder errors [17:42:47] h264-decoder done: 268842 frames, 0 decoder errors [17:42:47] sync: got 268842 frames, 268843 expected [17:42:47] sync: framerate min 29.970 fps, max 10000.000 fps, avg 29.970 fps HB [17:42:47] mux: track 0, 268842 frames, 4628919859 bytes, 4128.16 kbps, fifo 2048 [17:42:47] mux: track 1, 386323 frames, 287052882 bytes, 256.00 kbps, fifo 2048 [17:42:47] Finished work at: Fri Apr 07 17:42:47 2023 [17:42:47] libhb: work result = 0 VC [17:42:47] Job completed (Elapsed Time: 40m 32s)
and noticed this:
Why is that? how can I enable Hardware decoding?
That's a good call! I just put out 9.4 Beta that enables NVDec hardware decoding when using NVEnc. I noticed that the CPU use is much reduced with this now. I also fixed the Variable framerate label getting cut off.
Problem Description
I'm encoding H264 to AV1 with a RTX 4080 and VidCoder doesn't fully use the GPU... but uses an average 70% of the CPU (Ryzen 9 3900X)
As the RTX 4080 supports both H264 hardware decoding and AV1 hardware encoding... shouldn't the GPU be used to the max and the CPU barely or not at all?
What version of VidCoder are you running?
9.3 Beta
Encode Log
No response