1

I was inspired by this post to experiment with MJPEG decoding on a Tesla K20c. I typed the following command on the command prompt:

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

and it produced the following output:

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

Is there anyway for me to do MJPEG decoding on my GPU by using FFMPEG?

EDIT:

According to the comments posted, I typed my command in the following way:

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

This produced the following output:

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'

EDIT:

I checked this document to find out about hardware acceleration and noticed that it says 'N/A' there for both decoding and encoding with OpenCL.

This leads me to think you cannot do MJPEG decoding with OpenCL. But how could we do H264 encoding with OpenCL even though (according to the link) OpenCL does not support it?

3
  • As a first step the error message wants you to move the -hwaccel option. It suggests it should be immediately before your input file rather than having other options in the way. Try moving the -r 10 before the -hwaccel.
    – Mokubai
    Mar 28, 2017 at 6:48
  • hwaccel expects a value, but none is provided, so it takes the next token -r as its value and thus 10 becomes the output token. Add auto right after -hwaccel. Just correcting the syntax error. Don't believe a hardware MJPEG decoder is available.
    – Gyan
    Mar 28, 2017 at 7:06
  • @Mokubai and Mulvya Thank you for your suggestions. I ran this command: ffmpeg -r 10 -hwaccel auto -i 14_258.mjpeg -vcodec opencl helicopter.avi and it gave me the error Unknown encoder 'opencl'.
    – a_sid
    Mar 28, 2017 at 16:38

0

You must log in to answer this question.

Browse other questions tagged .