zee944
6th May 2010, 20:02
LoadPlugin("PlaneMinMax[0.3.0.19].dll") # for calculating average Y, U, V
AVISource("sample.avi")
ConvertToYV12
tweaked01=last.ColorYUV(off_y=-20, off_u=+12, off_v=-3)
tweaked02=last.ColorYUV(off_y=+11, off_u=+10, off_v=-11)
tweaked03=last.ColorYUV(off_y=+2, off_u=-2, off_v=-11)
tweaked01
last = PlaneUAvg("YAvg")
last = PlaneUAvg("UAvg")
last = PlaneVAvg("VAvg")
ScriptClip("""Subtitle("Yavg: "+String(YAvg)+"", x=48, y=110, text_color=$00FF00)""")
ScriptClip("""Subtitle("Uavg: "+String(UAvg)+"", x=48, y=130, text_color=$00FF00)""")
ScriptClip("""Subtitle("Vavg: "+String(VAvg)+"", x=48, y=150, text_color=$00FF00)""")
WriteFile("stat.txt", "Yavg", """ " #tweaked01 Y channel average" """, append=true)
WriteFile("stat.txt", "Uavg", """ " #tweaked01 U channel average" """, append=true)
WriteFile("stat.txt", "Vavg", """ " #tweaked01 V channel average" """, append=true)
tweaked02
last = PlaneUAvg("YAvg")
last = PlaneUAvg("UAvg")
last = PlaneVAvg("VAvg")
ScriptClip("""Subtitle("Yavg: "+String(YAvg)+"", x=48, y=110, text_color=$00FF00)""")
ScriptClip("""Subtitle("Uavg: "+String(UAvg)+"", x=48, y=130, text_color=$00FF00)""")
ScriptClip("""Subtitle("Vavg: "+String(VAvg)+"", x=48, y=150, text_color=$00FF00)""")
WriteFile("stat.txt", "Yavg", """ " #tweaked02 Y channel average" """, append=true)
WriteFile("stat.txt", "Uavg", """ " #tweaked02 U channel average" """, append=true)
WriteFile("stat.txt", "Vavg", """ " #tweaked02 V channel average" """, append=true)
tweaked03
last = PlaneUAvg("YAvg")
last = PlaneUAvg("UAvg")
last = PlaneVAvg("VAvg")
ScriptClip("""Subtitle("Yavg: "+String(YAvg)+"", x=48, y=110, text_color=$00FF00)""")
ScriptClip("""Subtitle("Uavg: "+String(UAvg)+"", x=48, y=130, text_color=$00FF00)""")
ScriptClip("""Subtitle("Vavg: "+String(VAvg)+"", x=48, y=150, text_color=$00FF00)""")
WriteFile("stat.txt", "Yavg", """ " #tweaked03 Y channel average" """, append=true)
WriteFile("stat.txt", "Uavg", """ " #tweaked03 U channel average" """, append=true)
WriteFile("stat.txt", "Vavg", """ " #tweaked03 V channel average" """, append=true)
I have different clips within an AviSynth script. I want to create statistics for all of them, calculating out the average Y, U, V values and put it into a text file. (Basically I want the same thing ColorYUV(analyze=True) shows me, but I need it as plain text data.)
The problem is that I can only save the statistics of ONE clip at the time. I want to save the data of all the three (or more) clips! In the example above, I try to save the statistics of tweaked01, tweaked02 and tweaked03. But only the results of 'tweaked01' is being put in stat.txt. Why? I can see that it's probably because I switch between video clips and only the last one which matters (only the last one will be displayed by the script too), but I've no idea for a workaround. Probably it would work if I could get the values with a function like RGBDifference() within the WriteFile line, but it doesn't seem to be possible. Perhaps it isn't possible with this PlaneMinMax plugin, but possible with something else? Please help! :confused:
AVISource("sample.avi")
ConvertToYV12
tweaked01=last.ColorYUV(off_y=-20, off_u=+12, off_v=-3)
tweaked02=last.ColorYUV(off_y=+11, off_u=+10, off_v=-11)
tweaked03=last.ColorYUV(off_y=+2, off_u=-2, off_v=-11)
tweaked01
last = PlaneUAvg("YAvg")
last = PlaneUAvg("UAvg")
last = PlaneVAvg("VAvg")
ScriptClip("""Subtitle("Yavg: "+String(YAvg)+"", x=48, y=110, text_color=$00FF00)""")
ScriptClip("""Subtitle("Uavg: "+String(UAvg)+"", x=48, y=130, text_color=$00FF00)""")
ScriptClip("""Subtitle("Vavg: "+String(VAvg)+"", x=48, y=150, text_color=$00FF00)""")
WriteFile("stat.txt", "Yavg", """ " #tweaked01 Y channel average" """, append=true)
WriteFile("stat.txt", "Uavg", """ " #tweaked01 U channel average" """, append=true)
WriteFile("stat.txt", "Vavg", """ " #tweaked01 V channel average" """, append=true)
tweaked02
last = PlaneUAvg("YAvg")
last = PlaneUAvg("UAvg")
last = PlaneVAvg("VAvg")
ScriptClip("""Subtitle("Yavg: "+String(YAvg)+"", x=48, y=110, text_color=$00FF00)""")
ScriptClip("""Subtitle("Uavg: "+String(UAvg)+"", x=48, y=130, text_color=$00FF00)""")
ScriptClip("""Subtitle("Vavg: "+String(VAvg)+"", x=48, y=150, text_color=$00FF00)""")
WriteFile("stat.txt", "Yavg", """ " #tweaked02 Y channel average" """, append=true)
WriteFile("stat.txt", "Uavg", """ " #tweaked02 U channel average" """, append=true)
WriteFile("stat.txt", "Vavg", """ " #tweaked02 V channel average" """, append=true)
tweaked03
last = PlaneUAvg("YAvg")
last = PlaneUAvg("UAvg")
last = PlaneVAvg("VAvg")
ScriptClip("""Subtitle("Yavg: "+String(YAvg)+"", x=48, y=110, text_color=$00FF00)""")
ScriptClip("""Subtitle("Uavg: "+String(UAvg)+"", x=48, y=130, text_color=$00FF00)""")
ScriptClip("""Subtitle("Vavg: "+String(VAvg)+"", x=48, y=150, text_color=$00FF00)""")
WriteFile("stat.txt", "Yavg", """ " #tweaked03 Y channel average" """, append=true)
WriteFile("stat.txt", "Uavg", """ " #tweaked03 U channel average" """, append=true)
WriteFile("stat.txt", "Vavg", """ " #tweaked03 V channel average" """, append=true)
I have different clips within an AviSynth script. I want to create statistics for all of them, calculating out the average Y, U, V values and put it into a text file. (Basically I want the same thing ColorYUV(analyze=True) shows me, but I need it as plain text data.)
The problem is that I can only save the statistics of ONE clip at the time. I want to save the data of all the three (or more) clips! In the example above, I try to save the statistics of tweaked01, tweaked02 and tweaked03. But only the results of 'tweaked01' is being put in stat.txt. Why? I can see that it's probably because I switch between video clips and only the last one which matters (only the last one will be displayed by the script too), but I've no idea for a workaround. Probably it would work if I could get the values with a function like RGBDifference() within the WriteFile line, but it doesn't seem to be possible. Perhaps it isn't possible with this PlaneMinMax plugin, but possible with something else? Please help! :confused: