id,summary,reporter,owner,description,type,status,priority,component,version,resolution,keywords,cc,blockedby,blocking,reproduced,analyzed
993,ffmpeg / ffplay fails to correctly decode interlaced h264 (MTS container) when using default number of threads,ls,,"ffplay shows flickering block artifacts when decoding interlaced h264 video from a MTS file. When transcoding to h264/MP4 using ffmpeg similar artifacts appear. In the latter case, the number of artifacts depends on the encoding preset used. -preset ultrafast creates many while -preset medium much less.

 * The problem appears using ffmpeg git revision 394d41ee30b0c4a38a8d33b65e28facfef15d465 and the 0.10 point relase.
 * libx264 from stable branch (a3f44077dc238dea92c0894d352b5a8723b9201b) is used.
 * Using the systems ffplay version 0.7.3-4:0.7.3-0ubuntu0.11.10.1 does not show this problem.

 * As a workaround adding -threads 1 to the command line seems to fix this.

Platform used for testing:
 * Ubuntu 11.10
 * Linux 3.0.0-16-generic !#28-Ubuntu SMP Fri Jan 27 17:44:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
 * CPU: Intel(R) Core(TM) i7 CPU       M 620  @ 2.67GHz

ffprobe output:
{{{
ffprobe -loglevel 99 00001.MTS 
ffprobe version git-2012-02-10-394d41e Copyright (c) 2007-2012 the FFmpeg developers
  built on Feb 11 2012 00:00:48 with gcc 4.6.1
  configuration: --prefix=/home/ls/ffmpeg-trunk --enable-shared --disable-static --enable-gpl --enable-nonfree --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-sram --cpu=core2 --enable-hwaccel=h264_vaapi --enable-hwaccel=mpeg2_vaapi --enable-hwaccel=mpeg4_vaapi --enable-libfaac --enable-x11grab --disable-ffserver --enable-libass --enable-libfreetype
  libavutil      51. 39.100 / 51. 39.100
  libavcodec     54.  1.100 / 54.  1.100
  libavformat    54.  0.100 / 54.  0.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 62.100 /  2. 62.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0x1b424e0] Format mpegts probed with size=2048 and score=100
[mpegts @ 0x1b424e0] stream=0 stream_type=1b pid=1011 prog_reg_desc=HDMV
[mpegts @ 0x1b424e0] stream=1 stream_type=81 pid=1100 prog_reg_desc=HDMV
[mpegts @ 0x1b424e0] stream=2 stream_type=90 pid=1200 prog_reg_desc=HDMV
[mpegts @ 0x1b424e0] parser not found for codec hdmv_pgs_subtitle, packets or times may be invalid.
[h264 @ 0x1b463e0] no picture 
[mpegts @ 0x1b424e0] Probe buffer size limit 5000000 reached
Input #0, mpegts, from '00001.MTS':
  Duration: 00:03:01.51, start: 1.000033, bitrate: 17122 kb/s
  Program 1 
    Stream #0:0[0x1011], 125, 1/90000: Video: h264 (High) (HDMV / 0x564D4448), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 1/50, 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x1100], 71, 1/90000: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, s16, 256 kb/s
    Stream #0:2[0x1200], 25, 1/90000: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
[h264 @ 0x1b463e0] detected 4 logical cores
}}}

Command that produces artifacts when playing:
{{{
~/ffmpeg-trunk/bin/ffplay 00001.MTS
}}}

Workaround:
{{{
~/ffmpeg-trunk/bin/ffplay -threads 1 00001.MTS
}}}

Command that produces artifacts when transcoding:
{{{
~/ffmpeg-trunk/bin/ffmpeg -i '00001.MTS' -async 1 -codec:v libx264 -preset ultrafast -crf 20 -codec:a libfaac -ab 256k '00001.mp4'
}}}

Workaround:
{{{
~/ffmpeg-trunk/bin/ffmpeg -threads 1 -i '00001.MTS' -async 1 -codec:v libx264 -preset ultrafast -crf 20 -codec:a libfaac -ab 256k '00001.mp4'
}}}
",defect,closed,important,avcodec,git-master,fixed,h264 regression,,,,1,0
