Eu me inspirei em esta postagem para experimento com decodificação MJPEG em um Tesla K20c. Eu digitei o seguinte comando no prompt de comando:
ffmpeg -hwaccel -r 10 -i 14_258.mjpeg -vcodec opencl helicopter.avi
e produziu a seguinte saída:
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
Existe alguma maneira de eu decodificar o MJPEG na minha GPU usando o FFMPEG?
EDITAR:
De acordo com os comentários postados, eu digitei meu comando da seguinte maneira:
ffmpeg -r 10 -hwaccel auto -i 14_258.mjpeg -vcodec opencl helicopter.avi
Isso produziu a seguinte saída:
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'
EDITAR:
Eu verifiquei este documento para saber mais sobre aceleração de hardware e percebi que ele diz 'N / A' para ambos decodificação e codificação com OpenCL.
Isso me leva a pensar que você não pode decodificar o MJPEG com o OpenCL. Mas como podemos fazer a codificação H264 com o OpenCL mesmo que (de acordo com o link) o OpenCL não suporte isso?