Ticket #6581: 10-fix.md

File 10-fix.md, 2.1 KB (added by giwiniswut, 5 years ago)

Summary of dodging this constraint, written in MarkDown

Line 
1The main issue seems to be the "invalid picture dimension"
2
3`[indeo3 @ 0x55a6eb70b480] Invalid picture dimensions: 182 x 182!`
4
5As can be seen at https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/indeo3.c#L174
6ffmpeg wants the dimensions to be divisible by 8:
7
8```
9 if (luma_width < 16 || luma_width > 640 ||
10 luma_height < 16 || luma_height > 480 ||
11 luma_width & 3 || luma_height & 3) {
12 av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
13 luma_width, luma_height);
14 return AVERROR_INVALIDDATA;
15 }
16```
17
18If we remove this constraint from the if statement and recompile ffmpeg it seems to convert your sample videos just fine.
19The if statement should look like this:
20
21```
22 if (luma_width < 16 || luma_width > 640 ||
23 luma_height < 16 || luma_height > 480) {
24 av_log(avctx, AV_LOG_ERROR, "Invalid picture dimensions: %d x %d!\n",
25 luma_width, luma_height);
26 return AVERROR_INVALIDDATA;
27 }
28```
29
30When compiling, be sure to enable the encoders you need. For example, h264 must explicitly be enabled and one way as per `man ffmpeg-codecs` is as follows:
31
32```
33 libx264, libx264rgb
34 x264 H.264/MPEG-4 AVC encoder wrapper.
35
36 This encoder requires the presence of the libx264 headers and library during configuration. You
37 need to explicitly configure the build with "--enable-libx264".
38```
39
40So you'll have to run your `./configure` as `./configure --enable-gpl --enable-libx264` before compiling FFmpeg with `make`.
41
42
43
44### This is how i converted the files
45
46According to `x264 --fullhelp`, `-qp 0` should produce lossless encoding:
47
48```
49Ratecontrol:
50
51 -q, --qp <integer> Force constant QP (0-81, 0=lossless)
52 -B, --bitrate <integer> Set bitrate (kbit/s)
53```
54
55So here goes:
56
57```
58~/Development/ffmpeg/ffmpeg -y -i 70_1.mp4 -map 0:0 -c libx264 -qp 0 70_1_fixed.mp4
59~/Development/ffmpeg/ffmpeg -y -i 95_1.mp4 -map 0:0 -c libx264 -qp 0 95_1_fixed.mp4
60```
61
62During this ffmpeg adjusted the image dimensions to be divisible by 8 so the results of this conversion should cause no further problems.