Cypheros Multimedia Forum

English-speaking Support => TS-Doctor 1.2 => Thema gestartet von: DragonQ am April 20, 2012, 18:42:01

Titel: Change/force interlaced flags?
Beitrag von: DragonQ am April 20, 2012, 18:42:01
Is there a way to force/set interlaced flags in a TS stream using TS-Doctor? If not, is there another tool that will do this?

I have a TS file that is treated as progressive but is actually interlaced, thus it shows combing. I can't find a tool to fix this without re-encoding. :(


Thanks.
Titel: Re: Change/force interlaced flags?
Beitrag von: Cypheros am April 20, 2012, 20:24:08
Is it a MPEG2 or H264 video stream? 
Titel: Re: Change/force interlaced flags?
Beitrag von: DragonQ am April 20, 2012, 20:34:26
H.264

I have two tools that can do this for MPEG2 but I've tried about 10 H.264/TS tools so far after Googling but none let me do it. ProjectX seems to have the option for it but I can never get that program to work - it throws up loads of errors when I try to demux TS files (GOPs being over 6 MB, for example).
Titel: Re: Change/force interlaced flags?
Beitrag von: Cypheros am April 20, 2012, 23:32:19
ProjectX can't process H264, MPEG only.

Never had a wrong flagged H264 stream. The problem is that the sequence parameter set, where you can find the interlace flag, is encoded. If you want to change one bit, the size of the sequence parameter set will change too and you have to replace the whole sequence parameter set.

Are you sure that's wrong flagged? Do you have a short sample (10-20 MB) ?
Titel: Re: Change/force interlaced flags?
Beitrag von: DragonQ am April 21, 2012, 00:52:23
Well the programme is interlaced but it has some footage of another programme in it, which is progressive. If I use TSMuxer to cut out a bit that's 100% interlaced, it's then detected as interlaced (MBAFF) by MediaInfo and is deinterlaced correctly in MPC-HC. However, the original full-length video, which has a mixture of progressive and interlaced, is never deinterlaced. O_o

If I cut out any part starting with an interlaced bit, the whole video is treated as interlaced. If I cut out a part starting with a progressive bit (as the original video does), the whole thing is treated as progressive.

Maybe the MBAFF encoding is dodgy somehow? I have a few other recordings of this show that work perfectly. :/

Muxing to TS, M2TS and MKV always produces the same effect. The only way I've found to play the file properly is to play the original TS but force MadVR deinterlacing on. This means the progressive scenes are unnecessarily deinterlaced but it still plays fine.

EDIT: Here's a sample (http://www.mediafire.com/?cd8jxvr8m66ta15). 00:00 - 00:16 is progressive, 00:17 - 00:44 is interlaced.
Titel: Re: Change/force interlaced flags?
Beitrag von: Cypheros am April 21, 2012, 19:38:09
ES  WARNING: H264 video resolution info changed at -00:03:12.870
             from 1440x1088, Progressiv / 25 fps / High@4.0 / ColourPrimaries=BT.709, TransferCharacteristics=BT.709, MatrixCoefficients=BT.709
             to   1440x1088, Interlaced / 25 fps / High@4.0 / ColourPrimaries=BT.709, TransferCharacteristics=BT.709,
You can see the changing flags in the log of the TS-Doctor:

ZitatMatrixCoefficients=BT.709
ES  WARNING: H264 video resolution info changed at -00:03:12.870
             from 1440x1088, Interlaced / 25 fps / High@4.0 / ColourPrimaries=BT.709, TransferCharacteristics=BT.709, MatrixCoefficients=BT.709
             to   1440x1088, Progressiv / 25 fps / High@4.0 / ColourPrimaries=BT.709, TransferCharacteristics=BT.709, MatrixCoefficients=BT.709
ES  WARNING: H264 video resolution info changed at -00:03:12.870
             from 1440x1088, Progressiv / 25 fps / High@4.0 / ColourPrimaries=BT.709, TransferCharacteristics=BT.709, MatrixCoefficients=BT.709
             to   1440x1088, Interlaced / 25 fps / High@4.0 / ColourPrimaries=BT.709, TransferCharacteristics=BT.709, MatrixCoefficients=BT.709

At the moment I have no idea how to fix that.
Titel: Re: Change/force interlaced flags?
Beitrag von: DragonQ am April 21, 2012, 20:36:28
Hmm so the stream does properly change flags. Maybe it's an issue with LAV or MadVR then? :/

EDIT: Just tried the file with EVR and it works fine. Progressive parts are shown as 25p, interlaced parts are deinterlaced to 50p. Must be a MadVR bug! I'll ask madshi about it, thanks for having a look at the flags.