Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Uji Ninja

HEVC compression : a CPU to recommend?

Recommended Posts

Posted · Original PosterOP

Hi,

 

I often record documentaries and dramas on my HDD/BD recorder, but its on-the-fly h264 compression is lacking (and produce quite huge files).

So far, my best solution was to record a higher quality MPEG-2 file, rip the Blu-Ray, and compress the file to x264 using Handbrake.

My computer is old, to say the least, so the whole process is very time consuming, usually 4 to 6 hours for each hour of video on the x264 medium setting.

I'm not even trying hevc/x265, I think it would kill the computer.

 

I will buy or build a new computer, and was wondering if you guys could recommend a processor for video encoding.

 

A few things to know :

 

  • I'm in Japan. Most of the stuff I record is 1920x1080 / 59.94i. A few shows are "HD light", 1440x1080 / 59.94i. However, I'm thinking to maybe upgrade my cable TV set-up + HDD recorder next year and record some stuff in 4K.
  • Obviously, I'll still use the MPEG-2 recordings as a source.
  • I will use hevc x265 to save some space.
  • I always use the Decomb filter in Handbrake.
  • I'm not necessarily looking forward to super high-speed encoding (or else I would use the GPU and call it a day). Real-time encoding would be fine, as most of the shows I record are 30 to 60 minutes long.

Considering my budget and what's available on the Japanese market, choice would certainly be between a Ryzen 2600 / 3600 / 2700 / 3700 (or their X variant), or a I7-9700/9700F/9700K.

 

What would be the best choice for my situation?

 

Thanks!

Link to post
Share on other sites
13 minutes ago, Uji Ninja said:

if you guys could recommend a processor for video encoding

As many cores as possible. Clock-speed matters less when it comes to e.g. HEVC-encoding as the process can take advantage of a large number of cores. From the choices you've given, I'd definitely choose the 3700 or the 3700X for such a task, though if money was not an object, a 3950X.


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
1 hour ago, Uji Ninja said:

Hi,

 

I often record documentaries and dramas on my HDD/BD recorder, but its on-the-fly h264 compression is lacking (and produce quite huge files).

 

Don't bother with HEVC compression, really. You need a GeForce GTX 1660 Ti or better to get hardware compression from an nVidia GPU.

https://developer.nvidia.com/video-encode-decode-gpu-support-matrix

 

No CPU process can do it in real time, not yet anyway. On my CPU hardware HEVC is 1-3fps from HD sources (or was it 4K sources?,) so just based on that you'd need a 20 core CPU, and that assumes you have a highly threaded CPU for it. 

 

No rather I think the better solution if you're hellbent on using HEVC is to find a capture device that can capture 4Kp60 via HDMI 2.0 already and hardware encode it.  Current devices out on the market are all software-based, even when they cost $1000.

 

Link to post
Share on other sites
16 minutes ago, Kisai said:

No CPU process can do it in real time, not yet anyway.

That's quite a claim, considering that you're not saying anything about any specific settings.

 

16 minutes ago, Kisai said:

On my CPU hardware HEVC is 1-3fps from HD sources (or was it 4K sources?,) so just based on that you'd need a 20 core CPU, and that assumes you have a highly threaded CPU for it

Again, you're just throwing these claims out in the air from...where? I assume you're talking about libx265, but what encoding-settings and input-material? I can give you an ffmpeg command-line that encodes HEVC at around 25FPS on my 8700K, if you'd like, just to disprove such sweeping claims.

 

I do agree that using a GTX1660 (or better) for HEVC-encoding using NVENC would be the better option, but CPU-encoding is always an option, if one is willing to use lower-quality settings.


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
19 minutes ago, Kisai said:

so just based on that you'd need a 20 core CPU

so a dual 12 or dual 16 core opteron will do the trick?

 

they go for like 25$

 

edit:

 

it all depends on the settings

 

ive done 720p 30fps using OBS without any noticable effect while playing on a r5 1500x

Link to post
Share on other sites
22 minutes ago, WereCatf said:

That's quite a claim, considering that you're not saying anything about any specific settings.

 

Again, you're just throwing these claims out in the air from...where? I assume you're talking about libx265, but what encoding-settings and input-material? I can give you an ffmpeg command-line that encodes HEVC at around 25FPS on my 8700K, if you'd like, just to disprove such sweeping claims.

 

I do agree that using a GTX1660 (or better) for HEVC-encoding using NVENC would be the better option, but CPU-encoding is always an option, if one is willing to use lower-quality settings.

Do you think I'm going to run a benchmark to see if the status quo has changed every time I post. No. I last did tests with this months ago.

 

Point blank. You can not real-time encode HEVC on any CPU from the last 5 years, not unless you want it to be pure rubbish or scaled down to the size of a postage stamp. 

 

SD (640x480) resolution  -c:v libx265 -crf 28 -c:a aac -b:a 128k :

x265 [info]: HEVC encoder version 3.1+19-c4b098f973e6
x265 [info]: build info [Windows][GCC 9.1.1][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-3 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(8 rows)
x265 [warning]: Source height < 720p; disabling lookahead-slices
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip signhide tmvp b-intra
x265 [info]: tools: strong-intra-smoothing deblock sao

frame=  483 fps= 59 q=-0.0 size=    1792kB time=00:00:20.42 bitrate= 718.8kbits/s dup=1 drop=0 speed=2.47x

frame= 1075 fps= 40 q=-0.0 Lsize=    4193kB time=00:00:44.82 bitrate= 766.2kbits/s dup=1 drop=0 speed=1.68x
video:3456kB audio:703kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.808117%
x265 [info]: frame I:     35, Avg QP:27.84  kb/s: 1248.25
x265 [info]: frame P:    550, Avg QP:30.17  kb/s: 942.06
x265 [info]: frame B:    490, Avg QP:34.12  kb/s: 237.03
x265 [info]: Weighted P-Frames: Y:4.7% UV:4.5%
x265 [info]: consecutive B-frames: 57.4% 20.2% 7.9% 10.3% 4.3%

Same video Upscaled to 4K

x265 [info]: HEVC encoder version 3.1+19-c4b098f973e6
x265 [info]: build info [Windows][GCC 9.1.1][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-5 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(34 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip signhide tmvp b-intra
x265 [info]: tools: strong-intra-smoothing lslices=8 deblock sao

frame=  181 fps=4.1 q=-0.0 size=    2048kB time=00:00:07.83 bitrate=2141.0kbits/s dup=1 drop=0 speed=0.179x

frame= 1075 fps=2.9 q=-0.0 Lsize=   19916kB time=00:00:44.82 bitrate=3639.4kbits/s dup=1 drop=0 speed=0.122x
video:19181kB audio:703kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.158876%
x265 [info]: frame I:     31, Avg QP:27.07  kb/s: 4947.01
x265 [info]: frame P:    716, Avg QP:29.37  kb/s: 4599.17
x265 [info]: frame B:    328, Avg QP:33.43  kb/s: 976.09
x265 [info]: Weighted P-Frames: Y:1.8% UV:1.8%
x265 [info]: consecutive B-frames: 77.2% 10.2% 5.2% 6.2% 1.2%

encoded 1075 frames in 366.01s (2.94 fps), 3503.74 kb/s, Avg QP:30.54

And yes that is using all 8 logical cores on a 4 core cpu. SD output file 6MB, 4K output file 20MB.

 

So to encode that same SD footage in realtime, a 4 core 3.6Ghz CPU already does it. To encode that 4K video in real time would require a real 10 core CPU @ 3.6Ghz.

Link to post
Share on other sites
3 minutes ago, Kisai said:

Do you think I'm going to run a benchmark to see if the status quo has changed every time I post. No. I last did tests with this months ago.

No, that's not what I was saying. You clearly have not heard of e.g. the various different presets libx265 offers, which would be one of the easiest ways of configuring various kinds of encoding-parameters. Your own example shows that you just simply go with the defaults. If you had e.g. claimed that one can't achieve real-time encoding with the default preset, then that would've been better, but no; you just made a blanket statement that it is impossible, period.

 

$ ffmpeg -hwaccel auto -i input.mkv -c:v libx265 -crf 28 -an -preset faster -t 00:01:00 out.mkv
ffmpeg version N-94652-g808a6717e0 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.101 / 58. 55.101
  libavformat    58. 31.104 / 58. 31.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.101 /  7. 58.101
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Guessed Channel Layout for Input Stream #0.1 : 5.1
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    encoder         : libebml v1.3.5 + libmatroska v1.4.8
    creation_time   : 2019-12-03T17:07:09.000000Z
  Duration: 00:43:36.13, start: 0.000000, bitrate: 10200 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 9558660
      BPS-eng         : 9558660
      DURATION        : 00:43:36.072000000
      DURATION-eng    : 00:43:36.072000000
      NUMBER_OF_FRAMES: 62723
      NUMBER_OF_FRAMES-eng: 62723
      NUMBER_OF_BYTES : 3125767896
      NUMBER_OF_BYTES-eng: 3125767896
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1, fltp (default)
    Metadata:
      BPS             : 640000
      BPS-eng         : 640000
      DURATION        : 00:43:36.128000000
      DURATION-eng    : 00:43:36.128000000
      NUMBER_OF_FRAMES: 81754
      NUMBER_OF_FRAMES-eng: 81754
      NUMBER_OF_BYTES : 209290240
      NUMBER_OF_BYTES-eng: 209290240
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      title           : SDH
      BPS             : 81
      BPS-eng         : 81
      DURATION        : 00:43:33.111000000
      DURATION-eng    : 00:43:33.111000000
      NUMBER_OF_FRAMES: 990
      NUMBER_OF_FRAMES-eng: 990
      NUMBER_OF_BYTES : 26667
      NUMBER_OF_BYTES-eng: 26667
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
File 'out.mkv' already exists. Overwrite ? [y/N] y
[h264 @ 0000020c43c925c0] Using auto hwaccel type dxva2 with new default device.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
  Stream #0:2 -> #0:1 (subrip (srt) -> ass (ssa))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.1+11-de920e0a3183
x265 [info]: build info [Windows][GCC 9.1.1][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 12 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 2 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip signhide tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao
Output #0, matroska, to 'out.mkv':
  Metadata:
    encoder         : Lavf58.31.104
    Stream #0:0: Video: hevc (libx265), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 23.98 tbc (default)
    Metadata:
      BPS             : 9558660
      BPS-eng         : 9558660
      DURATION        : 00:43:36.072000000
      DURATION-eng    : 00:43:36.072000000
      NUMBER_OF_FRAMES: 62723
      NUMBER_OF_FRAMES-eng: 62723
      NUMBER_OF_BYTES : 3125767896
      NUMBER_OF_BYTES-eng: 3125767896
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc58.55.101 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: 18446744073709551615
    Stream #0:1(eng): Subtitle: ass (ssa)
    Metadata:
      title           : SDH
      BPS             : 81
      BPS-eng         : 81
      DURATION        : 00:43:33.111000000
      DURATION-eng    : 00:43:33.111000000
      NUMBER_OF_FRAMES: 990
      NUMBER_OF_FRAMES-eng: 990
      NUMBER_OF_BYTES : 26667
      NUMBER_OF_BYTES-eng: 26667
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc58.55.101 ssa
frame= 1439 fps= 58 q=-0.0 Lsize=   11854kB time=00:00:59.89 bitrate=1621.3kbits/s speed= 2.4x
video:11836kB audio:0kB subtitle:1kB other streams:0kB global headers:3kB muxing overhead: 0.141050%
x265 [info]: frame I:     31, Avg QP:27.82  kb/s: 7576.74
x265 [info]: frame P:    292, Avg QP:29.25  kb/s: 3462.13
x265 [info]: frame B:   1116, Avg QP:33.82  kb/s: 965.78
x265 [info]: Weighted P-Frames: Y:1.0% UV:0.7%
x265 [info]: consecutive B-frames: 10.2% 1.2% 3.1% 3.7% 81.7%

encoded 1439 frames in 24.95s (57.67 fps), 1614.75 kb/s, Avg QP:32.76

Oh, look at that: 57.67 FPS with the "faster" - preset! Well, let's try the default settings next:

$ ffmpeg -hwaccel auto -i input.mkv -c:v libx265 -crf 28 -an -t 00:01:00 out.mkv
ffmpeg version N-94652-g808a6717e0 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.101 / 58. 55.101
  libavformat    58. 31.104 / 58. 31.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.101 /  7. 58.101
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Guessed Channel Layout for Input Stream #0.1 : 5.1
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    encoder         : libebml v1.3.5 + libmatroska v1.4.8
    creation_time   : 2019-12-03T17:07:09.000000Z
  Duration: 00:43:36.13, start: 0.000000, bitrate: 10200 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 9558660
      BPS-eng         : 9558660
      DURATION        : 00:43:36.072000000
      DURATION-eng    : 00:43:36.072000000
      NUMBER_OF_FRAMES: 62723
      NUMBER_OF_FRAMES-eng: 62723
      NUMBER_OF_BYTES : 3125767896
      NUMBER_OF_BYTES-eng: 3125767896
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1, fltp (default)
    Metadata:
      BPS             : 640000
      BPS-eng         : 640000
      DURATION        : 00:43:36.128000000
      DURATION-eng    : 00:43:36.128000000
      NUMBER_OF_FRAMES: 81754
      NUMBER_OF_FRAMES-eng: 81754
      NUMBER_OF_BYTES : 209290240
      NUMBER_OF_BYTES-eng: 209290240
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      title           : SDH
      BPS             : 81
      BPS-eng         : 81
      DURATION        : 00:43:33.111000000
      DURATION-eng    : 00:43:33.111000000
      NUMBER_OF_FRAMES: 990
      NUMBER_OF_FRAMES-eng: 990
      NUMBER_OF_BYTES : 26667
      NUMBER_OF_BYTES-eng: 26667
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
File 'out.mkv' already exists. Overwrite ? [y/N] y
[h264 @ 0000021a8d6725c0] Using auto hwaccel type dxva2 with new default device.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
  Stream #0:2 -> #0:1 (subrip (srt) -> ass (ssa))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.1+11-de920e0a3183
x265 [info]: build info [Windows][GCC 9.1.1][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 12 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip signhide tmvp b-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao
Output #0, matroska, to 'out.mkv':
  Metadata:
    encoder         : Lavf58.31.104
    Stream #0:0: Video: hevc (libx265), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 23.98 tbc (default)
    Metadata:
      BPS             : 9558660
      BPS-eng         : 9558660
      DURATION        : 00:43:36.072000000
      DURATION-eng    : 00:43:36.072000000
      NUMBER_OF_FRAMES: 62723
      NUMBER_OF_FRAMES-eng: 62723
      NUMBER_OF_BYTES : 3125767896
      NUMBER_OF_BYTES-eng: 3125767896
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc58.55.101 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: 18446744073709551615
    Stream #0:1(eng): Subtitle: ass (ssa)
    Metadata:
      title           : SDH
      BPS             : 81
      BPS-eng         : 81
      DURATION        : 00:43:33.111000000
      DURATION-eng    : 00:43:33.111000000
      NUMBER_OF_FRAMES: 990
      NUMBER_OF_FRAMES-eng: 990
      NUMBER_OF_BYTES : 26667
      NUMBER_OF_BYTES-eng: 26667
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc58.55.101 ssa
frame= 1439 fps= 35 q=-0.0 Lsize=   12078kB time=00:00:59.89 bitrate=1652.0kbits/s speed=1.46x
video:12061kB audio:0kB subtitle:1kB other streams:0kB global headers:3kB muxing overhead: 0.138366%
x265 [info]: frame I:     30, Avg QP:27.43  kb/s: 7867.65
x265 [info]: frame P:    465, Avg QP:29.32  kb/s: 3066.38
x265 [info]: frame B:    944, Avg QP:33.84  kb/s: 747.72
x265 [info]: Weighted P-Frames: Y:0.9% UV:0.6%
x265 [info]: consecutive B-frames: 20.6% 14.9% 21.0% 40.0% 3.4%

encoded 1439 frames in 40.93s (35.16 fps), 1645.41 kb/s, Avg QP:32.25

Wait, what? 35.16 FPS?! But you just said that that's not possible! I must be a fucking magician!

 


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
Posted · Original PosterOP
48 minutes ago, WereCatf said:

I do agree that using a GTX1660 (or better) for HEVC-encoding using NVENC would be the better option, but CPU-encoding is always an option, if one is willing to use lower-quality settings.

That's what I thought too. But I keep on finding articles/YouTube videos claiming that GPU encoding is (much) worse quality-wise, and produces much larger files, than CPU encoding.

 

Granted, considering my actual setting, I haven't been able to do any testing here. And what a pixel peeper standing 30cm away from his screen calls "bad quality" may be totally fine with me sitting 2.5m away from the TV screen.

 

The only hardware encoding I've been able to do was with an old HP laptop with a I7-3610QM and Intel QuickSync h264.

It's fast, but quality is indeed less good and files are definitely bigger.

It gives rather good results for animation though.

I don't bother using CPU encoding anymore when working with anime from NHK or DLife.

Link to post
Share on other sites
1 minute ago, Uji Ninja said:

That's what I thought too. But I keep on finding articles/YouTube videos claiming that GPU encoding is (much) worse quality-wise, and produces much larger files, than CPU encoding.

Neither AMD's or Intel's HW-encoding is as good as NVIDIA's and on NVIDIA's hardware it's the Turing-architecture you'd want to use -- it is clearly superior to any of the other options and is comparable to CPU-based encoding using the default settings. Obviously, you could crank CPU-based encoding-settings sky-high and therefore get better quality, but for all practical intents, that'd be utter waste of time.

 

This is to say, those claims apply to older NVIDIA-tech and to AMD and Intel. Turing is a lot better.


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
Posted · Original PosterOP
1 hour ago, Kisai said:

No rather I think the better solution if you're hellbent on using HEVC is to find a capture device that can capture 4Kp60 via HDMI 2.0 already and hardware encode it.  Current devices out on the market are all software-based, even when they cost $1000.

 

 

I'm afraid HDCP will be a real pain in the a*s to work around and bypass...

That would also make it more difficult to just queue a few videos to convert, and let technology do its job at night while I'm sleeping.

 

Actually, "best" solution would be to finally get TV HDD recorders that use h265 for HD recording.

But here, it's MPEG-2 or h264 for HD recording, no other choice as far as I know.

H265 is for 4K recording only, if my Japanese got it right

https://panasonic.jp/diga/p-db/DMR-4W400_spec.html

 

 

Link to post
Share on other sites
Posted (edited) · Original PosterOP
19 minutes ago, WereCatf said:

Neither AMD's or Intel's HW-encoding is as good as NVIDIA's and on NVIDIA's hardware it's the Turing-architecture you'd want to use -- it is clearly superior to any of the other options and is comparable to CPU-based encoding using the default settings. Obviously, you could crank CPU-based encoding-settings sky-high and therefore get better quality, but for all practical intents, that'd be utter waste of time.

 

This is to say, those claims apply to older NVIDIA-tech and to AMD and Intel. Turing is a lot better.

 

Most computers in my budget have a 1660 or 1660ti, and both use Turing if I recall correctly the data sheet from Nvidia's website.

I think Turing is also the only one to allow B-frames for hevc compression, though I quite sincerely have no clue whether or not it would make any difference in my situation.

Something more interesting for streamers, maybe?

 

There's also another solution, another thing I thought about (and posted a message about yesterday), which would be a Mac Mini and the VideoToolbox T2 chip (plus maybe QuickSync).

But one article online said that your Handbrake encoding may fail depending on the options you select.

Not even sure I would be able to use the decomb filter... actually, now that I think about it: can you decomb when using Handbrake and Nvenc?

Edited by Uji Ninja
spelling mistake
Link to post
Share on other sites
4 minutes ago, Uji Ninja said:

actually, now that I think about it: can you decomb when using Handbrake and Nvenc?

As far as I know, yes.


Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to post
Share on other sites
3 hours ago, WereCatf said:

No, that's not what I was saying. You clearly have not heard of e.g. the various different presets libx265 offers, which would be one of the easiest ways of configuring various kinds of encoding-parameters. Your own example shows that you just simply go with the defaults. If you had e.g. claimed that one can't achieve real-time encoding with the default preset, then that would've been better, but no; you just made a blanket statement that it is impossible, period.

What is with some people on the internet wanting to nitpick generalizations, does it make you feel good to jump in to conversations with "not all..." like you're correcting some horrible wrong. No, all I said was that it was impossible to do, which it is given the current state of libx265. Once you start changing the settings, that's trading quality for time.

Quote

 


$ ffmpeg -hwaccel auto -i input.mkv -c:v libx265 -crf 28 -an -preset faster -t 00:01:00 out.mkv
ffmpeg version N-94652-g808a6717e0 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.101 / 58. 55.101
  libavformat    58. 31.104 / 58. 31.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.101 /  7. 58.101
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Guessed Channel Layout for Input Stream #0.1 : 5.1
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    encoder         : libebml v1.3.5 + libmatroska v1.4.8
    creation_time   : 2019-12-03T17:07:09.000000Z
  Duration: 00:43:36.13, start: 0.000000, bitrate: 10200 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 9558660
      BPS-eng         : 9558660
      DURATION        : 00:43:36.072000000
      DURATION-eng    : 00:43:36.072000000
      NUMBER_OF_FRAMES: 62723
      NUMBER_OF_FRAMES-eng: 62723
      NUMBER_OF_BYTES : 3125767896
      NUMBER_OF_BYTES-eng: 3125767896
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1, fltp (default)
    Metadata:
      BPS             : 640000
      BPS-eng         : 640000
      DURATION        : 00:43:36.128000000
      DURATION-eng    : 00:43:36.128000000
      NUMBER_OF_FRAMES: 81754
      NUMBER_OF_FRAMES-eng: 81754
      NUMBER_OF_BYTES : 209290240
      NUMBER_OF_BYTES-eng: 209290240
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      title           : SDH
      BPS             : 81
      BPS-eng         : 81
      DURATION        : 00:43:33.111000000
      DURATION-eng    : 00:43:33.111000000
      NUMBER_OF_FRAMES: 990
      NUMBER_OF_FRAMES-eng: 990
      NUMBER_OF_BYTES : 26667
      NUMBER_OF_BYTES-eng: 26667
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
File 'out.mkv' already exists. Overwrite ? [y/N] y
[h264 @ 0000020c43c925c0] Using auto hwaccel type dxva2 with new default device.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
  Stream #0:2 -> #0:1 (subrip (srt) -> ass (ssa))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.1+11-de920e0a3183
x265 [info]: build info [Windows][GCC 9.1.1][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 12 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 2 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip signhide tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao
Output #0, matroska, to 'out.mkv':
  Metadata:
    encoder         : Lavf58.31.104
    Stream #0:0: Video: hevc (libx265), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 23.98 tbc (default)
    Metadata:
      BPS             : 9558660
      BPS-eng         : 9558660
      DURATION        : 00:43:36.072000000
      DURATION-eng    : 00:43:36.072000000
      NUMBER_OF_FRAMES: 62723
      NUMBER_OF_FRAMES-eng: 62723
      NUMBER_OF_BYTES : 3125767896
      NUMBER_OF_BYTES-eng: 3125767896
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc58.55.101 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: 18446744073709551615
    Stream #0:1(eng): Subtitle: ass (ssa)
    Metadata:
      title           : SDH
      BPS             : 81
      BPS-eng         : 81
      DURATION        : 00:43:33.111000000
      DURATION-eng    : 00:43:33.111000000
      NUMBER_OF_FRAMES: 990
      NUMBER_OF_FRAMES-eng: 990
      NUMBER_OF_BYTES : 26667
      NUMBER_OF_BYTES-eng: 26667
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc58.55.101 ssa
frame= 1439 fps= 58 q=-0.0 Lsize=   11854kB time=00:00:59.89 bitrate=1621.3kbits/s speed= 2.4x
video:11836kB audio:0kB subtitle:1kB other streams:0kB global headers:3kB muxing overhead: 0.141050%
x265 [info]: frame I:     31, Avg QP:27.82  kb/s: 7576.74
x265 [info]: frame P:    292, Avg QP:29.25  kb/s: 3462.13
x265 [info]: frame B:   1116, Avg QP:33.82  kb/s: 965.78
x265 [info]: Weighted P-Frames: Y:1.0% UV:0.7%
x265 [info]: consecutive B-frames: 10.2% 1.2% 3.1% 3.7% 81.7%

encoded 1439 frames in 24.95s (57.67 fps), 1614.75 kb/s, Avg QP:32.76

Oh, look at that: 57.67 FPS with the "faster" - preset! Well, let's try the default settings next:


$ ffmpeg -hwaccel auto -i input.mkv -c:v libx265 -crf 28 -an -t 00:01:00 out.mkv
ffmpeg version N-94652-g808a6717e0 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt
  libavutil      56. 33.100 / 56. 33.100
  libavcodec     58. 55.101 / 58. 55.101
  libavformat    58. 31.104 / 58. 31.104
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.101 /  7. 58.101
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Guessed Channel Layout for Input Stream #0.1 : 5.1
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    encoder         : libebml v1.3.5 + libmatroska v1.4.8
    creation_time   : 2019-12-03T17:07:09.000000Z
  Duration: 00:43:36.13, start: 0.000000, bitrate: 10200 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 9558660
      BPS-eng         : 9558660
      DURATION        : 00:43:36.072000000
      DURATION-eng    : 00:43:36.072000000
      NUMBER_OF_FRAMES: 62723
      NUMBER_OF_FRAMES-eng: 62723
      NUMBER_OF_BYTES : 3125767896
      NUMBER_OF_BYTES-eng: 3125767896
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1, fltp (default)
    Metadata:
      BPS             : 640000
      BPS-eng         : 640000
      DURATION        : 00:43:36.128000000
      DURATION-eng    : 00:43:36.128000000
      NUMBER_OF_FRAMES: 81754
      NUMBER_OF_FRAMES-eng: 81754
      NUMBER_OF_BYTES : 209290240
      NUMBER_OF_BYTES-eng: 209290240
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Subtitle: subrip
    Metadata:
      title           : SDH
      BPS             : 81
      BPS-eng         : 81
      DURATION        : 00:43:33.111000000
      DURATION-eng    : 00:43:33.111000000
      NUMBER_OF_FRAMES: 990
      NUMBER_OF_FRAMES-eng: 990
      NUMBER_OF_BYTES : 26667
      NUMBER_OF_BYTES-eng: 26667
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
File 'out.mkv' already exists. Overwrite ? [y/N] y
[h264 @ 0000021a8d6725c0] Using auto hwaccel type dxva2 with new default device.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (libx265))
  Stream #0:2 -> #0:1 (subrip (srt) -> ass (ssa))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.1+11-de920e0a3183
x265 [info]: build info [Windows][GCC 9.1.1][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 12 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip signhide tmvp b-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao
Output #0, matroska, to 'out.mkv':
  Metadata:
    encoder         : Lavf58.31.104
    Stream #0:0: Video: hevc (libx265), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 1k tbn, 23.98 tbc (default)
    Metadata:
      BPS             : 9558660
      BPS-eng         : 9558660
      DURATION        : 00:43:36.072000000
      DURATION-eng    : 00:43:36.072000000
      NUMBER_OF_FRAMES: 62723
      NUMBER_OF_FRAMES-eng: 62723
      NUMBER_OF_BYTES : 3125767896
      NUMBER_OF_BYTES-eng: 3125767896
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc58.55.101 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: 18446744073709551615
    Stream #0:1(eng): Subtitle: ass (ssa)
    Metadata:
      title           : SDH
      BPS             : 81
      BPS-eng         : 81
      DURATION        : 00:43:33.111000000
      DURATION-eng    : 00:43:33.111000000
      NUMBER_OF_FRAMES: 990
      NUMBER_OF_FRAMES-eng: 990
      NUMBER_OF_BYTES : 26667
      NUMBER_OF_BYTES-eng: 26667
      _STATISTICS_WRITING_APP: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v19.0.0 ('Brave Captain') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2019-12-03 17:07:09
      _STATISTICS_WRITING_DATE_UTC-eng: 2019-12-03 17:07:09
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      encoder         : Lavc58.55.101 ssa
frame= 1439 fps= 35 q=-0.0 Lsize=   12078kB time=00:00:59.89 bitrate=1652.0kbits/s speed=1.46x
video:12061kB audio:0kB subtitle:1kB other streams:0kB global headers:3kB muxing overhead: 0.138366%
x265 [info]: frame I:     30, Avg QP:27.43  kb/s: 7867.65
x265 [info]: frame P:    465, Avg QP:29.32  kb/s: 3066.38
x265 [info]: frame B:    944, Avg QP:33.84  kb/s: 747.72
x265 [info]: Weighted P-Frames: Y:0.9% UV:0.6%
x265 [info]: consecutive B-frames: 20.6% 14.9% 21.0% 40.0% 3.4%

encoded 1439 frames in 40.93s (35.16 fps), 1645.41 kb/s, Avg QP:32.25

Wait, what? 35.16 FPS?! But you just said that that's not possible! I must be a fucking magician!

 

Neither of those are realtime you silly goose. Also Uji said they wanted to do 4K. 

 

This is the same source material, but the same hwaccel setting you added, but you also cheated by skipping the audio too.

ffmpeg -hwaccel auto -i in.webm  -vf scale=-1:1080 -c:v libx265 -crf 28 -c:a aac -b:a 128k out.mp4


x265 [info]: HEVC encoder version 3.1+19-c4b098f973e6
x265 [info]: build info [Windows][GCC 9.1.1][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 3
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / off / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=2.00 early-skip rskip signhide tmvp b-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao

frame= 1075 fps= 15 q=-0.0 Lsize=    9161kB time=00:00:44.82 bitrate=1674.2kbits/s dup=1 drop=0 speed=0.618x
video:8426kB audio:703kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.349869%
x265 [info]: frame I:     32, Avg QP:27.03  kb/s: 2623.02
x265 [info]: frame P:    687, Avg QP:29.84  kb/s: 2096.53
x265 [info]: frame B:    356, Avg QP:33.93  kb/s: 365.07
x265 [info]: Weighted P-Frames: Y:2.0% UV:2.0%
x265 [info]: consecutive B-frames: 74.3% 11.7% 6.0% 6.4% 1.7%

encoded 1075 frames in 72.54s (14.82 fps), 1538.81 kb/s, Avg QP:31.11

 

And then here is with the faster present.

 

ffmpeg -hwaccel auto -i in.webm  -vf scale=-1:1080 -c:v libx265 -crf 28 -c:a aac -b:a 128k -preset faster out.mp4
x265 [info]: HEVC encoder version 3.1+19-c4b098f973e6
x265 [info]: build info [Windows][GCC 9.1.1][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 23 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 2 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip signhide tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao

frame= 1075 fps= 30 q=-0.0 Lsize=   10335kB time=00:00:44.82 bitrate=1888.6kbits/s dup=1 drop=0 speed=1.24x
video:9598kB audio:703kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.330832%
x265 [info]: frame I:     25, Avg QP:28.05  kb/s: 2638.01
x265 [info]: frame P:    226, Avg QP:29.26  kb/s: 2412.08
x265 [info]: frame B:    824, Avg QP:32.98  kb/s: 1545.11
x265 [info]: Weighted P-Frames: Y:5.8% UV:5.3%
x265 [info]: consecutive B-frames: 14.7% 2.4% 2.0% 1.6% 79.3%

encoded 1075 frames in 36.13s (29.76 fps), 1752.79 kb/s, Avg QP:32.08

I'll note that the input file in these tests was only 6MB and the straight across SD encode was 4MB from the previous post.

 

The file size here is also 10% bigger, 9.3MB for the stock setting at HD and 10.5MB for the faster one. The input video on mine is actually p24, but Uji Ninja also said they needed to deinterlace video, which means they would be recording from a 1080i source.

 

Fortunately, I have a 1080i source and can try to do this exact real time test exactly what Uji Ninja would be doing:

Quote

ffmpeg -hwaccel auto -f dshow -rtbufsize 1404000k -i video="SA7160 PCI, Analog 01 Capture":audio="SA7160 PCI, Analog 01 WaveIn" -vf yadif -c:v libx265 -crf 28 -c:a aac -b:a 128k -preset faster liveTV.mp4
ffmpeg version N-95015-gba24b24aab Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20190918
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 58.101 / 58. 58.101
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, dshow, from 'video=SA7160 PCI, Analog 01 Capture:audio=SA7160 PCI, Analog 01 WaveIn':
  Duration: N/A, start: 347591.916000, bitrate: 1536 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 29.97 fps, 29.97 tbr, 10000k tbn, 10000k tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
File 'liveTV.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (libx265))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
x265 [info]: HEVC encoder version 3.1+19-c4b098f973e6
x265 [info]: build info [Windows][GCC 9.1.1][64 bit] 8bit+10bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main 4:2:2 10 profile, Level-4 (Main tier)
x265 [info]: Thread pool created using 8 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(17 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 25 / 250 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 2 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 2 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 early-skip rskip signhide tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=6 deblock sao
Output #0, mp4, to 'liveTV.mp4':
  Metadata:
    encoder         : Lavf58.33.100
    Stream #0:0: Video: hevc (libx265) (hev1 / 0x31766568), yuv422p, 1920x1080, q=2-31, 29.97 fps, 10000k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.58.101 libx265
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.58.101 aac
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (62% of size: 1404000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 2 times
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (62% of size: 1404000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 1 times
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (64% of size: 1404000000 [rtbufsize parameter])! frame dropped!
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (64% of size: 1404000000 [rtbufsize parameter])! frame dropped!
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (63% of size: 1404000000 [rtbufsize parameter])! frame dropped!
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (62% of size: 1404000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 2 times
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (62% of size: 1404000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 2 times
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (62% of size: 1404000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 2 times
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (62% of size: 1404000000 [rtbufsize parameter])! frame dropped!
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (63% of size: 1404000000 [rtbufsize parameter])! frame dropped!
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (64% of size: 1404000000 [rtbufsize parameter])! frame dropped!
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (65% of size: 1404000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 1 times
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (67% of size: 1404000000 [rtbufsize parameter])! frame dropped!
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (68% of size: 1404000000 [rtbufsize parameter])! frame dropped!
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (69% of size: 1404000000 [rtbufsize parameter])! frame dropped!
frame= 1840 fps= 27 q=-0.0 Lsize=    7588kB time=00:01:01.53 bitrate=1010.2kbits/s speed=0.908x
video:7503kB audio:17kB subtitle:0kB other streams:0kB global headers:2kB muxing overhead: 0.909884%
x265 [info]: frame I:     23, Avg QP:27.42  kb/s: 6478.72
x265 [info]: frame P:    370, Avg QP:29.72  kb/s: 2111.77
x265 [info]: frame B:   1447, Avg QP:34.13  kb/s: 628.79
x265 [info]: Weighted P-Frames: Y:3.2% UV:2.7%
x265 [info]: consecutive B-frames: 6.9% 0.5% 1.0% 0.8% 90.8%

encoded 1840 frames in 67.78s (27.15 fps), 1000.12 kb/s, Avg QP:33.16
[aac @ 0000022be3410500] Qavg: 65536.000
[dshow @ 0000022be33eb300] real-time buffer [SA7160 PCI, Analog 01 Capture] [video input] too full or near too full (70% of size: 1404000000 [rtbufsize parameter])! frame dropped!
    Last message repeated 2 times

 

It started fall behind at the 50 second mark. But just to prove this isn't a crappy setup, exact same settings but x264 and the same video (from PVR), exactly what Uji Ninja would be doing:

 

ffmpeg -hwaccel auto -f dshow -rtbufsize 1404000k -i video="SA7160 PCI, Analog 01 Capture":audio="SA7160 PCI, Analog 01 WaveIn" -vf yadif -c:v libx264 -crf 28 -c:a aac -b:a 128k -preset faster liveTVx264.mp4
ffmpeg version N-95015-gba24b24aab Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20190918
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 58.101 / 58. 58.101
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, dshow, from 'video=SA7160 PCI, Analog 01 Capture:audio=SA7160 PCI, Analog 01 WaveIn':
  Duration: N/A, start: 347816.534000, bitrate: 1536 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 29.97 fps, 29.97 tbr, 10000k tbn, 10000k tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 000001d279cceb00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001d279cceb00] profile High 4:2:2, level 4.0, 4:2:2, 8-bit
[libx264 @ 000001d279cceb00] 264 - core 158 r2984 3759fcb - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=2 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=4 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=20 rc=crf mbtree=1 crf=28.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'liveTVx264.mp4':
  Metadata:
    encoder         : Lavf58.33.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv422p, 1920x1080, q=-1--1, 29.97 fps, 10000k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.58.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.58.101 aac
frame= 1814 fps= 30 q=-1.0 Lsize=   16820kB time=00:01:00.68 bitrate=2270.6kbits/s speed=0.996x
video:16738kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.391377%
[libx264 @ 000001d279cceb00] frame I:44    Avg QP:23.98  size: 27644
[libx264 @ 000001d279cceb00] frame P:554   Avg QP:26.02  size: 14097
[libx264 @ 000001d279cceb00] frame B:1216  Avg QP:26.99  size:  6671
[libx264 @ 000001d279cceb00] consecutive B-frames:  8.3%  6.1%  3.0% 82.7%
[libx264 @ 000001d279cceb00] mb I  I16..4: 47.3% 50.0%  2.7%
[libx264 @ 000001d279cceb00] mb P  I16..4: 32.5% 25.1%  0.2%  P16..4:  9.3%  1.1%  0.2%  0.0%  0.0%    skip:31.6%
[libx264 @ 000001d279cceb00] mb B  I16..4:  6.5%  4.3%  0.0%  B16..8: 17.2%  0.9%  0.0%  direct: 9.7%  skip:61.4%  L0:46.6% L1:50.8% BI: 2.6%
[libx264 @ 000001d279cceb00] 8x8 transform intra:42.9% inter:88.1%
[libx264 @ 000001d279cceb00] coded y,uvDC,uvAC intra: 16.5% 41.7% 0.9% inter: 3.1% 9.8% 0.0%
[libx264 @ 000001d279cceb00] i16 v,h,dc,p: 52% 25% 12% 10%
[libx264 @ 000001d279cceb00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 22% 37%  3%  3%  3%  3%  3%  3%
[libx264 @ 000001d279cceb00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 24% 13%  5%  6%  6%  6%  5%  5%
[libx264 @ 000001d279cceb00] i8c dc,h,v,p: 52% 17% 27%  5%
[libx264 @ 000001d279cceb00] Weighted P-Frames: Y:5.8% UV:3.8%
[libx264 @ 000001d279cceb00] ref P L0: 71.2% 28.8%
[libx264 @ 000001d279cceb00] ref B L0: 82.7% 17.3%
[libx264 @ 000001d279cceb00] ref B L1: 93.7%  6.3%
[libx264 @ 000001d279cceb00] kb/s:2265.25

And here it is with out the preset:

 

ffmpeg -hwaccel auto -f dshow -rtbufsize 1404000k -i video="SA7160 PCI, Analog 01 Capture":audio="SA7160 PCI, Analog 01 WaveIn" -vf yadif -c:v libx264 -crf 28 -c:a aac -b:a 128k liveTVx264-nopreset.mp4
ffmpeg version N-95015-gba24b24aab Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20190918
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 58.101 / 58. 58.101
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, dshow, from 'video=SA7160 PCI, Analog 01 Capture:audio=SA7160 PCI, Analog 01 WaveIn':
  Duration: N/A, start: 348070.525000, bitrate: 1536 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 29.97 fps, 29.97 tbr, 10000k tbn, 10000k tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0000026bb6fedd80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0000026bb6fedd80] profile High 4:2:2, level 4.0, 4:2:2, 8-bit
[libx264 @ 0000026bb6fedd80] 264 - core 158 r2984 3759fcb - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=28.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'liveTVx264-nopreset.mp4':
  Metadata:
    encoder         : Lavf58.33.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv422p, 1920x1080, q=-1--1, 29.97 fps, 10000k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.58.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.58.101 aac
frame= 1849 fps= 29 q=-1.0 Lsize=   15432kB time=00:01:01.83 bitrate=2044.5kbits/s speed=0.977x
video:15348kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.435777%
[libx264 @ 0000026bb6fedd80] frame I:35    Avg QP:24.69  size: 30344
[libx264 @ 0000026bb6fedd80] frame P:549   Avg QP:26.79  size: 14304
[libx264 @ 0000026bb6fedd80] frame B:1265  Avg QP:26.94  size:  5376
[libx264 @ 0000026bb6fedd80] consecutive B-frames:  6.8%  5.2%  2.1% 85.9%
[libx264 @ 0000026bb6fedd80] mb I  I16..4: 34.0% 64.0%  1.9%
[libx264 @ 0000026bb6fedd80] mb P  I16..4: 20.6% 26.9%  0.2%  P16..4: 17.8%  1.6%  0.6%  0.0%  0.0%    skip:32.4%
[libx264 @ 0000026bb6fedd80] mb B  I16..4:  1.9%  1.7%  0.0%  B16..8: 21.8%  0.8%  0.1%  direct: 4.0%  skip:69.7%  L0:45.8% L1:52.8% BI: 1.5%
[libx264 @ 0000026bb6fedd80] 8x8 transform intra:55.9% inter:96.6%
[libx264 @ 0000026bb6fedd80] coded y,uvDC,uvAC intra: 12.9% 44.8% 1.3% inter: 3.4% 10.7% 0.0%
[libx264 @ 0000026bb6fedd80] i16 v,h,dc,p: 35% 30% 10% 25%
[libx264 @ 0000026bb6fedd80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 14% 43%  2%  3%  3%  3%  2%  2%
[libx264 @ 0000026bb6fedd80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 23% 15%  4%  7%  5%  6%  4%  3%
[libx264 @ 0000026bb6fedd80] i8c dc,h,v,p: 53% 15% 27%  4%
[libx264 @ 0000026bb6fedd80] Weighted P-Frames: Y:5.6% UV:4.4%
[libx264 @ 0000026bb6fedd80] ref P L0: 62.1% 10.3% 19.4%  8.1%  0.1%
[libx264 @ 0000026bb6fedd80] ref B L0: 87.1%  9.8%  3.1%
[libx264 @ 0000026bb6fedd80] ref B L1: 95.6%  4.4%
[libx264 @ 0000026bb6fedd80] kb/s:2037.83
[aac @ 0000026bb6fefcc0] Qavg: 65536.000

The video just BARELY keeps up, under x264. This is why I said don't bother with HEVC, because no CPU is going to keep up if x264 isn't. But I'll point out that I could have just as easily used NVENC on either of these, but NVENC is designed for streaming which means it optimally targets a bitrate, not a quality setting.

https://devblogs.nvidia.com/nvidia-ffmpeg-transcoding-guide/

 

Oh the file sizes? x265 7.7mb but that video file was going to end up unplayable and unwatchable, x264 fastest? 17MB, x264 no preset? 15MB.

 

But since this thread is now a pendantic "oh but..." h264_nvenc

 

ffmpeg -hwaccel auto -f dshow -rtbufsize 1404000k -i video="SA7160 PCI, Analog 01 Capture":audio="SA7160 PCI, Analog 01 WaveIn" -vf yadif -c:v h264_nvenc -b:v 10M -c:a aac -b:a 128k liveTVx264nvenc.mp4
ffmpeg version N-95015-gba24b24aab Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20190918
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 58.101 / 58. 58.101
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, dshow, from 'video=SA7160 PCI, Analog 01 Capture:audio=SA7160 PCI, Analog 01 WaveIn':
  Duration: N/A, start: 348822.936000, bitrate: 1536 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 29.97 fps, 29.97 tbr, 10000k tbn, 10000k tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
File 'liveTVx265-fastest.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to 'liveTVx264nvenc.mp4':
  Metadata:
    encoder         : Lavf58.33.100
    Stream #0:0: Video: h264 (h264_nvenc) (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 1920x1080, q=-1--1, 10000 kb/s, 29.97 fps, 10000k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.58.101 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 0/0/10000000 buffer size: 20000000 vbv_delay: N/A
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.58.101 aac
frame= 1822 fps= 32 q=20.0 Lsize=   76268kB time=00:01:00.94 bitrate=10251.6kbits/s speed=1.08x
video:76199kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.068786%
[aac @ 000001e906cebd40] Qavg: 65536.000

That file? 78MB

 

and h265_nvenc

ffmpeg -hwaccel auto -f dshow -rtbufsize 1404000k -i video="SA7160 PCI, Analog 01 Capture":audio="SA7160 PCI, Analog 01 WaveIn" -vf yadif -c:v hevc_nvenc -b:v 10M -c:a aac -b:a 128k liveTVx265-hevc_nvenc.mp4
ffmpeg version N-95015-gba24b24aab Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9.2.1 (GCC) 20190918
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 35.100 / 56. 35.100
  libavcodec     58. 58.101 / 58. 58.101
  libavformat    58. 33.100 / 58. 33.100
  libavdevice    58.  9.100 / 58.  9.100
  libavfilter     7. 58.102 /  7. 58.102
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, dshow, from 'video=SA7160 PCI, Analog 01 Capture:audio=SA7160 PCI, Analog 01 WaveIn':
  Duration: N/A, start: 349043.834000, bitrate: 1536 kb/s
    Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 29.97 fps, 29.97 tbr, 10000k tbn, 10000k tbc
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> hevc (hevc_nvenc))
  Stream #0:1 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to 'liveTVx265-hevc_nvenc.mp4':
  Metadata:
    encoder         : Lavf58.33.100
    Stream #0:0: Video: hevc (hevc_nvenc) (Rext) (hev1 / 0x31766568), yuv444p, 1920x1080, q=-1--1, 10000 kb/s, 29.97 fps, 10000k tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc58.58.101 hevc_nvenc
    Side data:
      cpb: bitrate max/min/avg: 0/0/10000000 buffer size: 20000000 vbv_delay: N/A
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.58.101 aac
frame= 1819 fps= 30 q=15.0 Lsize=   65585kB time=00:01:00.82 bitrate=8833.2kbits/s speed=   1x
video:65516kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.080027%
[aac @ 0000019dd111cc40] Qavg: 65536.000

That one is 67MB. For one minute of video.

 

Unfortunately doing a quality evaluation of each isn't really going to be fair either since we know the NV x265 encode on pascal isn't as good as turing and mine's pascal. This is just one frame grab using the CC as the timing marker. This is about 13 seconds in. And since the realtime encoding is 4 times larger, well compare the NVencodes here with the cpu encode x264 below it.

 

liveTVx264-nvenc.mp4_snapshot_00_13_667.thumb.jpg.aefb771dcd2f2c716024777a719eeba8.jpgliveTVx265-hevc_nvenc.mp4_snapshot_00_13_474.thumb.jpg.2d8e987970c8a624a82d6f3849cda9f0.jpg

 

CPU encode, no preset:

liveTVx264-nopreset.mp4_snapshot_00_07_109.thumb.jpg.6b8ca940149875b4313311fe82288d98.jpg

 

Also take note that the default settings of NVENC both picked 4:4:4 colorspace.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×