Puyodead1 / udemy-downloader

A Udemy downloader that can download courses, with DRM support.
MIT License
1.33k stars 311 forks source link

[Bug]: getting error "B frames as references are not supported" if we use --use-h265 --use-nvenc #155

Closed CHITTIMOTU closed 1 year ago

CHITTIMOTU commented 1 year ago

What happened?

image

Expected Result

videos should convert after downlaod.

Branch

master/main

What operating systems are you seeing the problem on?

Windows

Relevant log output

[12:13:18] [udemy-downloader] [process_lecture:1365] INFO:       > HLS Download success
ffmpeg version 6.0-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband        
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\repos\udemy-downloader\out_dir\azure-devops-ci-cd-pipelines\01 - Introduction\003 Prerequisities.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]  Stream #0:1[0x2](und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 62 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> hevc (hevc_nvenc))
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hevc_nvenc @ 000001d71ab8aec0] B frames as references are not supported
[hevc_nvenc @ 000001d71ab8aec0] Provided device doesn't support required NVENC features
Traceback (most recent call last):
  File "D:\repos\udemy-downloader\main.py", line 1821, in <module>
    main()
  File "D:\repos\udemy-downloader\main.py", line 1814, in main
    parse_new(_udemy)
  File "D:\repos\udemy-downloader\main.py", line 1440, in parse_new
    process_lecture(lecture, lecture_path, lecture_file_name, chapter_dir)
  File "D:\repos\udemy-downloader\main.py", line 1373, in process_lecture
    ret_code = process.wait()
               ^^^^^^^^^^^^^^
  File "C:\Users\Naveen\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1262, in wait
    return self._wait(timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Naveen\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1543, in _wait
    result = _winapi.WaitForSingleObject(self._handle,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt

Other information

May be this option can helps "-b_ref_mode 0 "

I got it from here https://github.com/GyanD/codexffmpeg/issues/78

I have this hardware image

Puyodead1 commented 1 year ago

Provided device doesn't support required NVENC features

Puyodead1 commented 1 year ago

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

CHITTIMOTU commented 1 year ago

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

I think my hardware (Quadro T2000) supports nvenc

image

I tried to use -b_ref_mode 0, as suggested https://github.com/GyanD/codexffmpeg/issues/78 but got error

Puyodead1 commented 1 year ago

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

I think my hardware (Quadro T2000) supports nvenc

image

I tried to use -b_ref_mode 0, as suggested https://github.com/GyanD/codexffmpeg/issues/78 but got error

did you actually edit the code to add that command line argument to ffmpeg or did you just try to run the downloader with it?

CHITTIMOTU commented 1 year ago

did you actually edit the code to add that command line argument to ffmpeg or did you just try to run the downloader with it?

i tried to download without any code change first, got B frame not supported error. Then i tried to change code, (to be honest, i don't know python, and i just tried this), still same error.

can you help me, what to change and where to change in code, i can try.

image

Puyodead1 commented 1 year ago

did you actually edit the code to add that command line argument to ffmpeg or did you just try to run the downloader with it?

i tried to download without any code change first, got B frame not supported error. Then i tried to change code, (to be honest, i don't know python, and i just tried this), still same error.

can you help me, what to change and where to change in code, i can try.

image

this should be correct, but will only apply to videos that have DRM

dariveric commented 1 year ago

Can add support with AMD cards hevc_amf, no more thanks