View Full Version : How to print contents from "info()" to text file
itcth
3rd April 2004, 16:05
I can check file information using "info()" .It show only on left side of screen.Please help me,how to print these information to a text file.
... I try "chr.dll" in conjunction with "Write()" but no luck.
Thnaks,
sh0dan
3rd April 2004, 20:09
Not possible - sorry.
Many of the properties are available as clip properties, though.
stickboy
4th April 2004, 03:23
This should get you started:
function InfoToFile(clip c, string filename)
{
endl = Chr(10)
colorspaceStr = "Colorspace: "
\ + (c.IsYUY2()
\ ? "YUY2"
\ : (c.IsYV12()
\ ? "YV12"
\ : (c.isRGB32()
\ ? "RGB32"
\ : (c.IsRGB24()
\ ? "RGB24"
\ : "Unknown"))))
\ + endl
frameSizeStr = "Frame size: "
\ + String(c.Width()) + "x" + String(c.Height())
\ + endl
fpsStr = "FPS: " + String(c.FrameRate()) + endl
fieldBasedStr = (c.IsFieldBased()
\ ? "field-based (separated)"
\ : "frame-based")
\ + endl
audioStr = "Audio: "
\ + ((c.AudioRate() == 0)
\ ? "none"
\ : (String(c.AudioRate()) + " Hz, "
\ + String(c.AudioBits()) + "-bit, "
\ + String(c.AudioChannels()) + " channels"))
\ + endl
return c.WriteFileStart(filename, "colorspaceStr",
\ "frameSizeStr", "fpsStr",
\ "fieldBasedStr", "audioStr")
}
(There's a bug in AudioBits(); right now it returns bytes per channel, not bits. The script above does not correct for it, since I assume it will be fixed real soon. :) )
Is it useful to have this information in a text file?
itcth
4th April 2004, 04:44
@ stickboy
Thanks a lot.I will try it now.
itcth
4th April 2004, 05:06
@stickboy
With little modification.Your script works great.
Thank again.
sh0dan
4th April 2004, 09:17
AudioBits fixed.
I also added isAudioFloat and isAudioInt to the next version.
itcth
4th April 2004, 17:41
@stickboy
Is it useful to have this information in a text file?
...I use these information from info() to feed information to mencoder to encode to VCD.Mencoder has no ability to find out what frame rate,frame size.Therefore,every time i have to type commandline to introduce frame rate and others infomatiomn to mencoder.With assistant of your script ,i wrote another commandline to read infomation from text file and feed to mencoder.
...Apologize me for my English.It took me long way just to explain a simple need.If in Thai i bet only 2 sentences.
Regards,
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.