FFmpeg video encoder example code is not working

0

I am using ffmpeg in ubuntu. Its version and other things are shown below:

ffmpeg -h encoder=h264
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
  configuration: 
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
Encoder h264_v4l2m2m [V4L2 mem2mem H.264 encoder wrapper]:
    General capabilities: delay 
    Threading capabilities: none
h264_v4l2_m2m_encoder AVOptions:

I ran encoder using built code as the following

~/ffmpeg-4.0/doc/examples$ ./encode_video out.h264 ff_h264_v4l2_m2m_encoder

And receive the following error:

Codec 'ff_h264_v4l2_m2m_encoder' not found

can any one of you help me ? what is the codec name should be used here to run example code itself?

anand

Posted 2018-05-10T22:18:33.693

Reputation: 1

Answers

1

Install x264:

  • git clone http://git.videolan.org/git/x264.git
  • cd x264
  • sudo ./configure --enable-shared --disable-asm
  • sudo make && sudo make install

Build FFmpeg again. For example, for me the command is:

  • sudo ./configure --disable-yasm --enable-libx264 --enable-swscale --enable-avresample --enable-gpl --enable-shared
  • sudo make && make install

If you use OpenCV, you must build it again.

NIii Rr

Posted 2018-05-10T22:18:33.693

Reputation: 11

sudo make && make install runs make as root (sudo) and make install as your ordinary user (not privileged).  If anything needs to be run with root privileges, it’s make install.  Conversely, ./configure and (plain) make typically don’t need to be run with root privileges. – Scott – 2018-08-14T09:02:52.197