Automatic encoder selection failed for output stream #0:0 [duplicate] - ffmpeg

I have installed ffmpeg using yum install in my centos.Now i want to recompile it with 'libmp3lame'.Is possible a recompilation of the installed ffmpeg or i want to remove ffmpeg and reinstall.
suggestion is highly appreciable.

Unlike AAC and some other audio formats, FFmpeg does not have a native MP3 encoder, so you have to use a supported external encoding library such as libmp3lame. You have several options if your ffmpeg is not configured with --enable-libmp3lame:
Download an already compiled binary
Download ffmpeg for Linux. This is an already compiled binary. This is the easiest solution.
See the FFmpeg Download page for links to Windows and OS X builds.
Compile ffmpeg
Follow a non-invasive step-by-step guide to Compile FFmpeg on CentOS. If you can copy and paste you can compile.
Pipe to lame
ffmpeg -i input -f wav - | lame - output.mp3
I do not consider this to be a practical solution but it may be useful to some.
Use a different format
If you don't require MP3 you can use AAC or some other audio format that has native encoding support.

Related

I want to use libx264 codec with ffmpeg. but Ffmpeg libx264's configuration failed

configure failed
I want to use libx264 codec with ffmpeg.
when i tried to convert image files to a video using the codec, a message appears said Unknown encoder "libx264". so I tried to execute configure and make again at msys folder. I typed ./configure --enable-libx264 and it failed. :(
my ffmpeg version is 3.0.1 and x264 is also the latest version so far.
It is possible that you don't have the x264 libraries for compiling on your machine.
The last time I compiled FFMpeg I downloaded and compiled x264 also along with it to ensure I had the libraries installed.
http://www.videolan.org/developers/x264.html
It may also interest you to enable OpenH264 by Cisco.
http://www.openh264.org/

How to add libmp3lame, libx264, libvo_aacenc and libvorbis codecs to existing ffmpeg install on Redhat 6.7

Adobe cq uses ffmpeg to transcode videos. There is a workflow that is triggered when a user uploads any video to the digital asset management (DAM) section. This workflow internally uses ffmpeg to transcode the uploaded video and spits out additional video renditions in formats like ogg, m4v, mp3.
The server (Red Hat Enterprise Linux Server release 6.5) on which adobe cq runs needs to have ffmpeg installed for the DAM workflow to function. ffmpeg has already installed been installed, but it is missing certain codecs: libmp3lame, libx264, libvo_aacenc and libvorbis.
How to add and enable these codecs ?
You can't just add support for arbitrary external libraries to an existing ffmpeg binary.
You'll either need to download a new ffmpeg binary, or compile ffmpeg. Downloading a build is easiest and supports the encoders you listed (except libvo_aacenc). Compiling allows for customization.
Avoid libvo_aacenc: it provides poor quality and support for libvo_aacenc has been removed from FFmpeg. Use the native FFmpeg AAC encoder instead. See FFmpeg Wiki: AAC for more info.

How to install libfdk_aac for FFMPEG

While compiling ffmpeg it's showing Unknown encoder libfdk_aac error.
Can anyone explain how I can install libfdk_aac for my FFMPEG?
I am using centos 6.
libfdk_aac is considered non-free and therefore non-redistributable, so you should find no builds with support for this encoder. Therefore, you must compile.
The FFmpeg Wiki has a compile guide with step-by-step instructions for CentOS. The resulting ffmpeg binary will support libfdk_aac:
FFmpeg Wiki: Compile FFmpeg on CentOS
Note that this guide performs a "local installation" into the ~/bin directory of the user following the guide: this is to avoid conflicts with the package management system, system files, and repository packages. Also, it allows a non-superuser to compile, such as on a shared server (assuming the build dependencies, like make, are available). This works fine for most users, but depending on your needs you may have to move the binary somewhere else in your PATH environment variable.
Alternatively, you could just use a different AAC encoder. Feed it enough bits and you'll do fine.
Generally, "link-only" answers are discouraged, but I'm going to make an exception in this case. I am hesitant to copy and paste the content from the link because of the size of the guide and the likely chance that the answer will become outdated as the guide is updated (such as what happens to the many rotting copycat compile guides).

OpenCV videowriter H264 codec (ffmpeg)

I want to save a video with opencv with lossless compresion so I don't lose any details of the frames. Everything works with the xvid codec but offcourse this is not a lossless compression so I found that the x264 codec is suitable. However it doesn't work, I tried the following sample code but while running I get the following error: "could not find encoder for codec id 28: encoder not found."
cv::VideoWriter makeVideo;
makeVideo.open("makevideo//newVideo.mp4", CV_FOURCC('X','2','6','4'), 30, cv::Size(1600,1200), true);
cv::Mat image = imread("makevideo//frames//111.png");
for(int i = 0; i < 200; i++)
makeVideo << image;
makeVideo.release();
I found that for this to work, I need to have ffmpeg support. I'm currently using opencv2.4.6 and in this discussion (how can I use the openCV FFMPEG video I/O rather than the DirectShow one in Windows?) someone mentioned that in opencv2.4 ffmpeg is automatically included. But its not working....
Here (How to compile OpenCV 2.3 with ffmpeg support with Visual Studio 2010) I found how to compile opencv and ffmpeg yourself on windows. I followed all the steps sucessfully but still I get the same error....
I had the same problem and could not find a solution. So now I always use -1 as FOURCC and choose the x264 codec by hand.
I managed to work it out on ubuntu, write down for your reference.
In order to have x264 codec work, you need to: Build FFmpeg with x264 enabled!
Before debug about OpenCV, please make sure you could generate x264 with ffmpeg, by itself.
Try the below command to verify H264 codec:
ffmpeg -i x264-input.mp4 -vcodec libx264 -f mp4 x264-output.mp4
Follow the FFmpeg officially doc to install from source.

recompile ffmpeg with libmp3lame

I have installed ffmpeg using yum install in my centos.Now i want to recompile it with 'libmp3lame'.Is possible a recompilation of the installed ffmpeg or i want to remove ffmpeg and reinstall.
suggestion is highly appreciable.
Unlike AAC and some other audio formats, FFmpeg does not have a native MP3 encoder, so you have to use a supported external encoding library such as libmp3lame. You have several options if your ffmpeg is not configured with --enable-libmp3lame:
Download an already compiled binary
Download ffmpeg for Linux. This is an already compiled binary. This is the easiest solution.
See the FFmpeg Download page for links to Windows and OS X builds.
Compile ffmpeg
Follow a non-invasive step-by-step guide to Compile FFmpeg on CentOS. If you can copy and paste you can compile.
Pipe to lame
ffmpeg -i input -f wav - | lame - output.mp3
I do not consider this to be a practical solution but it may be useful to some.
Use a different format
If you don't require MP3 you can use AAC or some other audio format that has native encoding support.

Resources