Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se |
|
|
#1 | Link |
|
Registered User
Join Date: Feb 2021
Posts: 2
|
Reading 4:2:0 (PAL) interlaced video with ffmpeg
I have an MKV file with MPEG2 content from a PAL DVD, so it's 4:2:0. I can read it into AviSynth+ using FFMPEGSource2, so ffmpeg is used. Each interlaced field is a separate image, with two images per frame.
Some scenes cut in the middle of a frame, so the first field of that frame is from one scene and the second field from the next. It looks like ffmpeg is decoding both 4:2:0 fields and combining them into a 4:2:0 frame. 4:2:0 Chroma subsampling shares the colour information across two rows, so now the even and odd rows share their colours, and there's no way to cleanly separate the fields. In the source file, each field is separate so they don't have this issue, but I can't make ffmpeg avoid this problem. I've tried: ffmpeg -i src.mkv -flags +ilme+ildct -pix_fmt yuv422p10le src-422.mp4 to upgrade to 4:2:2 subsampling (which doesn't share chroma across rows) but it still has the same problem. Seems like ffmpeg has no way read interlaced 4:2:0 content without smudging the chroma across the fields. Any suggestions? My current work-around is to re-encode the file into a 4:2:2 format using the Adobe Media Encoder, and this works fine, but it's harder to automate. I've tried using VirtualDub2 but, of course, it has the same problem as AviSynth+. |
|
|
|
|
|
#3 | Link | |
|
.
![]() Join Date: Oct 2001
Location: Germany
Posts: 7,853
|
Quote:
try: Code:
-flags +ilme+ildct -x264opts tff=1 |
|
|
|
|
|
|
#4 | Link |
|
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,406
|
Is this not the type of thing where DGIndex/DgDecode.dll::[ Mpeg2Source() ] + Tfm() is of use,
Code:
VideoFileName=".\test.mpg" Video = Mpeg2Source(VideoFileName) Video = Video.TFM(d2v=VideoFileName) # + other TFM args. EDIT: And LSmashVideoSource all of the time for ISO files eg x264 mp4. EDIT: From TIVTC::TFM docs. Code:
A.) GENERAL INFO:
Supports 8-16 bit Y, planar YUV (4:1:1, 4:2:0, 4:2:2, 4:4:4) and YUY2 colorspaces.
TFM is a field matching filter that recovers the original progressive frames from a
telecined stream. It does not decimate the resulting duplicate frames though, so to
achieve an ivtc you must follow TFM with a decimation filter such as TDecimate(), which
is also included in the TIVTC dll.
syntax=>
TFM(int order, int field, int mode, int PP. string ovr, string input, string output,
string outputC, bool debug, bool display, int slow, bool mChroma, int cNum,
int cthresh, int MI, bool chroma, int blockx, int blocky, int y0, int y1,
int mthresh, PClip clip2, string d2v, int ovrDefault, int flags, double scthresh,
int micout, int micmatching, string trimIn, int hint, int metric, bool batch,
bool ubsco, bool mmsco, int opt)
While TFM does have quite a few parameters, I have tried to categorize the settings so
they are easier to manage. Really there are only 3 parameters most users should be
concerned about knowing or ever setting. They are "order", "mode", and "PP" and are
described under the "BASIC PARAMETERS" sections. The other settings are described under
the other various sections which should be pretty easy to figure out from the names.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 19th January 2026 at 17:53. |
|
|
|
![]() |
| Tags |
| ffmpeg, interlaced, interlaced video, pal |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|