Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1782 closed defect (fixed)

telecine filter does not work for bit-depth > 8

Reported by: dericed Owned by:
Priority: normal Component: avfilter
Version: git-master Keywords: pulldown mpfilter
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

I need to convert 24000/1001 fps video to 30000/1001 fps. Currently using -r or the fps filter, frames are duplicated to achieve the requested rate which results in jittery playback. I propose a pulldown filter which could duplicate fields (according to 3:2 pulldown http://en.wikipedia.org/wiki/Three-two_pull_down) to proper a smoother result.

Change History (8)

comment:1 Changed 4 years ago by cehoyos

  • Keywords pulldown added
  • Type changed from enhancement to defect
  • Version changed from unspecified to git-master

Could you test the following command line?
$ ffmpeg -i 24fpsinput -vf 'mp=telecine,setpts=N/(30000/1001*TB)' -r 30000/1001 -qscale 2 out.avi

Version 0, edited 4 years ago by cehoyos (next)

comment:2 Changed 4 years ago by dericed

Thanks @cehoyos. This looks close. I see the extra frames are added through interlaced fields in the 3:2 pulldown pattern; however there is a problem with the chroma. In my initial test the right side of the image is turned b&w and the chroma data on the left side is wrong.

comment:3 Changed 4 years ago by cehoyos

Please provide your command line together with complete, uncut console output.

comment:4 follow-up: Changed 4 years ago by dericed

So the error that I described before only occurs on one particular files. Others worked fine. Here is the output for the files with the chroma error output.

ffmpeg -i 2398.avi -vf 'mp=telecine,setpts=N/(30000/1001*TB)' -r 30000/1001 -qscale 2 -c:v v210 -y 2997.avi
ffmpeg version 1.0.git Copyright (c) 2000-2012 the FFmpeg developers
  built on Oct  3 2012 19:31:08 with Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --cc=cc --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-ffplay
  libavutil      51. 73.101 / 51. 73.101
  libavcodec     54. 63.100 / 54. 63.100
  libavformat    54. 29.105 / 54. 29.105
  libavdevice    54.  3.100 / 54.  3.100
  libavfilter     3. 19.102 /  3. 19.102
  libswscale      2.  1.101 /  2.  1.101
  libswresample   0. 16.100 /  0. 16.100
  libpostproc    52.  1.100 / 52.  1.100
Input #0, avi, from '2398.avi':
  Metadata:
    encoder         : Lavf54.29.105
  Duration: 00:01:00.02, start: 0.000000, bitrate: 148913 kb/s
    Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le, 720x404, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16, 128 kb/s
Please use -q:a or -q:v, -qscale is ambiguous
[Parsed_mp_0 @ 0x7ff670c19fc0] 'telecine' is a wrapped MPlayer filter (libmpcodecs). This filter may be removed
once it has been ported to a native libavfilter.
Output #0, avi, to '2997.avi':
  Metadata:
    ISFT            : Lavf54.29.105
    Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le, 720x404, q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16
Stream mapping:
  Stream #0:0 -> #0:0 (v210 -> v210)
  Stream #0:1 -> #0:1 (mp3 -> libmp3lame)
Press [q] to stop, [?] for help
frame= 1798 fps=5.9 q=0.0 Lsize= 1363052kB time=00:01:00.02 bitrate=186027.6kbits/s    
video:1361985kB audio:938kB subtitle:0 global headers:0kB muxing overhead 0.009444%

The output doesn't seem to provide many hints. I'll see if I can replicate this on a shareable input file.

comment:5 in reply to: ↑ 4 Changed 4 years ago by cehoyos

  • Reproduced by developer set
  • Status changed from new to open
  • Summary changed from pulldown filter to telecine filter does not work for bit-depth > 8

Replying to dericed:

The output doesn't seem to provide many hints.

I disagree...

The telecine filter currently does not work correctly if bit-depth > 8 bit (it works correctly if all mpi->w and mpi->chroma_width get multiplied by 2 in libavfilter/libmpcodecs/vf_telecine.c).

comment:6 Changed 4 years ago by cehoyos

  • Keywords mpfilter added

comment:7 Changed 4 years ago by cehoyos

  • Resolution set to fixed
  • Status changed from open to closed

Should be fixed for yuv formats with bit-depth > 8.

comment:8 Changed 4 years ago by cehoyos

A native telecine filter was committed to FFmpeg today, it supports many pix_fmts more than the wrapped MPlayer filter.

Note: See TracTickets for help on using tickets.