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

NVIDIA NVENC support #25086

Closed
raymater opened this issue May 1, 2020 · 6 comments
Closed

NVIDIA NVENC support #25086

raymater opened this issue May 1, 2020 · 6 comments
Labels

Comments

@raymater
Copy link

@raymater raymater commented May 1, 2020

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2020.03.24
  • I've searched the bugtracker for similar feature requests including closed ones

Description

I've tried to pass args for NVENC FFMPEG with external-downloader-args. But it doesn't work because it's not make for encode (to H.264 MP4) but for download, as a result if I try to passed some args for hardware encode : it doesn't work when YouTube-DL try to download the video. How I can force NVENC transcode for YouTube-DL? Can you add this feature? Would like to have this feature because my CPU is used for encode.

@raymater raymater added the request label May 1, 2020
@tripulse
Copy link

@tripulse tripulse commented May 1, 2020

To understand what is going wrong, the full/verbose output of youtube-dl is required.
Try running with the --verbose flag and post the output of it.

@raymater
Copy link
Author

@raymater raymater commented May 1, 2020

Command : '/usr/local/bin/youtube-dl' 'my_youtube_video' '--no-playlist' '--ignore-config' '--write-info-json' '--continue' '--output=%(title)s.%(ext)s' '--cache-dir=my_cache_path' '--restrict-filenames' '--format=bestvideo+bestaudio' '--recode-video=mp4' '--external-downloader=ffmpeg' '--external-downloader-args=-hwaccel_output_format cuda -c:v h264_nvenc -preset slow'

Exit Code: 1(General error)

Result : Unknown decoder 'h264_nvenc'

My FFMPEG support h264_nvenc :
ffmpeg version N-97538-gc810a9502c Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: --enable-nonfree --enable-nvenc --enable-libx264 --enable-gpl --enable-cuda --enable-cuvid --enable-cuda-nvcc libavutil 56. 43.100 / 56. 43.100 libavcodec 58. 82.100 / 58. 82.100 libavformat 58. 42.101 / 58. 42.101 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 80.100 / 7. 80.100 libswscale 5. 6.101 / 5. 6.101 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100

It consider that the h264_nvenc is the decoder but how can I declare it for only encoder?

@tripulse
Copy link

@tripulse tripulse commented May 2, 2020

This is still not a verbose log. Run this command and send the output:

'/usr/local/bin/youtube-dl' my_youtube_video --no-playlist --ignore-config --write-info-json --continue --output='%(title)s.%(ext)s' --cache-dir=my_cache_path --restrict-filenames --format='bestvideo+bestaudio' --recode-video=mp4 --external-downloader=ffmpeg --external-downloader-args='-hwaccel_output_format cuda -c:v h264_nvenc -preset slow' --verbose
@raymater
Copy link
Author

@raymater raymater commented May 2, 2020

I resolve my problem, it works !

In postprocessor-args, I had to have this : '--postprocessor-args=-c:v h264_nvenc -preset slow'.
Do not use --external-downloader-args and --external-downloader for this.

Also I had to upgrade my NVIDIA drivers because FFMPEG support NVENC on drivers v435 or more recent.

@raymater raymater closed this May 2, 2020
@steam3d
Copy link

@steam3d steam3d commented May 3, 2020

Can you write the right command? I still has trouble with h264_nvenc

@raymater
Copy link
Author

@raymater raymater commented May 3, 2020

Can you write the right command? I still has trouble with h264_nvenc

'/usr/local/bin/youtube-dl' 'url_youtube_video' '--no-playlist' '--ignore-config' '--write-info-json' '--continue' '--output=%(title)s.%(ext)s' '--cache-dir=my_cache_path' '--restrict-filenames' '--format=bestvideo+bestaudio' '--recode-video=mp4' '--postprocessor-args=-c:v h264_nvenc -preset slow'

Replace url_youtube_video by your URL and my_cache_path by your folder that you want to declare like a cache directory (optional).

@steam3d steam3d mentioned this issue May 4, 2020
6 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.