[FFmpeg-user] Inverse Telecine with fieldmatch filter

L. Lee llee040 at sbcglobal.net
Wed Jun 26 06:14:15 CEST 2013


On 6/25/13 5:18 PM, "Lou" <lou at lrcd.com> wrote:

>On Tue, 25 Jun 2013 16:16:12 -0500
>"L. Lee" <llee040 at sbcglobal.net> wrote:
>
>> 720p, 2.35X1 source
>> ffmpeg -i input.mp4 -vf
>> "crop=1264:528:6:100,interlace,fieldmatch=order=tff:combmatch=full,
>> yadif=deint=interlaced, decimate" -pix_fmt yuv420p -c:v libx264 -preset
>> slower -tune film -qp 20 -r 24000/1001 output.mp4
>
>Please show the complete console output.
>
>Unrelated: since you are already filtering consider using the "format"
>filter instead of -pix_fmt so you have more control where in your
>filterchain you want to apply the pixel format conversion. Same with
>"fps" replacing -r.

Here's the output. I used your suggestions as I was able, but I'm not sure
how to substitute the "format" filter for "-pix_fmt" or to replace "-r"
with "fps". Maybe the "-tune film" option results in 24 fps output.
Anyway, I didn't need to specify an output frame rate value for these
operations.

ffmpeg -i /720p_clip.mpg -vf
"crop=1264:528:6:100,interlace,fieldmatch=order=tff:combmatch=full,
yadif=deint=interlaced, decimate" -pix_fmt yuv420p -c:v libx264 -preset
slower -tune film -crf 18  /Output_720p_clip.mp4
ffmpeg version N-54184-gcea8a00 Copyright (c) 2000-2013 the FFmpeg
developers
  built on Jun 25 2013 19:05:43 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --enable-gpl --enable-libfdk-aac --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264
--enable-nonfree --enable-version3
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 17.100 / 55. 17.100
  libavformat    55. 10.100 / 55. 10.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[h264 @ 0x7f9b6c00f800] mmco: unref short failure
    Last message repeated 1 times
Input #0, mpegts, from '/720p_clip.mpg':
  Duration: 00:00:45.41, start: 1.404767, bitrate: 10598 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (Main) (HDMV / 0x564D4448), yuv420p,
1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x1100]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
5.1(side), fltp, 384 kb/s
[libx264 @ 0x7f9b6c02ae00] using SAR=1/1
[libx264 @ 0x7f9b6c02ae00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 0x7f9b6c02ae00] profile High, level 4.0
[libx264 @ 0x7f9b6c02ae00] 264 - core 133 - H.264/MPEG-4 AVC codec -
Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1
ref=8 deblock=1:-1:-1 analyse=0x3:0x133 me=umh subme=9 psy=1
psy_rd=1.00:0.15 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-3 threads=12
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2
b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23
scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=18.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/Output_720p_clip.mp4':
  Metadata:
    encoder         : Lavf55.10.100
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p,
1264x528 [SAR 1:1 DAR 79:33], q=-1--1, 24k tbn, 23.98 tbc
    Stream #0:1: Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 48000
Hz, 5.1, s16, 488 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (ac3 -> libfdk_aac)
Press [q] to stop, [?] for help
[h264 @ 0x7f9b6db9e200] mmco: unref short failure
[h264 @ 0x7f9b6db9fa00] mmco: unref short failure
frame= 1088 fps= 16 q=-1.0 Lsize=   14889kB time=00:00:45.38
bitrate=2687.6kbits/s
video:12148kB audio:2710kB subtitle:0 global headers:0kB muxing overhead
0.211773%
[libx264 @ 0x7f9b6c02ae00] frame I:6     Avg QP:10.30  size: 27208
[libx264 @ 0x7f9b6c02ae00] frame P:401   Avg QP:16.42  size: 18582
[libx264 @ 0x7f9b6c02ae00] frame B:681   Avg QP:17.73  size:  7084
[libx264 @ 0x7f9b6c02ae00] consecutive B-frames:  9.9%  9.7% 30.3% 50.0%
[libx264 @ 0x7f9b6c02ae00] mb I  I16..4: 52.4% 39.9%  7.7%
[libx264 @ 0x7f9b6c02ae00] mb P  I16..4:  8.3% 16.0%  1.6%  P16..4: 29.7%
12.1%  7.1%  0.2%  0.1%    skip:24.9%
[libx264 @ 0x7f9b6c02ae00] mb B  I16..4:  1.0%  2.6%  0.3%  B16..8: 28.8%
7.0%  1.3%  direct: 7.2%  skip:51.8%  L0:44.4% L1:42.6% BI:13.0%
[libx264 @ 0x7f9b6c02ae00] 8x8 transform intra:61.8% inter:67.7%
[libx264 @ 0x7f9b6c02ae00] direct mvs  spatial:99.0% temporal:1.0%
[libx264 @ 0x7f9b6c02ae00] coded y,uvDC,uvAC intra: 60.0% 62.1% 34.6%
inter: 18.6% 21.8% 1.1%
[libx264 @ 0x7f9b6c02ae00] i16 v,h,dc,p: 64% 16%  8% 12%
[libx264 @ 0x7f9b6c02ae00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 11% 13%  7%
10% 12% 10% 10% 15%
[libx264 @ 0x7f9b6c02ae00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 12%  9%  8%
11% 12% 12%  9% 13%
[libx264 @ 0x7f9b6c02ae00] i8c dc,h,v,p: 47% 26% 16% 11%
[libx264 @ 0x7f9b6c02ae00] Weighted P-Frames: Y:16.7% UV:12.2%
[libx264 @ 0x7f9b6c02ae00] ref P L0: 56.9% 11.8% 15.1%  5.5%  3.6%  2.6%
2.1%  1.4%  0.8%  0.1%
[libx264 @ 0x7f9b6c02ae00] ref B L0: 79.0% 11.4%  4.4%  2.1%  1.5%  1.0%
0.5%
[libx264 @ 0x7f9b6c02ae00] ref B L1: 94.4%  5.6%
[libx264 @ 0x7f9b6c02ae00] kb/s:2192.85




>
>http://ffmpeg.org/ffmpeg-filters.html#format-1
>http://ffmpeg.org/ffmpeg-filters.html#fps
>
>Also, why -qp instead of -crf?
>
>> 1080i, 16X9 source:
>> ffmpeg -i input.mp4 -vf "fieldmatch=order=tff:combmatch=none, decimate,
>> scale=1280:-1" -pix_fmt yuv420p -c:v libx264 -preset slower -tune film
>>-qp
>> 20 -r 24000/1001 output.mp4
>
>Please show the complete console output here too.



ffmpeg -i /1080i_clip.mp4 -vf "fieldmatch=order=tff:combmatch=none,
decimate, scale=1280:-1" -pix_fmt yuv420p -c:v libx264 -preset slower
-tune film -crf 18 -maxrate 2100k -bufsize 1835k /Output_1080i_clip.mp4
ffmpeg version N-54184-gcea8a00 Copyright (c) 2000-2013 the FFmpeg
developers
  built on Jun 25 2013 19:05:43 with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
  configuration: --enable-gpl --enable-libfdk-aac --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264
--enable-nonfree --enable-version3
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 17.100 / 55. 17.100
  libavformat    55. 10.100 / 55. 10.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f82c380f200] stream 0, timescale not set
[h264 @ 0x7f82c3813800] mmco: unref short failure
    Last message repeated 3 times
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f82c380f200] Stream #2: not enough frames to
estimate rate; consider increasing probesize
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/1080i_clip.mp4':
  Metadata:
    major_brand     : M4VH
    minor_version   : 1
    compatible_brands: M4VHmp42avc1isom
    creation_time   : 2013-06-25 18:47:06
    title           : 2mclip
    artist          : 2mclip
    media_type      : 10
    show            : 2mclip
    network         :
    genre           : TV Shows
    date            : 2013-04-24
  Duration: 00:02:33.70, start: 0.000000, bitrate: 14138 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], 13484 kb/s, 29.95 fps, 29.97 tbr, 29970 tbn,
59.94 tbc
    Metadata:
      creation_time   : 2013-06-25 18:47:06
      handler_name    : ?Apple Video Media Handler
    Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side),
fltp, 640 kb/s
    Metadata:
      creation_time   : 2013-06-25 18:47:06
      handler_name    : ?Apple Sound Media Handler
    Stream #0:2: Video: mjpeg, yuvj420p, 512x512 [SAR 1:1 DAR 1:1], 90k
tbr, 90k tbn, 90k tbc
[libx264 @ 0x7f82c384ee00] using SAR=1/1
[libx264 @ 0x7f82c384ee00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX
[libx264 @ 0x7f82c384ee00] profile High, level 4.0
[libx264 @ 0x7f82c384ee00] 264 - core 133 - H.264/MPEG-4 AVC codec -
Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1
ref=8 deblock=1:-1:-1 analyse=0x3:0x133 me=umh subme=9 psy=1
psy_rd=1.00:0.15 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-3 threads=12
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2
b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23
scenecut=40 intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=18.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2100 vbv_bufsize=1835
crf_max=0.0 nal_hrd=none ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'Output_1080i_clip.mp4':
  Metadata:
    major_brand     : M4VH
    minor_version   : 1
    compatible_brands: M4VHmp42avc1isom
    date            : 2013-04-24
    title           : 2mclip
    artist          : 2mclip
    media_type      : 10
    show            : 2mclip
    network         :
    genre           : TV Shows
    encoder         : Lavf55.10.100
    Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021),
yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 11988 tbn, 23.98 tbc
    Metadata:
      creation_time   : 2013-06-25 18:47:06
      handler_name    : ?Apple Video Media Handler
    Stream #0:1(eng): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040),
48000 Hz, 5.1, s16, 488 kb/s
    Metadata:
      creation_time   : 2013-06-25 18:47:06
      handler_name    : ?Apple Sound Media Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> libx264)
  Stream #0:1 -> #0:1 (ac3 -> libfdk_aac)
Press [q] to stop, [?] for help
[h264 @ 0x7f82c5b6c600] mmco: unref short failure
    Last message repeated 1 times
[h264 @ 0x7f82c5b6d200] mmco: unref short failure
    Last message repeated 1 times
frame CRC mismatch1 q=26.0 size=   42389kB time=00:02:33.23
bitrate=2266.1kbits/s
[ac3 @ 0x7f82c3845800] frame CRC mismatch
frame= 3680 fps= 11 q=-1.0 Lsize=   43535kB time=00:02:33.70
bitrate=2320.2kbits/s
video:34257kB audio:9173kB subtitle:0 global headers:0kB muxing overhead
0.242341%
[libx264 @ 0x7f82c384ee00] frame I:29    Avg QP:19.10  size: 63599
[libx264 @ 0x7f82c384ee00] frame P:1081  Avg QP:21.73  size: 18787
[libx264 @ 0x7f82c384ee00] frame B:2570  Avg QP:24.66  size:  5029
[libx264 @ 0x7f82c384ee00] consecutive B-frames:  2.0%  4.1% 31.4% 62.5%
[libx264 @ 0x7f82c384ee00] mb I  I16..4: 14.0% 69.2% 16.9%
[libx264 @ 0x7f82c384ee00] mb P  I16..4:  7.2% 13.5%  1.2%  P16..4: 45.0%
11.4%  8.2%  0.2%  0.0%    skip:13.2%
[libx264 @ 0x7f82c384ee00] mb B  I16..4:  0.7%  0.9%  0.1%  B16..8: 39.5%
5.6%  0.9%  direct: 3.7%  skip:48.6%  L0:40.6% L1:53.9% BI: 5.4%
[libx264 @ 0x7f82c384ee00] 8x8 transform intra:61.3% inter:68.9%
[libx264 @ 0x7f82c384ee00] direct mvs  spatial:99.8% temporal:0.2%
[libx264 @ 0x7f82c384ee00] coded y,uvDC,uvAC intra: 48.0% 51.2% 12.9%
inter: 11.2% 14.3% 0.1%
[libx264 @ 0x7f82c384ee00] i16 v,h,dc,p: 46% 17%  6% 31%
[libx264 @ 0x7f82c384ee00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 10%  8%  7%
10% 13% 11% 11% 11%
[libx264 @ 0x7f82c384ee00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 14%  6%  7%
11% 12% 12%  9% 10%
[libx264 @ 0x7f82c384ee00] i8c dc,h,v,p: 35% 28% 24% 12%
[libx264 @ 0x7f82c384ee00] Weighted P-Frames: Y:3.1% UV:1.0%
[libx264 @ 0x7f82c384ee00] ref P L0: 58.0% 12.1% 16.5%  4.0%  3.2%  2.3%
2.1%  1.3%  0.5%  0.0%
[libx264 @ 0x7f82c384ee00] ref B L0: 87.2%  7.7%  2.4%  1.1%  0.8%  0.5%
0.3%
[libx264 @ 0x7f82c384ee00] ref B L1: 96.1%  3.9%
[libx264 @ 0x7f82c384ee00] kb/s:1828.34



Thanks.

Laine Lee




More information about the ffmpeg-user mailing list