我们不能使用 FFMPEG 在 NVIDIA GPU 上进行 MJPEG 解码吗?

我们不能使用 FFMPEG 在 NVIDIA GPU 上进行 MJPEG 解码吗?

我受到启发这个帖子在 Tesla K20c 上试验 MJPEG 解码。我在命令提示符下输入了以下命令:

ffmpeg -hwaccel -r 10 -i 14_258.mjpeg -vcodec opencl helicopter.avi

并产生以下输出:

ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
  configuration: --valgrind=VALGRIND
  WARNING: library configuration mismatch
  avutil      configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  avcodec     configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  avformat    configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  avdevice    configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  avfilter    configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  swscale     configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  swresample  configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
[mjpeg @ 0xf41ac0] Format mjpeg detected only with low score of 25, misdetection possible!
[mjpeg @ 0xf42780] ignoring invalid SAR: 270/187
Input #0, mjpeg, from '14_258.mjpeg':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 352x288, 25 tbr, 1200k tbn, 25 tbc
Option hwaccel (use HW accelerated decoding) cannot be applied to output file 10 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for output file 10.
Error opening output files: Invalid argument

我有没有办法使用 FFMPEG 在我的 GPU 上进行 MJPEG 解码?

编辑:

根据发表的评论,我按以下方式输入了命令:

ffmpeg -r 10 -hwaccel auto -i 14_258.mjpeg -vcodec opencl helicopter.avi

这产生了以下输出:

ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
  configuration: --valgrind=VALGRIND
  WARNING: library configuration mismatch
  avutil      configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  avcodec     configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  avformat    configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  avdevice    configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  avfilter    configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  swscale     configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  swresample  configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libx264 --enable-shared --enable-pthreads
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
[mjpeg @ 0x23d91e0] Format mjpeg detected only with low score of 25, misdetection possible!
[mjpeg @ 0x23d9c00] ignoring invalid SAR: 270/187
Input #0, mjpeg, from '14_258.mjpeg':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 352x288, 25 tbr, 1200k tbn, 25 tbc
Unknown encoder 'opencl'

编辑:

我检查了这个文件了解硬件加速,并注意到使用 OpenCL 解码和编码都显示“N/A”。

这让我想到您无法使用 OpenCL 进行 MJPEG 解码。但是,即使(根据链接)OpenCL 不支持 H264 编码,我们又如何能使用 OpenCL 进行 H264 编码呢?

相关内容