Opened 5 years ago

Last modified 2 years ago

#2602 open enhancement

Implement a soft-telecine filter

Reported by: microchip Owned by:
Priority: wish Component: avformat
Version: git-master Keywords: mpegps pulldown mpeg2video
Cc: electron.rotoscope Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

Hi,

It'd be useful to flag progressive 23.976fps NTSC content as soft-telecined when encoding to DVD. MEncoder already supports this when using -of mpeg format=dvd:tsaf:telecine. Alternatively, if no new filters is desired, this functionality could be added to the existing telecine ffmpeg filter.

Thanks

Attachments (2)

without_pulldown_flag.m2v (371.7 KB) - added by electron.rotoscope 3 years ago.
original m2v encoded from ffmpeg
with_pulldown_flag.m2v (371.7 KB) - added by electron.rotoscope 3 years ago.
ffmpeg encode after running through dgpulldown

Download all attachments as: .zip

Change History (12)

comment:1 Changed 5 years ago by cehoyos

Please provide a (failing) FFmpeg and the matching (successful) MEncoder command line.

comment:2 Changed 5 years ago by microchip

Hi

I can't provide a failing ffmpeg command line as ffmpeg doesn't support soft-telecining of content while mencoder does and i already provided the mencoder example in my first post. I'm not sure what you want me to provide. All I ask is the possibility to set a soft-telecine flag when encoding to NTSC DVD, just like it's possible with mencoder ... -of mpeg format=dvd:telecine

comment:3 Changed 5 years ago by cehoyos

mencoder ... -of mpeg format=dvd:telecine doesn't look like a command line that could be used for testing once the feature is implemented in FFmpeg.

comment:4 Changed 5 years ago by microchip

You want me to provide the full mencoder command line to soft-telecine a progressive 23.976fps content? Because I don't know what else to provide.

mencoder input-24p.avi -ovc lavc -lavcopts vcodec=mpeg2video:vbitrate=3000 -nosound -of mpeg -mpegopts format=dvd:tsaf:telecine -ofps 24000/1001 -o output.mpg

What the above will do is make the 23.976fps input seem as if it's encoded at 30000/1001. The output is still progressive, but with a soft-telecine flag set so a NTSC DVD player will handle it correctly.

When played back by mplayer, it will correctly recognize the soft-telecine and will print a message about switching frame rate.

That's basically the feature I want supported by ffmpeg's telecine filter (if possible). If not, maybe implement it at the muxer level and add an option to flag it as soft-telecined

comment:5 Changed 5 years ago by llogan

  • Summary changed from Inplement a soft-telecine filter to Implement a soft-telecine filter

comment:6 Changed 5 years ago by cehoyos

  • Component changed from avfilter to avformat
  • Keywords mpegps pulldown added
  • Priority changed from normal to wish
  • Reproduced by developer set
  • Status changed from new to open
  • Version changed from unspecified to git-master

comment:7 Changed 3 years ago by electron.rotoscope

The relevant code in mencoder seems to be lines 2468 - 2491 of \libmpdemux\muxer_mpeg.c in today's tarball and they used the code from DGPulldown which is a GPL program. The code in mencoder starts with: /* excerpt from DGPulldown Copyright (C) 2005-2006, Donald Graft */
I think it would be useful to add this feature to all MPEG-2 encoding, not just MPEG-PS, as some authoring programs only take raw .m2v files. I know this is possible, DGPulldown can add the flags after the fact as a separate process.

comment:8 Changed 3 years ago by cehoyos

  • Cc electron.rotoscope added
  • Keywords mpeg2video added

I removed both attachments because their license is not compatible with the relevant files from FFmpeg (LGPL vs GPL). Both can be found easily.
If you are interested in this feature but cannot supply a patch, maybe attach two short m2v samples that show the difference with similar / identical content? Ideally by encoding with FFmpeg and later changing the output file as explained in your post.

Changed 3 years ago by electron.rotoscope

original m2v encoded from ffmpeg

Changed 3 years ago by electron.rotoscope

ffmpeg encode after running through dgpulldown

comment:9 Changed 3 years ago by electron.rotoscope

Original and modified file now attached as suggested. I've just checked and the file without the flag will not import into a DVD authoring program, the file with the flag will.

I notice that DGPulldown changes what MediaInfo? calls "Time code of first frame" from 00:00:00:00 to 00:00:00;00, but as far as I know this is NOT necessary for DVD authoring.

comment:10 Changed 2 years ago by dpury

+1 for this enhancement

Note: See TracTickets for help on using tickets.