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.

 

Go Back   Doom9's Forum > Video Encoding > New and alternative video codecs

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th November 2008, 12:44   #5001  |  Link
tal.aloni
Registered User
 
Join Date: Sep 2008
Posts: 496
Quote:
Originally Posted by haruhiko_yamagata View Post
Shouldn't the last 4 be 3?
Oops, Sorry about that.

Here is an updated patch:
http://iknowu.net/files/public/ffdsh...-BGR24-RC2.zip

build:
http://iknowu.net/files/public/ffdsh...-BGR24-RC2.exe

Last edited by tal.aloni; 11th November 2008 at 12:54.
tal.aloni is offline   Reply With Quote
Old 11th November 2008, 13:16   #5002  |  Link
STaRGaZeR
4:2:0 hater
 
Join Date: Apr 2008
Posts: 1,302
Quote:
Originally Posted by haruhiko_yamagata View Post
More MPEG-2 files than I have expected have wrong flags. In my opinion, the flags are not reliable "at all".
In H.264 flags are much more reliable, but still there are some files that have wrong flags (rare, ignorable).
It's just my opinion, discussion is welcome.
That's why I was suggesting an option that works "agressively", flagging everything that we're not sure it's progressive: every MPEG-2 stream without Progressive_sequence=1 (the only reliable method) would get the flags, and all PAFF/MBAFF streams in H.264 will get them too. What do you guys think? Would this be 100% reliable, even if we flag some progressive material as interlaced?
__________________
Specs, GTX970 - PLS 1440p@96Hz
Quote:
Originally Posted by Manao View Post
That way, you have xxxx[p|i]yyy, where xxxx is the vertical resolution, yyy is the temporal resolution, and 'i' says the image has been irremediably destroyed.
STaRGaZeR is offline   Reply With Quote
Old 11th November 2008, 13:43   #5003  |  Link
haruhiko_yamagata
Registered User
 
Join Date: Feb 2006
Location: Japan
Posts: 1,560
Quote:
Originally Posted by STaRGaZeR View Post
That's why I was suggesting an option that works "agressively", flagging everything that we're not sure it's progressive: every MPEG-2 stream without Progressive_sequence=1 (the only reliable method) would get the flags,
Currently, libmpeg2 in ffdshow does this except if the pictures has "repeat first field flag" + "Picture" progressive flag and it indicates telecined film.
libavcodec flags progressive if "Picture" progressive flag is set.
libmpeg2 works better for me, but as tal.aloni has pointed, my samples have been gathered from weird places.
Quote:
and all PAFF/MBAFF streams in H.264 will get them too.
This is wrong. H.264 has better flags: "Picture timing SEI message", which I submitted a patch to (and now part of) FFmpeg.
Quote:
What do you guys think? Would this be 100% reliable, even if we flag some progressive material as interlaced?
There is no reliable method, especially for MPEG-2.
__________________
[ Download ffdshow | Wiki ]
haruhiko_yamagata is offline   Reply With Quote
Old 11th November 2008, 14:19   #5004  |  Link
clsid
*****
 
Join Date: Feb 2005
Posts: 5,643
Haruhiko, could you update our copy of libswscale? There have been lots of changes to it in the past few months, including several bug fixes. There is some custom code in it from you, and you know about the code than the other devs.
__________________
MPC-HC 2.1.7.2
clsid is offline   Reply With Quote
Old 11th November 2008, 14:24   #5005  |  Link
Snowknight26
Registered User
 
Join Date: Aug 2007
Posts: 1,430
Quote:
Originally Posted by tal.aloni View Post
That's how it was at rev. 2222 too (the oldest one I have), and this is how it should work as far as I know, I think it's better this way.
Would it be possible to reimplement? I find it useful on occasion.
Snowknight26 is offline   Reply With Quote
Old 11th November 2008, 14:47   #5006  |  Link
haruhiko_yamagata
Registered User
 
Join Date: Feb 2006
Location: Japan
Posts: 1,560
Quote:
Originally Posted by tal.aloni View Post
Code:
        case FF_CSP_BGR24 :
                safe_packed_conv(
                        (uint8_t*)src, src_stride, image->y, image->u, image->v,
                        edged_width, edged_width2, width, height,
                        interlacing?(jpeg?TpackedFuncPtrRGB<JPEG>::rgbi_to_yv12:TpackedFuncPtrRGB<CCIR>::abgri_to_yv12)  :(jpeg?TpackedFuncPtrRGB<JPEG>::abgr_to_yv12:TpackedFuncPtrRGB<CCIR>::rgb_to_yv12),
                        interlacing?(jpeg?TpackedFuncPtrRGB<JPEG>::rgbi_to_yv12_c:TpackedFuncPtrRGB<CCIR>::abgri_to_yv12_c):(jpeg?TpackedFuncPtrRGB<JPEG>::abgr_to_yv12_c:TpackedFuncPtrRGB<CCIR>::rgb_to_yv12_c), 3);
Shouldn't some abgr be rgb?

By the way, I found a mess.
FF_CSP_RGB24 = PIX_FMT_BGR24
FF_CSP_RGB32 = PIX_FMT_BGR32
RGB and BGR is upside down in ffdshow. FF_CSP seems to be wrong.
Of course this is not related to your patch.
__________________
[ Download ffdshow | Wiki ]
haruhiko_yamagata is offline   Reply With Quote
Old 11th November 2008, 14:47   #5007  |  Link
yesgrey
Registered User
 
Join Date: Sep 2004
Posts: 1,295
I have updated my ffdshow to rev 2301.
Two things:
1-The "Process frames flagged as progressive" check box only works when the "Deinterlacing" check box is checked, right?
If it's this way, I think it should be placed inside the "Deinterlacing" group box, and not side-by-side with the "Deinterlacing" word over the group box line...
2-In the Presets dialog, when we rename a preset there is a little bug. We cannot change the case of a word. I have created a "dvd" preset, then I wanted to change it to "DVD" but it always appeared as "dvd". I renamed it to "ddd" and then to "DVD", and then it accepted it.
yesgrey is offline   Reply With Quote
Old 11th November 2008, 14:54   #5008  |  Link
STaRGaZeR
4:2:0 hater
 
Join Date: Apr 2008
Posts: 1,302
Quote:
Originally Posted by haruhiko_yamagata View Post
Currently, libmpeg2 in ffdshow does this except if the pictures has "repeat first field flag" + "Picture" progressive flag and it indicates telecined film.
libavcodec flags progressive if "Picture" progressive flag is set.
libmpeg2 works better for me, but as tal.aloni has pointed, my samples have been gathered from weird places.
Yes, this is good as it is (libmpeg2 I mean). libavcodec should have it too, don't you think?

Quote:
Originally Posted by haruhiko_yamagata View Post
This is wrong. H.264 has better flags: "Picture timing SEI message", which I submitted a patch to (and now part of) FFmpeg.
Yes, but picture timing SEI messages can also be wrong, and that means problems. Take a look at "anixe.hd.ts" in the x264 site. The beggining is interlaced, but the SEI indicates it's progressive, so it doesn't get any deinterlacing. And this stream is actually broadcasted, not a weird one to test the decoder decisions, so anybody that watch that channel or a similar one will encounter problems if you go by the the SEI.

Quote:
Originally Posted by haruhiko_yamagata View Post
There is no reliable method, especially for MPEG-2.
I agree, everything can be bad flagged. But the goal is to find the most reliable method. In MPEG-2 it's progressive_sequence, that is good as it is now in libmpeg2. But for H.264 the SEI messages, while more detailed and reliable than MPEG-2 flags, are not 100% reliable either. You can do nothing if interlaced material is not flagged as PAFF/MBAFF, but you can guarantee that if the stream has PAFF/MBAFF identifiers is because there is interlaced video at some point, and thus flagging all of them will solve 99,999999% of the issues. What I suggest is a separate option like "Force bob", not to include this in the auto detection method, just to clarify.
__________________
Specs, GTX970 - PLS 1440p@96Hz
Quote:
Originally Posted by Manao View Post
That way, you have xxxx[p|i]yyy, where xxxx is the vertical resolution, yyy is the temporal resolution, and 'i' says the image has been irremediably destroyed.

Last edited by STaRGaZeR; 11th November 2008 at 14:57.
STaRGaZeR is offline   Reply With Quote
Old 11th November 2008, 15:02   #5009  |  Link
tal.aloni
Registered User
 
Join Date: Sep 2008
Posts: 496
Quote:
Originally Posted by haruhiko_yamagata View Post
Shouldn't some abgr be rgb?
You are correct,
here is an updated patch:
http://iknowu.net/files/public/ffdsh...-BGR24-RC3.zip

Quote:
Originally Posted by haruhiko_yamagata View Post
By the way, I found a mess.
Yea, it is a mess, RGB was already called BGR,
so I called the BGR routines RGB.

I can "make it right", if you prefer it that way, but it will be a very long patch, and it would change dozens of files.
(at first that's what I did, but when I saw the magnitude of the change, I was afraid it won't be accepted)


Tal

Last edited by tal.aloni; 11th November 2008 at 15:30.
tal.aloni is offline   Reply With Quote
Old 11th November 2008, 15:47   #5010  |  Link
haruhiko_yamagata
Registered User
 
Join Date: Feb 2006
Location: Japan
Posts: 1,560
Quote:
Originally Posted by tal.aloni View Post
Yea, it is a mess, RGB was already called BGR,
so I called the BGR routines RGB.

I can "make it right", if you prefer it that way, but it will be a very long patch, and it would change dozens of files.
(at first that's what I did, but when I saw the magnitude of the change, I was afraid it won't be accepted)
Sooner or later, we have to fix it.
Please wait, not now, as I'm updating libswscale.
It would cause too much conflicts with my local copy.
__________________
[ Download ffdshow | Wiki ]
haruhiko_yamagata is offline   Reply With Quote
Old 11th November 2008, 15:53   #5011  |  Link
tal.aloni
Registered User
 
Join Date: Sep 2008
Posts: 496
Quote:
Originally Posted by haruhiko_yamagata View Post
FF_CSP seems to be wrong.
you are right, it is the FF_CSP that's wrong, see here:

Code:
struct TimgExportBMP :public TimgExport
  {
   virtual int requiredCSP() {return FF_CSP_RGB24|FF_CSP_FLAGS_VFLIP;}
BMP is actually BGR24.

Code:
struct TimgExportPNG :public TimgExportLibavcodec
  {
   virtual int requiredCSP() {return FF_CSP_BGR24;}
PNG is actually RGB24.

Quote:
Please wait, not now, as I'm updating libswscale.
OK.

Tal

Last edited by tal.aloni; 11th November 2008 at 16:19.
tal.aloni is offline   Reply With Quote
Old 11th November 2008, 16:33   #5012  |  Link
DigitalDeviant
Registered User
 
DigitalDeviant's Avatar
 
Join Date: Sep 2003
Posts: 267
Quote:
Originally Posted by DigitalDeviant View Post
I have a sample here with a few interlaced frames that don't seem to be getting flagged as interlaced. They appear to be flagged correctly in DGIndex.

sample
Sorry to bump but can anyone tell me if this is a ffdshow bug, an operator bug or is there something wrong with the stream?
__________________
"Do everything by hand, even when using the computer." - Hayao Miyazaki
DigitalDeviant is offline   Reply With Quote
Old 11th November 2008, 16:57   #5013  |  Link
tal.aloni
Registered User
 
Join Date: Sep 2008
Posts: 496
Quote:
Originally Posted by DigitalDeviant View Post
Sorry to bump but can anyone tell me if this is a ffdshow bug, an operator bug or is there something wrong with the stream?
None of my Auto-Deinterlacers (software / hardware) deinterlaced this stream properly, so it must be a badly flagged stream.
tal.aloni is offline   Reply With Quote
Old 11th November 2008, 16:59   #5014  |  Link
DigitalDeviant
Registered User
 
DigitalDeviant's Avatar
 
Join Date: Sep 2003
Posts: 267
Quote:
Originally Posted by tal.aloni View Post
None of my Auto-Deinterlacers (software / hardware) deinterlaced this stream properly, so it must be a badly flagged stream.
I run it through DGIndex and it looks like the interlaced frames are flagged as interlaced though. I don't know a better way to check.
__________________
"Do everything by hand, even when using the computer." - Hayao Miyazaki
DigitalDeviant is offline   Reply With Quote
Old 11th November 2008, 19:52   #5015  |  Link
STaRGaZeR
4:2:0 hater
 
Join Date: Apr 2008
Posts: 1,302
Quote:
Originally Posted by DigitalDeviant View Post
I run it through DGIndex and it looks like the interlaced frames are flagged as interlaced though. I don't know a better way to check.
DGIndex is correct. Deinterlacers need a small amount of time to start deinterlacing. If you have only 2 interlaced frames between progressive frames like this sample, they probably won't get deinterlaced because deinterlacers don't have time to start. This is one of the reasons to add that option I've been talking about in my last posts. It would consider all frames of that stream as interlaced (progressive_sequence is 0), avoiding those changes between prog-int. You'd loss a bit of detail though. It would be your choice to activate it or not.

For MPEG2 --> Everything that is not progressive_sequence=1 (even if it is soft telecined, at some point it may have interlaced frames like that sample).
For H.264 --> Every PAFF/MBAFF stream, regardless of picture timing SEI.
For VC-1 --> I can't find the specification.

I really think lots of people would find this option useful. A more refined "force bob" and "Process frames flagged as progressive".
__________________
Specs, GTX970 - PLS 1440p@96Hz
Quote:
Originally Posted by Manao View Post
That way, you have xxxx[p|i]yyy, where xxxx is the vertical resolution, yyy is the temporal resolution, and 'i' says the image has been irremediably destroyed.
STaRGaZeR is offline   Reply With Quote
Old 11th November 2008, 19:59   #5016  |  Link
tal.aloni
Registered User
 
Join Date: Sep 2008
Posts: 496
Quote:
Originally Posted by STaRGaZeR View Post
DGIndex is correct.
I don't believe that the video is flagged correcly, If you claim it is, please introduce me to the tools who shows this information.

Quote:
Originally Posted by STaRGaZeR View Post
Deinterlacers need a small amount of time to start deinterlacing
That's not true, many deinterlacers (linear blending for example) will deinterlace immediately.

Last edited by tal.aloni; 11th November 2008 at 20:03.
tal.aloni is offline   Reply With Quote
Old 11th November 2008, 20:30   #5017  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by tal.aloni View Post
I don't believe that the video is flagged correcly, If you claim it is, please introduce me to the tools who shows this information.


That's not true, many deinterlacers (linear blending for example) will deinterlace immediately.
Any proper deinterlacer should be able to deinterlace immediately. Even a "smart" deinterlacer/bobber should be able to do so.
In the very first frame, when there's no previous frame to compare against, simply all pixels need to be interpolated...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 11th November 2008 at 20:35.
LoRd_MuldeR is offline   Reply With Quote
Old 11th November 2008, 21:09   #5018  |  Link
DigitalDeviant
Registered User
 
DigitalDeviant's Avatar
 
Join Date: Sep 2003
Posts: 267
Quote:
Originally Posted by tal.aloni View Post
I don't believe that the video is flagged correcly, If you claim it is, please introduce me to the tools who shows this information..
I used DGindex's preview to step through the stream and the frames that show interlacing were reported in the information window as interlaced. Is there something incorrect with this?
__________________
"Do everything by hand, even when using the computer." - Hayao Miyazaki
DigitalDeviant is offline   Reply With Quote
Old 11th November 2008, 21:55   #5019  |  Link
tal.aloni
Registered User
 
Join Date: Sep 2008
Posts: 496
Quote:
Originally Posted by DigitalDeviant View Post
Is there something incorrect with this?
Yes, here DGIndex clearly shows that there many interlaced frames flagged as progressive:
http://iknowu.net/files/public/ffdsh...rePulldown.jpg

Quote:
Originally Posted by LoRd_MuldeR View Post
Any proper deinterlacer should be able to deinterlace immediately. Even a "smart" deinterlacer/bobber should be able to do so.
Well, all of the deinterlacers in ffdshow gets the matching "interlaced flag" with the destined frame.
I'm not familiar with any delayed deinterlacing issue, and I think we have none.

Quote:
Deinterlacers need a small amount of time to start deinterlacing. If you have only 2 interlaced frames between progressive frames like this sample, they probably won't get deinterlaced because deinterlacers don't have time to start.
Wrong. Kernel bob / Linear Blending (which are the ones I use) will be applied immediately,
again, I'm pretty sure most of the others will too, but I'm not familiar with them.

Last edited by tal.aloni; 11th November 2008 at 22:30.
tal.aloni is offline   Reply With Quote
Old 11th November 2008, 22:28   #5020  |  Link
DigitalDeviant
Registered User
 
DigitalDeviant's Avatar
 
Join Date: Sep 2003
Posts: 267
Wow, that's not what I get. http://img517.imageshack.us/img517/5601/bad1el0.png

I also checked it ignoring the pulldown flags since I thought that was closer to the behavior of ffdshow anyway and still it came out as interlaced http://img517.imageshack.us/img517/8388/bad2wo8.png

I wonder what the discrepancy is since the version of DGindex I'm using seems to get it right?
__________________
"Do everything by hand, even when using the computer." - Hayao Miyazaki
DigitalDeviant is offline   Reply With Quote
Reply

Tags
ffdshow, ffdshow tryouts, ffdshow-mt, ffplay, icl

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.