Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AV1 10-bit (NVENC) 8 bit and 10 bit have exactly the same file size only in the nightly version #5606

Open
calrsy opened this issue Dec 18, 2023 · 4 comments · May be fixed by #5608
Open

AV1 10-bit (NVENC) 8 bit and 10 bit have exactly the same file size only in the nightly version #5606

calrsy opened this issue Dec 18, 2023 · 4 comments · May be fixed by #5608
Labels

Comments

@calrsy
Copy link

calrsy commented Dec 18, 2023

Problem Description

I encoded the same video into 8 and 10 bits, but both have exactly the same file size only in the nightly version
In version 1.7.1 the file sizes were different and it was noticeable that the gradation step was reduced in 10-bit encoding.
In the nightly version, the file sizes of the two were exactly the same, and the step of the gradation was evident.

Activity Log, Crash Log or any other details

10 bit:
 # Starting Encode ...

[21:08:36] base preset: AV1 10bit Q51
[21:08:36] Remote Process started with Process ID: 44264 using port: 8037. Max Allowed Instances: 1
[21:08:36] Worker: Starting HandBrake Engine ...
[21:08:36] Worker: Parent Process Id 36368
[21:08:36] Worker: Starting Web Server on port 8037 ...
[21:08:36] Worker: Server Started
[21:08:36] Worker: Disconnected worker monitoring enabled!
[21:08:36] Compile-time hardening features are enabled
[21:08:36] nvenc: version 12.1 is available
[21:08:36] nvdec: is available
[21:08:36] CUDA Version: 8.9
[21:08:36] vcn: not available on this system
[21:08:36] qsv: not available on this system
[21:08:36] hb_init: starting libhb thread
[21:08:36] Starting work at: Mon Dec 18 21:08:36 2023
[21:08:36] 1 job(s) to process
[21:08:36] json job:
{
  "Audio": {
    "AudioList": [
      {
        "DRC": 0,
        "Encoder": "copy:aac",
        "Gain": 0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "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"
    ],
    "FallbackEncoder": "none"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "f:\\handbrake test\\test[AV1 10-bit (NVENC) Q51].mp4",
    "Options": {
      "IpodAtom": false,
      "Optimize": false
    },
    "Mux": "av_mp4"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 20,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "1080",
          "width": "1920"
        }
      },
      {
        "ID": 11,
        "Settings": {
          "mode": "0"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "f:\\handbrake test\\test.ts",
    "HWDecode": 4
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": false,
      "Forced": false
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "nvenc_av1_10bit",
    "Level": "auto",
    "MultiPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "medium",
    "Quality": 51,
    "QSV": {
      "Decode": false
    },
    "HardwareDecode": 4
  }
}
[21:08:36] CPU: AMD Ryzen 5 5600 6-Core Processor
[21:08:36]  - logical processor count: 12
[21:08:36] Intel Quick Sync Video support: no
[21:08:36] hb_scan: path=f:\handbrake test\test.ts, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:333: failed opening UDF image f:\handbrake test\test.ts
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
[21:08:36] bd: not a bd - trying as a stream/file instead
libdvdread: Encrypted DVD support unavailable.
libdvdread: libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
Can't open file VIDEO_TS.IFO.
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[21:08:36] dvd: not a dvd - trying as a stream/file instead
[21:08:36] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[21:08:36] Found the following PIDS
[21:08:36]     Video PIDS :
[21:08:36]       0x100 type H.264 (0x1b) (PCR)
[21:08:36]     Audio PIDS :
[21:08:36]       0x101 type AAC (0xf)
[21:08:36]     Subtitle PIDS :
[21:08:36]     Other PIDS :
[21:08:36] stream id 0x101 (type 0xf substream 0x0) audio 0x101
[21:08:36] scan: decoding previews for title 1
[21:08:36] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[21:08:37] scan: audio 0x101: aac, rate=48000Hz, bitrate=154500 Unknown (AAC LC, 2.0 ch, 154 kbps)
[21:08:37] stream: 6 good frames, 0 errors (0%)
[21:08:37] using bitstream PAR 1:1
[21:08:37] scan: 10 previews, 1920x1080, 60.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left
[21:08:37] scan: supported video decoders: avcodec hwaccel
[21:08:37] libhb: scan thread found 1 valid title(s)
[21:08:37] Starting Task: Encoding Pass
[21:08:37] work: skipping crop/scale filter
[21:08:37] work: only 1 chapter, disabling chapter markers
[21:08:37] job configuration:
[21:08:37]  * source
[21:08:37]    + f:\handbrake test\test.ts
[21:08:37]    + title 1, chapter(s) 1 to 1
[21:08:37]  * destination
[21:08:37]    + f:\handbrake test\test[AV1 10-bit (NVENC) Q51].mp4
[21:08:37]    + container: MPEG-4 (libavformat)
[21:08:37]  * video track
[21:08:37]    + decoder: h264 8-bit hwaccel (nv12, cuda)
[21:08:37]      + bitrate 200 kbps
[21:08:37]    + filter
[21:08:37]      + Framerate Shaper (mode=0)
[21:08:37]        + frame rate: same as source (around 60.000 fps)
[21:08:37]    + Output geometry
[21:08:37]      + storage dimensions: 1920 x 1080
[21:08:37]      + pixel aspect ratio: 1 : 1
[21:08:37]      + display dimensions: 1920 x 1080
[21:08:37]    + encoder: AV1 10-bit (NVEnc)
[21:08:37]      + preset:  medium
[21:08:37]      + level:   auto
[21:08:37]      + quality: 51.00 (CQ)
[21:08:37]      + color profile: 1-1-1
[21:08:37]      + chroma location: left
[21:08:37]  * audio track 1
[21:08:37]    + decoder: Unknown (AAC LC, 2.0 ch, 154 kbps) (track 1, id 0x101)
[21:08:37]      + bitrate: 154 kbps, samplerate: 48000 Hz
[21:08:37]    + AAC Passthru
[21:08:37] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[21:08:37] sync: expecting 18184 video frames
[21:08:37] encavcodecInit: AV1 (Nvidia NVENC)
[21:08:37] encavcodec: encoding at rc=vbr, 51.00
[21:08:37] encavcodec: encoding with stored aspect 1/1
[21:08:37] encavcodecInit: Unknown avcodec option a53_cc
[21:08:37] sync: first pts video is 0
[21:08:37] sync: first pts audio 0x101 is 90
[21:09:14] hb_ts_stream_decode - eof
[21:09:14] hb_ts_stream_decode - eof
[21:09:14] reader: done. 1 scr changes
[21:09:14] work: average encoding speed for job is 494.209991 fps
[21:09:15] vfr: 18177 frames output, 0 dropped
[21:09:15] vfr: lost time: 0 (0 frames)
[21:09:15] vfr: gained time: 0 (0 frames) (0 not accounted for)
[21:09:15] stream: 18177 good frames, 0 errors (0%)
[21:09:15] aac-decoder done: 14246 frames, 0 decoder errors
[21:09:15] h264-decoder done: 18177 frames, 0 decoder errors
[21:09:15] sync: got 18177 frames, 18184 expected
[21:09:15] sync: framerate min 60.000 fps, max 60.000 fps, avg 60.000 fps
[21:09:15] mux: track 0, 18177 frames, 3273514 bytes, 86.17 kbps, fifo 32768
[21:09:15] mux: track 1, 14246 frames, 6190927 bytes, 162.96 kbps, fifo 16384
[21:09:15] Finished work at: Mon Dec 18 21:09:15 2023
[21:09:15] libhb: work result = 0

 # Job Completed!




8 bit:
 # Starting Encode ...

[21:09:15] base preset: AV1 10bit Q51 (Modified)
[21:09:15] Remote Process started with Process ID: 43768 using port: 8037. Max Allowed Instances: 1
[21:09:15] Worker: Starting HandBrake Engine ...
[21:09:15] Worker: Parent Process Id 36368
[21:09:15] Worker: Starting Web Server on port 8037 ...
[21:09:15] Worker: Server Started
[21:09:16] Worker: Disconnected worker monitoring enabled!
[21:09:16] Compile-time hardening features are enabled
[21:09:16] nvenc: version 12.1 is available
[21:09:16] nvdec: is available
[21:09:16] CUDA Version: 8.9
[21:09:16] vcn: not available on this system
[21:09:16] qsv: not available on this system
[21:09:16] hb_init: starting libhb thread
[21:09:16] Starting work at: Mon Dec 18 21:09:16 2023
[21:09:16] 1 job(s) to process
[21:09:16] json job:
{
  "Audio": {
    "AudioList": [
      {
        "DRC": 0,
        "Encoder": "copy:aac",
        "Gain": 0,
        "Mixdown": -1,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "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"
    ],
    "FallbackEncoder": "none"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": false,
    "File": "f:\\handbrake test\\test[AV1 (NVENC) Q51].mp4",
    "Options": {
      "IpodAtom": false,
      "Optimize": false
    },
    "Mux": "av_mp4"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 20,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "1080",
          "width": "1920"
        }
      },
      {
        "ID": 11,
        "Settings": {
          "mode": "0"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "f:\\handbrake test\\test.ts",
    "HWDecode": 4
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": false,
      "Forced": false
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "nvenc_av1",
    "Level": "auto",
    "MultiPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "medium",
    "Quality": 51,
    "QSV": {
      "Decode": false
    },
    "HardwareDecode": 4
  }
}
[21:09:16] CPU: AMD Ryzen 5 5600 6-Core Processor
[21:09:16]  - logical processor count: 12
[21:09:16] Intel Quick Sync Video support: no
[21:09:16] hb_scan: path=f:\handbrake test\test.ts, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:333: failed opening UDF image f:\handbrake test\test.ts
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
[21:09:16] bd: not a bd - trying as a stream/file instead
libdvdread: Encrypted DVD support unavailable.
libdvlibdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
dread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[21:09:16] dvd: not a dvd - trying as a stream/file instead
[21:09:16] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[21:09:16] Found the following PIDS
[21:09:16]     Video PIDS :
[21:09:16]       0x100 type H.264 (0x1b) (PCR)
[21:09:16]     Audio PIDS :
[21:09:16]       0x101 type AAC (0xf)
[21:09:16]     Subtitle PIDS :
[21:09:16]     Other PIDS :
[21:09:16] stream id 0x101 (type 0xf substream 0x0) audio 0x101
[21:09:16] scan: decoding previews for title 1
[21:09:16] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[21:09:16] scan: audio 0x101: aac, rate=48000Hz, bitrate=154500 Unknown (AAC LC, 2.0 ch, 154 kbps)
[21:09:17] stream: 6 good frames, 0 errors (0%)
[21:09:17] using bitstream PAR 1:1
[21:09:17] scan: 10 previews, 1920x1080, 60.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left
[21:09:17] scan: supported video decoders: avcodec hwaccel
[21:09:17] libhb: scan thread found 1 valid title(s)
[21:09:17] Starting Task: Encoding Pass
[21:09:17] work: skipping crop/scale filter
[21:09:17] work: only 1 chapter, disabling chapter markers
[21:09:17] job configuration:
[21:09:17]  * source
[21:09:17]    + f:\handbrake test\test.ts
[21:09:17]    + title 1, chapter(s) 1 to 1
[21:09:17]  * destination
[21:09:17]    + f:\handbrake test\test[AV1 (NVENC) Q51].mp4
[21:09:17]    + container: MPEG-4 (libavformat)
[21:09:17]  * video track
[21:09:17]    + decoder: h264 8-bit hwaccel (nv12, cuda)
[21:09:17]      + bitrate 200 kbps
[21:09:17]    + filter
[21:09:17]      + Framerate Shaper (mode=0)
[21:09:17]        + frame rate: same as source (around 60.000 fps)
[21:09:17]    + Output geometry
[21:09:17]      + storage dimensions: 1920 x 1080
[21:09:17]      + pixel aspect ratio: 1 : 1
[21:09:17]      + display dimensions: 1920 x 1080
[21:09:17]    + encoder: AV1 (NVEnc)
[21:09:17]      + preset:  medium
[21:09:17]      + level:   auto
[21:09:17]      + quality: 51.00 (CQ)
[21:09:17]      + color profile: 1-1-1
[21:09:17]      + chroma location: left
[21:09:17]  * audio track 1
[21:09:17]    + decoder: Unknown (AAC LC, 2.0 ch, 154 kbps) (track 1, id 0x101)
[21:09:17]      + bitrate: 154 kbps, samplerate: 48000 Hz
[21:09:17]    + AAC Passthru
[21:09:17] file is MPEG Transport Stream with 188 byte packets offset 0 bytes
[21:09:17] sync: expecting 18184 video frames
[21:09:17] encavcodecInit: AV1 (Nvidia NVENC)
[21:09:17] encavcodec: encoding at rc=vbr, 51.00
[21:09:17] encavcodec: encoding with stored aspect 1/1
[21:09:17] encavcodecInit: Unknown avcodec option a53_cc
[21:09:17] sync: first pts video is 0
[21:09:17] sync: first pts audio 0x101 is 90
[21:09:53] hb_ts_stream_decode - eof
[21:09:53] hb_ts_stream_decode - eof
[21:09:53] reader: done. 1 scr changes
[21:09:54] work: average encoding speed for job is 493.885895 fps
[21:09:54] vfr: 18177 frames output, 0 dropped
[21:09:54] vfr: lost time: 0 (0 frames)
[21:09:54] vfr: gained time: 0 (0 frames) (0 not accounted for)
[21:09:54] stream: 18177 good frames, 0 errors (0%)
[21:09:54] aac-decoder done: 14246 frames, 0 decoder errors
[21:09:54] h264-decoder done: 18177 frames, 0 decoder errors
[21:09:54] sync: got 18177 frames, 18184 expected
[21:09:54] sync: framerate min 60.000 fps, max 60.000 fps, avg 60.000 fps
[21:09:54] mux: track 0, 18177 frames, 3273514 bytes, 86.17 kbps, fifo 32768
[21:09:54] mux: track 1, 14246 frames, 6190927 bytes, 162.96 kbps, fifo 16384
[21:09:54] Finished work at: Mon Dec 18 21:09:54 2023
[21:09:54] libhb: work result = 0

 # Job Completed!

What Operating System are you running?

Windows 11

What version of HandBrake are you running?

Nightly 20231218070416-275a2e8db-master (2023121801)

Where did you download HandBrake from?

github

@calrsy calrsy changed the title AV1 10-bit (NVENC) is probably not encoded in 10 bit AV1 10-bit (NVENC) 8 bit and 10 bit have exactly the same file size only in the nightly version Dec 18, 2023
@galad87
Copy link
Contributor

galad87 commented Dec 18, 2023

Disable the NVDEC decoders in the preferences. It was never enabled in 1.7.1, so I guess now that it works the encoders uses the same bit depth as the input frames.

@calrsy
Copy link
Author

calrsy commented Dec 18, 2023

Disable the NVDEC decoders in the preferences. It was never enabled in 1.7.1, so I guess now that it works the encoders uses the same bit depth as the input frames.

Fixed my issue with your response. Thank you very much!

I have one more silly question about the changes.
I downloaded the nightly version from https://github.com/HandBrake/handbrake-snapshots/releases/tag/win
It says 'You can see all the latest changes on our GitHub Timeline.'
I'm interested in this but couldn't find the github timeline. Where can I find it?
Sorry for the silly question.

@bradleysepos
Copy link
Contributor

All code changes on our master (main) branch, which nightly/snapshot/development builds are based on:
https://github.com/HandBrake/HandBrake/commits/master/

Same for the 1.7.x branch (releases 1.7.0, 1.7.1, 1.7.2, etc.):
https://github.com/HandBrake/HandBrake/commits/1.7.x

@galad87
Copy link
Contributor

galad87 commented Dec 18, 2023

I saw NVENC AV1 has got an option to encode 8bit to 10 bit, for the HEVC 10 bit probably we would need to manually convert the buffer to 10 bit. @theHamsta do you have any advice?

@galad87 galad87 reopened this Dec 18, 2023
@galad87 galad87 linked a pull request Dec 19, 2023 that will close this issue
3 tasks
@sr55 sr55 added the Bug label Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

5 participants
@bradleysepos @sr55 @galad87 @calrsy and others