Skip to content
Permalink
Browse files

ffmpeg: Switch cuvid to generic hwaccel

With generic hwaccel, it is additionally necessary to specify the
output format. If this is not done, we'll end up downloading the
frames back and then re-uploading them.

For example:

ffmpeg -y -hwaccel cuvid -hwaccel_output_format cuda \
       -c:v h264_cuvid -i sample.mp4 \
       -c:v h264_nvenc -f rawvideo /dev/null
  • Loading branch information
philipl committed Jun 15, 2017
1 parent e53c906 commit 951e804c33bf77d87c67e11b9354c3c26721c69d
Showing with 2 additions and 77 deletions.
  1. +0 −1 Makefile
  2. +0 −1 ffmpeg.h
  3. +0 −73 ffmpeg_cuvid.c
  4. +2 −2 ffmpeg_opt.c
@@ -37,7 +37,6 @@ OBJS-ffmpeg-$(CONFIG_LIBMFX) += ffmpeg_qsv.o
ifndef CONFIG_VIDEOTOOLBOX
OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_videotoolbox.o
endif
OBJS-ffmpeg-$(CONFIG_CUVID) += ffmpeg_cuvid.o
OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
OBJS-ffserver += ffserver_config.o

@@ -665,7 +665,6 @@ int dxva2_init(AVCodecContext *s);
int vda_init(AVCodecContext *s);
int videotoolbox_init(AVCodecContext *s);
int qsv_init(AVCodecContext *s);
int cuvid_init(AVCodecContext *s);

HWDevice *hw_device_get_by_name(const char *name);
int hw_device_init_from_string(const char *arg, HWDevice **dev);

This file was deleted.

@@ -91,8 +91,8 @@ const HWAccel hwaccels[] = {
AV_HWDEVICE_TYPE_VAAPI },
#endif
#if CONFIG_CUVID
{ "cuvid", cuvid_init, HWACCEL_CUVID, AV_PIX_FMT_CUDA,
AV_HWDEVICE_TYPE_NONE },
{ "cuvid", hwaccel_decode_init, HWACCEL_CUVID, AV_PIX_FMT_CUDA,
AV_HWDEVICE_TYPE_CUDA },
#endif
{ 0 },
};

0 comments on commit 951e804

Please sign in to comment.