Cannot find x264 codec device for FFmpeg transcoding

For the developers that use FFmpeg in their software.
Post Reply
snoopyt98
Posts: 1
Joined: Thu Feb 13, 2020 7:49 pm

Cannot find x264 codec device for FFmpeg transcoding

Post by snoopyt98 »

I am messing around with an FFmpeg transcoding tutorial (source: https://ffmpeg.org/doxygen/trunk/transc ... ample.html)

I am using FFmpeg 4.0.5 and built it successfully as follows:

$ sudo apt-get install libx264-dev
$ cd ffmpeg-4.0.5
$ ./configure --prefix=buildout --enable-shared --disable-static --disable-doc --enable-gpl --disable-opencl --enable-libx264
$ make
$ sudo make install
$ sudo ldconfig
I have been looking at an article as well for guidance. (http://www.programmersought.com/article ... 1DBC04E9C0)

The transcoding.c source file does compile:

$ gcc transcoding.c -o out -lavformat -lavcodec -lavutil -lavfilter
Calling the executable is straight-forward:

$ ./out $INPUT_VIDEO $OUTPUT_VIDEO
where $INPUT_VIDEO is an mp4 container (h264/aac)

Up until this point everything appears to be working on my Debian 10 VM (if that is relevant). However, I get the following erroneous output:

[h264_v4l2m2m @ 0x564f664eebc0] Could not find a valid device
[h264_v4l2m2m @ 0x564f664eebc0] can't configure encoder
Cannot open video encoder for stream #0
Error occurred: Invalid argument
The article I attached says I need to add it when compiling FFmpeg, so I changed the ./configure line to as above, but to no avail. Any help or guidance would be appreciated.

Post Reply