ffmpeg error when encoding h264 mp4 video

0

I'm trying to do a simple encoding of an mp4 in h264 to mp4 but I keep getting the error:

Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

I'm using this command:

ffmpeg -i qDqMvfoapXh6FO3KMuYiZCcG.mp4 out.mp4

I have compiled and installed from the ffmpeginstaller 8.0 from http://ffmpeginstaller.com/

This was working until i removed everything containing ffmpeg in the file name so that I can install libvpx and recompile ffmpeg. I used this command (as root) to remove all traces of ffmpeg from my system (redhat)

 find / | grep -w ffmpeg | xargs rm -r -f
 find / | grep -w cpffmpeg | xargs rm -r -f
 find / | grep -w ffmpegscript | xargs rm -r -f

Then I installed libvpx successfully and installed ffmpeg again but have not been able to encode h264 mp4 files since. Since them I have removed ffmpeg completely and recompiled a few times but haven't got it to work again.

Complete ffmpeg output:

ffmpeg version N-68141-g4280150-syslint Copyright (c) 2000-2014 the FFmpeg developers
built on Dec  1 2014 20:24:46 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl     --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-  amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint
libavutil      54. 15.100 / 54. 15.100
libavcodec     56. 13.100 / 56. 13.100
libavformat    56. 15.101 / 56. 15.101
libavdevice    56.  3.100 / 56.  3.100
libavfilter     5.  2.103 /  5.  2.103
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  1.100 /  1.  1.100
libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'qDqMvfoapXh6FO3KMuYiZCcG.mp4':
Metadata:
major_brand     : isom
minor_version   : 0
compatible_brands: isom3gp4
creation_time   : 2014-12-01 04:18:17
Duration: 00:00:22.61, start: 0.000000, bitrate: 12028 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720, 11968 kb/s, 29.88 fps, 29.97 tbr, 90k tbn, 180k tbc (default)
Metadata:
  rotate          : 90
  creation_time   : 2014-12-01 04:18:17
  handler_name    : VideoHandle
Side data:
  displaymatrix: rotation of -90.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 121 kb/s (default)
Metadata:
  creation_time   : 2014-12-01 04:18:17
  handler_name    : SoundHandle
[libx264 @ 0x2505ee0] using cpu capabilities: none!
Output #0, mp4, to 'out.mp4':
 Metadata:
major_brand     : isom
minor_version   : 0
compatible_brands: isom3gp4
Stream #0:0(eng): Video: h264, none, q=2-31, 128 kb/s, 29.97 fps (default)
Metadata:
  rotate          : 90
  creation_time   : 2014-12-01 04:18:17
  handler_name    : VideoHandle
  encoder         : Lavc56.13.100 libx264
Stream #0:1(eng): Audio: aac, 0 channels, 128 kb/s (default)
Metadata:
  creation_time   : 2014-12-01 04:18:17
  handler_name    : SoundHandle
  encoder         : Lavc56.13.100 libfaac
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Stream #0:1 -> #0:1 (aac (native) -> aac (libfaac))
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Can someone explain why I keep getting this error now? Converting same video to webm with different command

el producer

Posted 2014-12-03T04:57:45.347

Reputation: 11

1

Does it work when you simply download a static binary from http://ffmpeg.org/download.html? It's a little weird because your ffmpeg log does not actually show the error that causes it to fail. (You may know this, but the command you used to wipe everything containing ffmpeg in the name was probably not wise to run...)

– slhck – 2014-12-03T10:44:04.797

@slhck that seemed like the best way to remove all traces of ffmpeg. can you describe what is bad about doing that? Maybe that can give me a clue about what i damaged. Also, could this be a permission issue on some lib/binary somewhere? – el producer – 2014-12-04T04:57:14.410

@slhck static ffmpeg gives same error when running same command. i even specify which bin to use /root/bin/ffmpeg. i must have screwed up something with the remove commands – el producer – 2014-12-04T04:58:08.480

Hm. But the static build has no dependencies, so it should work regardless of what happened to the system you run it on. Does it fail with any file, or just this one in particular? (If the latter, can you supply a sample?) – slhck – 2014-12-04T06:34:21.310

@slhck it fails with every mp4 i have tried so far. i can run a command to get a poster png file for example. Also i can create a webm from this same mp4 - ffmpeg -i in.mp4 -acodec libvorbis -aq 5 -ac 2 -qmax 25 -threads 2 in.webm - I have also ran ldconfig but yeah this is static build so can't figure out. maybe i will ask the host to do a full restore to default configuration – el producer – 2014-12-04T06:37:37.667

I don't know ffmpeginstaller, by the way, but I'd strongly recommend you to either just use a static build, or follow the official compilation guides here: https://trac.ffmpeg.org/wiki/CompilationGuide

– slhck – 2014-12-04T06:41:01.720

@slhck thanks. i already removed ffmpeg that was installed with ffmpeginstaller. i only have the static build now. #which ffmpeg shows the static binary i am using now – el producer – 2014-12-04T06:43:51.440

No answers