View Full Version : File name as text in the frame?
Coon_Dog
12th February 2004, 19:14
Is there a filter, or some way, that I can have the file name of a frame displayed as text?
Or even better have media file (jpeg) information from files displayed on the frames?
Thanks
Coon_Dog
garydude
13th February 2004, 10:04
Info()
Coon_Dog
13th February 2004, 10:26
Info() does not show the file name or any media file information. So it does not help in this situation.
Maybe it would help to say what I need this for. I am importing a bunch of still images to make a slide show. Getting the file name as text on a frame would help in the pre-production. That was when the avi is compressed then sent to someone it would be easy for them to say “such-n-such pic is to dark, lighten it or take it out”.
As for the Media file information. I have a way to put the media file information into the file name. The is needed to show that I do not have the frames in the wrong order (ie time captured).
All of this is to take many pics form a high school function and produce a compressed movie for their web sight.
Currently I am using ShowFrameNumber(). This helps a lot but being able to get more information into each frame would be helpful.
Thanks
Coon Dog
esby
13th February 2004, 15:40
I don't think you can access
the filename origin used for the source...
I doubt the info is present in the structure,
especially if info() is not showing it...
So you can't really track it,
unless someone add it in the structure...
(and add the meaning to feed the info too)
That would mean:
Adding a field to track the frameSource in each frame...
changing in each loader the method to feed the new info...
Adding a function to get this info when you need it.
(very very few usage, you must be the first asking for it)
But but, in a general approach,
we could have some user field linked to each frame...
that the user could define, access and modify.
(eg clip.setFrameSFieldValue(#frame,'MyFieldName','Mynotes')
but again the usefulness is very low...
esby
mf
13th February 2004, 16:18
function GetScriptName()
{
Try
{
assert(false)
}
Catch(err_msg)
{
err_msg = MidStr(err_msg, FindStr(err_msg, "(") + 1)
filename = LeftStr(err_msg, StrLen(err_msg) - FindStr(RevStr(err_msg), ","))
return filename
}
}
last.Subtitle(GetScriptName())
esby
13th February 2004, 16:46
@mf ,
i don't think that will help Coon_dog,
( i ve thought about it :D )
but that will give the scriptname
not the file used to get each frame...
Meaning
if he has a video from
avisource("fileA")
another from
avisource("FileB")
and a third
imageReader("...01-04")
and supposing he add these together,
I think he wants to display "fileA" or "fileB" or "file 03" etc...
which is not possible afik.
(that would mean tagging the frame structure as i supposed)
esby
PS (edit) : that would allow to track down the history of frames,
tracking from which media they comes, which is possible in theory
but not implemented since nobody prolly never asked it before...
And that would imply modifying each data loader...
mf
13th February 2004, 18:48
Completely untested functions, which should, work as follows:
VerboseMediaSource("C:\File.avi", 1)
which will then create vbsfile1 which is C:\File.avi, and vbserr1 which should be empty (cause it's an AVI file, which is the first try).
PrintVerboseMediaSource("C:\File.avi", 1)
which will print out abovementioned variables onto the image.
function VerboseMediaSource(string filename, int ident) {
Try {
AVISource(filename)
}
Catch(err_msg1) {
Try {
MPEG2Source(filename)
}
Catch(err_msg2) {
Try {
DirectShowSource(filename)
}
Catch(err_msg3) {
Try {
ImageReader(filename)
}
Catch(err_msg4) {
Assert(false, "Total failure on all 4 media types! Errors returned were: "+err_msg1+" "+err_msg2+" "+err_msg3+" "+err_msg4)
}
}
}
}
Eval("global vbsfile"+ident+" = filename")
Eval("global vbserrs"+ident+" = err_msg1+err_msg2+err_msg3+err_msg4")
return last
}
function PrintVerboseMediaSource(string filename, int ident) {
VerboseMediaSource(filename, ident)
Subtitle(filename+", "+ident)
}
Oh man, this must be the biggest function I've written in one go without testing it out :). If you don't want the information to appear on the frame itself, use AddBorders() to add a black border above, which you can crop out later.
Coon_Dog
14th February 2004, 16:26
Thanks for all the input from everybody.
The more I thought about it if I had different file names then they would not be able to be loaded with %06d.jpg or something simple like that.
Now I am thinking in a different direction. Can I have a txt file with text for each frame? So that frame 1 has line 1 text overlaid on it, Frame 2 line 2 ... and so on?
(side note) I am really enjoying learning AviSnyth script commands. What I have learned so far has saved me hours of work in Adobe Premier 6. The time saved and Hard Drive space saved! All that and the enjoyment of learning something new!
Now I can undo the RAID I have set up on the spare drives. Or keep it to start getting into video capture :-0
Coon Dog
mf
14th February 2004, 16:43
Out of curiousity I tested it myself anyway. What simple things humans forget! ;)
function VerboseMediaSource(string filename, int ident) {
err_msg1 = ""
err_msg2 = ""
err_msg3 = ""
err_msg4 = ""
Try {
AVISource(filename)
}
Catch(err_msg1) {
Try {
MPEG2Source(filename)
}
Catch(err_msg2) {
Try {
DirectShowSource(filename)
}
Catch(err_msg3) {
Try {
ImageReader(filename)
}
Catch(err_msg4) {
Assert(false, "Total failure on all 4 media types! Errors returned were: "+err_msg1+" "+err_msg2+" "+err_msg3+" "+err_msg4)
}
}
}
}
Eval("global vbsfile"+String(ident)+" = filename")
Eval("global vbserrs"+String(ident)+" = err_msg1+err_msg2+err_msg3+err_msg4")
return last
}
function PrintVerboseMediaSource(string filename, int ident) {
VerboseMediaSource(filename, ident)
Subtitle(filename+", "+String(ident))
}
Though when I enter an erroneous filename, I crash the host app (vdubmod/mpc). Funny how AVISynth reacts when you try strange things :).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.