<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">Den 21.12.2024 03:17, skrev Andrew
      Randrianasulu:<br>
    </div>
    <blockquote type="cite"
cite="mid:CA+rFky5DBZ8qJ0FUO-7nsYRRmqb7+R4dTusge2FXUh_PXa_dPQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="auto">
        <div><br>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">пт, 20 дек. 2024 г., 21:58
              Terje J. Hanssen <<a
                href="mailto:terjejhanssen@gmail.com"
                rel="noreferrer noreferrer" target="_blank"
                moz-do-not-send="true" class="moz-txt-link-freetext">terjejhanssen@gmail.com</a>>:<br>
            </div>
            <blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div> <br>
                <br>
                <br>
                <div>Den 20.12.2024 17:40, skrev Andrew Randrianasulu:<br>
                </div>
                <blockquote type="cite">
                  <div dir="auto">
                    <div><br>
                      <br>
                      <div class="gmail_quote">
                        <div dir="ltr" class="gmail_attr">пт, 20 дек.
                          2024 г., 19:20 Terje J. Hanssen via Cin <<a
                            href="mailto:cin@lists.cinelerra-gg.org"
                            rel="noreferrer noreferrer noreferrer"
                            target="_blank" moz-do-not-send="true"
                            class="moz-txt-link-freetext">cin@lists.cinelerra-gg.org</a>>:<br>
                        </div>
                        <blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                          <div> Continued and extracted from <br>
                            [Cin] Video accelerators support, builds and
                            use<br>
                            <a
href="https://lists.cinelerra-gg.org/pipermail/cin/2024-December/009226.html"
rel="noreferrer noreferrer noreferrer noreferrer" target="_blank"
                              moz-do-not-send="true"
                              class="moz-txt-link-freetext">https://lists.cinelerra-gg.org/pipermail/cin/2024-December/009226.html</a><br>
                            <br>
                            <div>Den 12.12.2024 00:54, skrev Terje J.
                              Hanssen:<br>
                            </div>
                            <blockquote type="cite"> <br>
                              <div>Den 11.12.2024 23:56, skrev Andrew
                                Randrianasulu:<br>
                              </div>
                              <blockquote type="cite">
                                <div dir="auto">
                                  <div><br>
                                    <div class="gmail_quote">
                                      <div dir="ltr" class="gmail_attr">чт,
                                        12 дек. 2024 г., 00:43 Terje J.
                                        Hanssen via Cin <<a
href="mailto:cin@lists.cinelerra-gg.org"
rel="noreferrer noreferrer noreferrer noreferrer" target="_blank"
                                          moz-do-not-send="true"
                                          class="moz-txt-link-freetext">cin@lists.cinelerra-gg.org</a>>:<br>
                                      </div>
                                      <blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                        <div> To clarify some pieces
                                          once again, I put up some
                                          basic statements or questions:<br>
                                          <br>
                                        </div>
                                      </blockquote>
                                    </div>
                                  </div>
                                </div>
                              </blockquote>
                            </blockquote>
                            ..........snip<br>
                            <blockquote type="cite">
                              <blockquote type="cite">
                                <div dir="auto">
                                  <div>
                                    <div class="gmail_quote">
                                      <blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                        <div>
                                          <div dir="auto">
                                            <div class="gmail_quote">
                                              <blockquote
                                                class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                                <div> <br>
                                                  So what happened when
                                                  adding oneVPL (qsv)
                                                  support to the build
                                                  system; dynamic linked
                                                  to system or static
                                                  added embedded into
                                                  the build?<br>
                                                </div>
                                              </blockquote>
                                            </div>
                                          </div>
                                          <div dir="auto"><br>
                                          </div>
                                          <div dir="auto">dynamic</div>
                                          <div dir="auto"><br>
                                          </div>
                                          .....snip
                                          <div dir="auto"><br>
                                          </div>
                                          <div dir="auto">
                                            <div class="gmail_quote">
                                              <blockquote
                                                class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                                                <div> Could in principle
                                                  similar methods be
                                                  extended to include
                                                  broader video
                                                  acceleration support
                                                  for AMD/amf and
                                                  NVIDIA/nvenc?<br>
                                                </div>
                                              </blockquote>
                                            </div>
                                          </div>
                                          <div dir="auto"><br>
                                          </div>
                                          <div dir="auto">nvenc already
                                            supported, I think? At some
                                            point I tried it with GF710
                                            on livedvd and it was
                                            working for me. try to test
                                            it if you have proprietary
                                            nvidia drivers.</div>
                                        </div>
                                      </blockquote>
                                    </div>
                                  </div>
                                </div>
                              </blockquote>
                            </blockquote>
                            <br>
                            Apparently Cingg then should supports NVENC
                            via some dynamic linked external Nvidia lib,
                            equivalent to what we did for for QSV via
                            oneVPL support.<br>
                            While h264_nvenc.mp4 rendering works,
                            h265_nvenc.mp4 fails with the following
                            errors, see detail below:<br>
                            <br>
                            <font face="Courier New, Courier, monospace">[hevc_nvenc
                              @ 0x7ff79c015640] No capable devices found<br>
                              FFMPEG::open_encoder  err: Generic error
                              in an external library</font><br>
                            <br>
                            <br>
                            <blockquote type="cite"><br>
                              Yes, seemingly:<br>
                              Cin/bin/ffmpeg/video> ls *nvenc*<br>
                              h264_nvenc.mp4  h264_nvenc.qt 
                              h265_nvenc.mp4<br>
                            </blockquote>
                            <br>
                            NVENC Presets<br>
                            <br>
                            <font face="Courier New, Courier, monospace">cat
                              h264_nvenc.mp4<br>
                              mp4 h264_nvenc<br>
                              # encode for nvidia graphics hw only<br>
                              preset medium<br>
                              profile main<br>
                              <br>
                              cat h265_nvenc.mp4<br>
                              mp4 hevc_nvenc<br>
                              # encode for nvidia graphics hw only<br>
                              preset medium<br>
                              profile main</font><br>
                            <br>
                            <blockquote type="cite"> <br>
                              Maybe I can do an attempt later, if I get
                              life in the old GeForce GTX 960 in my
                              Skylake workstation.<br>
                              <br>
                            </blockquote>
                            <br>
                            Setup<br>
                            ----------<br>
                            Booted BIOS and checked that the integrated
                            Intel gpu and multimonitor setup were 
                            enabled.  <br>
                            Installed the suse-prime package for <font
                              face="Courier New, Courier, monospace">nvidia/intel
                              gpu selection (for NVIDIA optimus laptops
                              with bbswitch support) and could then run
                              the command<br>
                              <br>
                              prime-select on-demand<br>
                              <br>
                              and verified that both the Intel and
                              Nvidia drivers were available<br>
                              <br>
                              inxi -G<br>
                              Graphics:<br>
                                Device-1: Intel HD Graphics 530 driver:
                              i915 v: kernel<br>
                                Device-2: NVIDIA GM206 [GeForce GTX 960]
                              driver: nvidia v: 550.135<br>
                                Display: wayland server: X.org v:
                              1.21.1.14 with: Xwayland v: 24.1.4<br>
                                  compositor: gnome-shell v: 47.2
                              driver: X: loaded: modesetting,nvidia<br>
                                  unloaded: fbdev,vesa dri: iris gpu:
                              i915 resolution: 1920x1080~60Hz<br>
                                API: OpenGL v: 4.6 vendor: intel mesa v:
                              24.3.1 renderer: Mesa Intel HD<br>
                                  Graphics 530 (SKL GT2)<br>
                                API: EGL Message: EGL data requires
                              eglinfo. Check --recommends.<br>
                              <br>
                              ==============<br>
                              <br>
                              <br>
                              Test h264_nvenc.mp4<br>
                              -------------------<br>
                              OK<br>
                              <br>
                              ./CinGG-20241120-x86_64.AppImage<br>
                              Cinelerra Infinity - built: Nov 20 2024
                              22:06:05<br>
                              <br>
                              Loads hdv09_04.m27<br>
                              Shift-R<br>
                              mp4<br>
                              h264_nvenc (video preset)<br>
                              pixels: yuv420p (default)<br>
                              <br>
                              ** rendered 5972 frames in 27.391 secs,
                              218.028 fps<br>
                              <br>
                              ffprobe -hide_banner
                              hdv09_04_h264_nvenc_yuv420p.mp4<br>
                                Stream #0:0[0x1](und): Video: h264
                              (Main) (avc1 / 0x31637661), yuvj420p(pc,
                              smpte170m/unknown/unknown), 1440x1080 [SAR
                              4:3 DAR 16:9], 2156 kb/s, 25 fps, 25 tbr,
                              12800 tbn (default)<br>
                              <br>
                              -------<br>
                              <br>
                              Tried also h264_nvenc with<br>
                              pixels: nv12<br>
                              which for slowed down to 45% speed !?<br>
                              <br>
                              Render::render_single: Session finished.<br>
                              ** rendered 5972 frames in 60.368 secs,
                              98.927 fps<br>
                              <br>
                              ffprobe -hide_banner
                              hdv09_04_h264_nvenc_nv12.mp4<br>
                                Stream #0:0[0x1](und): Video: h264
                              (Main) (avc1 / 0x31637661), yuvj420p(pc,
                              smpte170m/unknown/unknown), 1440x1080 [SAR
                              4:3 DAR 16:9], 2154 kb/s, 25 fps, 25 tbr,
                              12800 tbn (default)<br>
                            </font></div>
                        </blockquote>
                      </div>
                    </div>
                    <div dir="auto"><br>
                    </div>
                    <div dir="auto">======</div>
                    <div dir="auto"><br>
                    </div>
                    <div dir="auto">for hevc nvenc test may be try to
                      set mjpeg colorspace instead of jpeg?</div>
                  </div>
                </blockquote>
                <br>
                Tried the other option MPEG, and also BT.709, which both
                works for h264_nvenc, but has no effect with regards to
                the hevc errors.<br>
                <br>
                Tried also to comment out each and both of the
                h265_nvenc preset's <br>
                preset medium<br>
                profile main<br>
                <br>
                but with no effect. <br>
                <br>
                So far it looks for me that there is something wrong
                with Cingg's hevc_nvenc encoding.<br>
              </div>
            </blockquote>
          </div>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">most likely our nv headers drifted from that
          ffmpeg-7.0/proprietary driver assumes at runtime.</div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">you can try to install something like
          nv-codec-headers and then add </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">--disable-ffnvcodec </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">configure switch to cingg (disables our copy of
          nv headers from 2020) and see if ffmpeg compilation picked up
          system's headers.</div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">BUT you also can test progressive (not
          interlaced) file, like you did with qsv.</div>
      </div>
    </blockquote>
    <br>
    Yeah, hevc_nvenc turns out to have just the same tff interlace issue
    as we experienced with qsv.<br>
    At first I just tried to change Cingg Setting | Fomat Video to "Not
    interlaced" and the interlaced hdv file rendered OK.<br>
    Tested also that a deinterlaced (progressive) version also rendered
    ok.<br>
    <br>
    Loaded also a bff interlaced SD.dv file that Cingg Setting
    recognized as "Unknown", did render ok without manual change.<br>
    <br>
    Maybe also h265_nvenc preset at opportunity also better should be
    renamed to hevc_nvenc in accordance with ffmpeg's use.<br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <blockquote type="cite"
cite="mid:CA+rFky5DBZ8qJ0FUO-7nsYRRmqb7+R4dTusge2FXUh_PXa_dPQ@mail.gmail.com">
      <div dir="auto">
        <div dir="auto"><br>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">
          <div class="gmail_quote">
            <blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div> <br>
                <blockquote type="cite">
                  <div dir="auto">
                    <div dir="auto"><br>
                    </div>
                    <div dir="auto">
                      <div class="gmail_quote">
                        <blockquote class="gmail_quote"
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                          <div><font
                              face="Courier New, Courier, monospace"> <br>
                              ===================<br>
                              <br>
                              Test h265_nvenc.mp4<br>
                              -------------------<br>
                              <br>
                              Did not render, neither with pixels
                              yuv420p nor nv12:<br>
                            </font><font
                              face="Courier New, Courier, monospace">FFMPEG::open_encoder 
                              err: Generic error in an external library</font><br>
                            <font face="Courier New, Courier, monospace"><br>
                              [hevc_nvenc @ 0x7ff79c015640] No capable
                              devices found<br>
                              FFMPEG::open_encoder  err: Generic error
                              in an external library<br>
                              int FFMPEG::open_encoder(const char*,
                              const char*):<br>
                              open failed
                              hevc_nvenc:/run/media/terje/video/hdv09_04_h265_nvenc_yuv420p.mp4<br>
                              Render::render_single: Session finished.<br>
                              <br>
                              ===================<br>
                              <br>
                              GeForce GTX 960 (GM206) should be capable
                              to manage NVENC h265/hevc YUV 420 encoding<br>
                              <a
href="https://en.wikipedia.org/wiki/Nvidia_NVENC#Third_generation,_Maxwell_GM20x"
rel="noreferrer noreferrer noreferrer noreferrer" target="_blank"
                                moz-do-not-send="true"
                                class="moz-txt-link-freetext">https://en.wikipedia.org/wiki/Nvidia_NVENC#Third_generation,_Maxwell_GM20x</a><br>
                              <a
href="https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new"
rel="noreferrer noreferrer noreferrer noreferrer" target="_blank"
                                moz-do-not-send="true"
                                class="moz-txt-link-freetext">https://developer.nvidia.com/video-encode-and-decode-gpu-support-matrix-new</a><br>
                              <br>
                              Tested hevc_nvenc full transcoding with
                              FFmpeg 7.1<br>
                              <br>
                              ffmpeg -hide_banner -hwaccel cuda
                              -hwaccel_output_format cuda -i
                              hdv09_04.m2t -c:v hevc_nvenc
                              hdv09_04_ff_hevc_nvenc.mp4<br>
                              <br>
                              frame= 5963 fps=270 q=34.0 Lsize=  
                              64316KiB time=00:03:58.77
                              bitrate=2206.6kbits/s speed=10.8x    <br>
                              [aac @ 0x55a38d4c4d40] Qavg: 488.890<br>
                              <br>
                              ------------------<br>
                              <br>
                              ffprobe -hide_banner
                              hdv09_04_ff_hevc_nvenc.mp4<br>
                              Stream #0:0[0x1](und): Video: hevc (Main)
                              (hev1 / 0x31766568), yuv420p(tv, bt709,
                              top coded first (swapped)), 1440x1080 [SAR
                              4:3 DAR 16:9], 2074 kb/s, 24.99 fps, 25
                              tbr, 12800 tbn (default)<br>
                              <br>
                              <br>
                              <br>
                              <br>
                              <br>
                              <br>
                            </font> </div>
                          -- <br>
                          Cin mailing list<br>
                          <a href="mailto:Cin@lists.cinelerra-gg.org"
rel="noreferrer noreferrer noreferrer noreferrer" target="_blank"
                            moz-do-not-send="true"
                            class="moz-txt-link-freetext">Cin@lists.cinelerra-gg.org</a><br>
                          <a
href="https://lists.cinelerra-gg.org/mailman/listinfo/cin"
rel="noreferrer noreferrer noreferrer noreferrer noreferrer"
                            target="_blank" moz-do-not-send="true"
                            class="moz-txt-link-freetext">https://lists.cinelerra-gg.org/mailman/listinfo/cin</a><br>
                        </blockquote>
                      </div>
                    </div>
                  </div>
                </blockquote>
                <br>
              </div>
            </blockquote>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>