[FFmpeg-user] Detelecine: I got the right result from the wrong command?

Mark Filipak markfilipak.imdb at gmail.com
Thu May 29 03:47:19 EEST 2025


On 28/05/2025 19.18, Alex Xu wrote:
> Anyways, I tried:
> 
> ffmpeg -i detelecine_input.mkv -vf
> "fieldmatch,decimate,drawtext=fontfile=Arial.ttf: text='%{frame_num}':
> start_number=0: x=(w-tw)/2: y=h-(2*lh): fontcolor=black: fontsize=20:
> box=1: boxcolor=white: boxborderw=5" -c:v libx264 -crf 18 -c:a aac -b:a
> 192k -pix_fmt yuv420p fieldmatch_decimate_only_no_r.mkv
> 
> the issue of duplicated frames 174+175 and skipped 173.

So, frame 173 was dropped, and frame 174 was repeated. I think that may have resulted from "-crf 18".

> In case you missed it, my test file was in the first message of the chain.
> And using the detelecine filter got me the right result (with wrong params?)

Yes, the 'detelecine' filter will give you correct results for video that's been statically and 
correctly telecined: no variations, clean joins of the VOBs, if applicable. But 
'fieldmatch'+'decimate' can be configured exactly that way. In contrast 'fieldmatch' is a lot smarter.

I hope you don't mind that I reformatted your commands.

for i in 0 1 2 3 4; do
for j in 23 2332; do
ffmpeg^
  -i detelecine_input.mkv^
  -c:v libx264^
  -crf 18^           <== trouble?
  -c:a aac^
  -b:a 192k^         <== why?
  -pix_fmt yuv420p^  <== unnecessary
  -vf^
  "detelecine=start_frame=$i:pattern=$j"
  $i$j.mkv;
done
done

I see what you're doing. By the way, which $i$j.mkv was the best?

Your latest:

set _DETELECINE_=fieldmatch,decimate
set _SHOW_N_=drawtext=fontfile=Arial.ttf^
:text='%{frame_num}'^
:start_number=0^
:x=(w-tw)/2:y=h-(2*lh)^
:fontcolor=black:fontsize=20^
:box=1:boxcolor=white:boxborderw=5
ffmpeg^
  -i detelecine_input.mkv^
  -vf^
  "%_DETELECINE_%,%_SHOW_N_%"^
  -c:v libx264^
  -crf 18^           <== trouble?
  -c:a aac^
  -b:a 192k^         <== why?
  -pix_fmt yuv420p^  <== unnecessary
  fieldmatch_decimate_only_no_r.mkv

By the way, I send about 30 options directly to x264 via '-x264-params', none of which is 'crf'. My 
videos are the highest quality and the smallest files ever.



More information about the ffmpeg-user mailing list