View Full Version : compare mpeg-ts files?
challanger
23rd February 2012, 00:49
Hi,
I'm trying to measure video quality with PNSR stuff between different codecs.I can use compare function for this easly I know ,but i have a problem with mpeg-ts.I can compare avi and mp4 files like this
clip1=AviSource("C:\Examples\c1.avi")
clip2=DirectShowSource("C:\Examples\c2.mp4")
Compare(clip1, clip2,"YUV","compare.log")
But when I try to compare mpeg-ts files with DirectShowsource function I recive an error message like "clips are not same color spaces".
So what is the problem ?what changes with .ts files?
StainlessS
23rd February 2012, 05:17
Both clips need to be same colorspace, size etc, try eg below to ascertain what they actually are.
Return AviSource("C:\Examples\c1.avi").Info()
Then see eg ConvertToYV12(), etc, (Comparing differing colorspaces via conversion will result in a less than good comparison)
Or Better, In DirectShowSource, use arg, Pixel_type="YV12"
"pixel_type" can be "YV12", "YUY2", "ARGB", "RGB32", "RGB24", "YUV", "RGB", in v2.56
Probably best to see results from MediaInfo tool (google) and not to use DirectShowSource if possible.
If common colorspace not found, then perhaps better to convert the original source clip to the same
colorspace as the resultant encode (as that is what would have been done anyway during encode).
challanger
23rd February 2012, 15:11
Thanks for answer..
Yes u are right,I couldnt see the colorspace information with mediainfo but .info arg shows it
I used pixel_type arg like u say.My first clip was YUY2 and second was YV12..I can do YV12-->YUY2 (clip1=DirectShowSource("C:Examples\x.mp4,Pixel_type="YUY2"")) and compare them but
when I try to YUY2 --> YV12 it fails with this error
http://s5.postimage.org/e7n7jy0sn/ASDDDD.jpg
Why does it failed?
ANd Is color space conversation will affect to my results? I dont need a specific color space information just correct results are essential.
StainlessS
23rd February 2012, 15:59
Arh yes, some clips just show 'YUV' in MediaInfo.
"I dont need a specific color space information just correct results are essential."
Well if your source (AVI) was YUY2 and was converted to YV12 during encode, should (I think)
not be a problem to convert the AVI to YV12 and compare with that, that would take into account
the colorspace conversion during encode and show difference due to the encode only.
original=AviSource("C:\Examples\c1.avi").ConvertToYV12() # original
filtered=DirectShowSource("C:\Examples\c2.mp4") # filtered
Compare(filtered, original,"compare.log") # YUV is default if YUV clips and not used as arg.
If you would prefer to see difference including colorspace conversion then perhaps:
original=AviSource("C:\Examples\c1.avi") # original
filtered=DirectShowSource("C:\Examples\c2.mp4").ConvertToYUY2() # filtered
Compare(filtered, original,"compare.log") # YUV is default if YUV clips and not used as arg.
as YV12->YUY2 should (I think) be lossless.
Also see DirectShowSource [Corefilters] in Avisynth docs for problems in DirectShowSource.
challanger
24th February 2012, 01:12
Bad news :)
Results for YV12->YUY2 and YUY2 -> YV12 are different in my test.(values are 38db ,37db) yuy2 and yv12 pixel structures can be a litle diffrent..
Actually I take what I need until now.One more question if u answer i will be pleasure,
These videos have same source and I only changed bitrate value (one of them 500 other is 1000kbps.)for each video during encoding.
But as you can see in picture, there is some diffrences between two video.
http://s5.postimage.org/sj6pouiyv/Ads_z.png
Why this happens?Durations and overall bitrates are different.Which bitrate information is valid for my test?
Thanks again
StainlessS
24th February 2012, 17:03
"Results for YV12->YUY2 and YUY2 -> YV12 are different in my test",
Yes, expected as I said above, you are testing two different things, without/with the colorspace
conversion.
The Video Bitrate is just for the Video Elemental Stream, whereas the Overall Bitrate includes
the extra for packaging it into it's container stream. (EDIT: so in answer to your question,
the Video bitrate is valid for your test.)
Why the clip durations differ?, your guess is as good as mine. Perhaps the container stream
durations are in fixed increments in time and differ from the elemental stream duration which
will be based upon number of frames and FPS. :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.