[FFmpeg-user] video plays the same frame after 2 seconds

Lou lou at lrcd.com
Thu May 31 03:35:23 CEST 2012


On Thu, 31 May 2012 01:21:27 +0300
Thomas Evangelidis <tevang3 at gmail.com> wrote:

> Hi Lou,
> 
> Many thanks for your elaborate comments! I removed the ffmpeg version I
> installed from the Ubuntu repositories along with the linked libraries and
> reinstalled the version you recommended. However I get a different type of
> error this time:
> 
> $ ffmpeg -r 50 -qscale 5 -i WT_Hbonds.%05d.ppm
> test.mp4

You're applying "-qscale 5" as in input option (before -i), and since
it is an output only option it is being ignored. It should be used as
an output option (after -i WT_Hbonds.%05d.ppm).

However, the default behavior has changed now that you are using recent
ffmpeg. It now automatically chooses the libx264 encoder (you can see
this mentioned in the console output), if available, instead of the
mpeg4 encoder for mp4 output. The -qscale option should not be used with
libx264. You can use -crf instead. Default value is 23. A lower value
is a higher quality. A sane range is around 18-28. Generally you use
the highest value that still gives you an acceptable quality.

> [libx264 @ 0x20f05e0] height not divisible by 2 (1280x745)

libx264 requires your width and height to be divisible by 2. Either
modify the height with the crop, pad, or scale filters:

ffmpeg -r 50 -i WT_Hbonds.%05d.ppm -vf crop=iw:ih-1 crop.mp4
ffmpeg -r 50 -i WT_Hbonds.%05d.ppm -vf pad=iw:ih+1 pad.mp4
ffmpeg -r 50 -i WT_Hbonds.%05d.ppm -vf scale="iw:trunc(ow/a/2)*2"
scale.mp4

Or go back to the mpeg4 encoder which is less picky (but less
efficient):

ffmpeg -r 50 -i WT_Hbonds.%05d.ppm -c:v mpeg4 -qscale 5 test.mp4

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

This odd height was the issue here as mentioned earlier.

> I keep getting this error message for every combination of options I use. I
> also checked in the list that the solution of " #0:0 - maybe incorrect
> parameters such as bit_rate, rate, width or height" is to remove all x264
> binaries, redownload the latest x264 and recompile ffmpeg.

Unnecessary since you just did that and have the most recent ffmpeg and
x264.

> The only thing I've changed in the recommended installation procedure is that
> instead of saving and installing the programs/libraries in my home directory,
> I installed them in ~/Programs subdirectory. I don't know if this really matters.

Using ~/Programs instead of ~/ should be just fine.


More information about the ffmpeg-user mailing list