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 > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 24th December 2005, 12:37   #21  |  Link
medp7060
Registered User
 
Join Date: Jan 2005
Posts: 158
Is it possible to make this filter work with Motion JPEG avi?
medp7060 is offline   Reply With Quote
Old 26th December 2005, 12:49   #22  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,729
Quote:
Originally Posted by WarpEnterprises
After some thought it turned out to be trivial AND general, check it:

http://www.avisynth.org/warpenterprises/#dvinfo
Thanks, I owe you one

I'll try it as soon as I get home from the holidays.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 27th December 2005, 22:41   #23  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
@Wilbert: of course, just forgot the code.
@medp7060: no, it's really DV-specific.
WarpEnterprises is offline   Reply With Quote
Old 3rd February 2006, 18:11   #24  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,729
I'm sorry but I can't get it to work as I want to..

I tried this script:
Code:
video1="i:\dvnauha.avi"
AVISource(video1).DVInfo(video1,"rec_time",fix_format="%d",threshold=1,autoframes=50,font="Arial",x=500,y=500,text_color=$FFFFFF,size=24)
I'd like it to output the date and time when the day of month changes but it doesn't do that. Am I misunderstanding the syntax?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 3rd February 2006, 21:25   #25  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
does it display
- always
- never
- at wrong deltas

You should use a very big threshold (10000) as it starts to display when the jump is bigger than threshold OR the fix_format changes).
Does it display anything if you DON'T use fix_format and set threshold=0 ?
WarpEnterprises is offline   Reply With Quote
Old 3rd February 2006, 22:01   #26  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,729
Quote:
Originally Posted by WarpEnterprises
You should use a very big threshold (10000) as it starts to display when the jump is bigger than threshold OR the fix_format changes)
Thank you, that one fixed it. I thought that threshold was in this case used for determining the fix_format change threshold. It works perfectly
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 31st January 2009, 20:37   #27  |  Link
tacman1123
Registered User
 
Join Date: Jun 2007
Location: Washington, DC
Posts: 130
getting tc_time and rec_time as variables

I'm trying to write a file that shows the frame number, rec_time and tc_time whenever there's a break in the timecode. DVInfo will display that information when the threshold is passed, but I can't figure out how to get it into a variable that I can use.

What I'm looking for is something like
Code:
rec_time = GetDVInfo(file, "rec_time") 
tc_time=GetDVInfo(file, "tc_time")
WriteFile(..."frame_count, rec_time, tc_time)
The other problem I'm having is that even displaying the tc_time and rec_time it's showing up on my files as "No time code" and "no recording date", yet when I put that same file through other programs, I see both. I'd be happy to send my AVI file if that would help debugging.

Thanks!

Tac
tacman1123 is offline   Reply With Quote
Old 31st January 2009, 21:31   #28  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
Which filter-plugin exactly are you talking about?
Mine is dvinfo.dll and the function is "dvinfo".
Please post the hole script.
WarpEnterprises is offline   Reply With Quote
Old 31st January 2009, 21:54   #29  |  Link
tacman1123
Registered User
 
Join Date: Jun 2007
Location: Washington, DC
Posts: 130
This displays "No Record Time":

Code:
LoadPlugin("c:\as\plugins\dvinfo\dvinfo.dll")
filename="c:/avi/p474_090115_064745_000.avi"

DirectShowSource(filename)
DVInfo(filename, "tc_time + chr(32) + rec_time + chr(32) + current_frame")
What I want is a way to get the rec_time and tc_time as variables, then I can do whatever, including creating a file, that has the frame number, timecode and record_time:

Code:
WriteFile(output_filename,   "tc_time + chr(32) + rec_time + chr(32) + current_frame")
Even better would be a way to trigger it based on some threshold, the same logic that dvinfo uses for the threshold, so that what I'd end up with is a file with the timecode breaks.

This would be similar to the scene detection that's used for finding scene changes:

Code:
# creates a csv file of the current frame and YDifference() when YDifferenceFromPrevious is greater than some threshold
threshold=18
a=video
a=a.WriteFileStart(filename, """video_fn + " " + string(threshold)""", append=false)

a=WriteFileIf(a, filename, "YDifferenceFromPrevious() > threshold", "current_frame", """ ":" """, "YDifferenceFromPrevious()")

Last edited by tacman1123; 1st February 2009 at 11:27. Reason: fixed comment in code
tacman1123 is offline   Reply With Quote
Old 1st February 2009, 12:58   #30  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by tacman1123 View Post
What I want is a way to get the rec_time and tc_time as variables, then I can do whatever, including creating a file, that has the frame number, timecode and record_time
Since DVInfo sets tc_time and rec_time as (string) script-level variables, I think this ought to work (haven't tried it though):
Code:
LoadPlugin("c:\as\plugins\dvinfo\dvinfo.dll")
filename="c:/avi/p474_090115_064745_000.avi"
output_filename = " ... "
DirectShowSource(filename)
WriteFile(output_filename, "tc_time", "rec_time", "current_frame")
DVInfo(filename, """ "" """)
WriteFile has to come before DVInfo in the script because of the order in which frames are fetched from the filter chain (as with ScriptClip, etc).

Last edited by Gavino; 1st February 2009 at 14:15. Reason: Use triple-quotes to get empty string for DVInfo
Gavino is offline   Reply With Quote
Old 1st February 2009, 14:55   #31  |  Link
tacman1123
Registered User
 
Join Date: Jun 2007
Location: Washington, DC
Posts: 130
Great, thanks, getting closer now, here's my script:

Code:
LoadPlugin("c:\as\plugins\dvinfo\dvinfo.dll")

filename="p468_090108_074859_437.avi"

tc_filename="timecodes.txt"

DirectShowSource(filename)
WriteFileStart(tc_filename, """ "Frame:Timecode file for " """, """filename""", append=false)

WriteFile(tc_filename, """current_frame""", """ ":" """, """tc_time""")
DVInfo(filename, "tc_time + chr(32) + rec_time + chr(32) + current_frame")
The problem is that I'm not getting the rec_time or tc_time, either in the file or displayed on the screen. I'm certain both are in there, becasue I see them in 2 other other programs I'm using. This is timecodes.txt

Code:
Frame:Timecode file for p468_090108_074859_437.avi
0:no timecode
1:no timecode
2:no timecode
3:no timecode
4:no timecode
5:no timecode
6:no timecode
7:no timecode
8:no timecode
9:no timecode
10:no timecode
11:no timecode
12:no timecode
I think I'm using the most recent DLL:

12/23/2005 07:49 PM 122,880 dvinfo.dll

I've saved the smallest file I could create (about 1.5 Meg, but very short) to

http://entrevistasargentinas.com/p46...074859_437.avi

The dv_date that another library I'm using shows:

tc: 00:00:00 12 dv date: 08/01/09 08:48:21

Is it the file? The codec? Something else? As always, thanks for the help!

Thx,

Tac
tacman1123 is offline   Reply With Quote
Old 8th February 2009, 08:52   #32  |  Link
alexzeit
Registered User
 
Join Date: Jan 2009
Posts: 7
surpress text after missing recording date

Dear All,
Like in the thread above from 3rd February 2006 I'd like to output date and time when the day of month changes. I use:
Code:
DVInfo(file, "rec_time",  size=40, x=40, y=500, rec_format="%d.%m.%Y", autoframes=100, show_error = false, fix_format = "%Y%m%d", threshold=100000)
It works fine except one thing:
In some places I have transitions, and in this places DV does not contain Date/Time information. After such places DVInfo display Date although day of the month was not changed. Is there way to ignore places in DV where date/time information is missing?
alexzeit is offline   Reply With Quote
Old 9th February 2009, 22:32   #33  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 830
@tacman1123: the plugin cannot read the info, I don't know why. Is it made with a HDV-camera?

@alexzeit: try this version:
http://www.avisynth.org/warpenterpri...oremissing.zip
The original version sets the time string to "" when there is no timecode, this version simply does nothing.
WarpEnterprises is offline   Reply With Quote
Old 14th April 2009, 05:26   #34  |  Link
alexzeit
Registered User
 
Join Date: Jan 2009
Posts: 7
surpress text after missing recording date

@WarpEnterprises: Thank you very much the new version works fine.
alexzeit is offline   Reply With Quote
Old 14th April 2009, 12:52   #35  |  Link
tacman1123
Registered User
 
Join Date: Jun 2007
Location: Washington, DC
Posts: 130
Quote:
"the plugin cannot read the info, I don't know why. Is it made with a HDV-camera?"
No, basic SD video camera, Canon ZR500 I think. I know the timecode is there (other programs see it), but I guess its some codec for internal formatting issue.

Do Quicktime MOV files also have DV Timecode info in each frame? Other formats? I'd love to solve this problem, I'm trying to write a script to sync up some data, and having access to the clock time (according to the camera) would be great.

What software do you use for importing a tape via firewire? Maybe the software I'm using isn't writing the right format.

Thx,

Tac
tacman1123 is offline   Reply With Quote
Old 14th April 2009, 16:27   #36  |  Link
JohnnyMalaria
Registered User
 
Join Date: Sep 2006
Posts: 602
I've had a look at the example .avi and it does not contain any time/date etc. I've used our own two products and dv_date. Ours both scour the DV stream for all VAUX recording time/date packets, AAUX recording time/date packets and timecode packets.

Is the sample exactly as captured or has in been created from a larger file? With most software, extracting a small clip destroys any time/date info. Also, if capturing live (instead of from tape), you won't have any timecode and, unless the clock has been set, the time and date will be missing, too.
__________________
John Miller
Enosoft DV Processor - Free for personal use

Last edited by JohnnyMalaria; 14th April 2009 at 16:30.
JohnnyMalaria is offline   Reply With Quote
Old 11th August 2009, 14:21   #37  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Using DVInfo with Trim and TextSub

Hi All,

I'm a scripting newbie, with a big project ;-). What I need to do is cut and splice a big DV AVI file, in the process creating a text file with the retained frames' DATECODEs to generate DVD subtitles with.

This thread seems to indicate that DVInfo might have the answer. I have a few questions, though:

1) I don't want permanent DATECODE inlays, but selectable DVD subtitles istead. DVInfo.htm suggests that timecode and recording date are printed on the clip, though. How do I avoid that in the clip output by AVS to the encoder?

2) DVInfo.htm's Trim example solution unfortunately contains the code from the splice example. I'll appreciate some guidance on the correct approach for using DVInfo with Trim, please.

3) For the permanent subtitle inlays which I do want, where in the script do I position the TextSub filter in relation to Trim and DVInfo?

Many thanks in advance,
Francois
fvisagie is offline   Reply With Quote
Old 11th August 2009, 14:48   #38  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by fvisagie View Post
1) I don't want permanent DATECODE inlays, but selectable DVD subtitles istead. DVInfo.htm suggests that timecode and recording date are printed on the clip, though. How do I avoid that in the clip output by AVS to the encoder?
Using DVInfo(filename, """ "" """) will suppress writing on the clip, while still setting the run-time variables current_frame, tc_time and rec_time. These values (or any values derived from them) can be written to a text file with WriteFile. (See WriteFile example at post#30 above.)
Quote:
2) DVInfo.htm's Trim example solution unfortunately contains the code from the splice example. I'll appreciate some guidance on the correct approach for using DVInfo with Trim, please.
As long as you put DVInfo after the source filter and before the trim, it will work. Yes, the doc is wrong, the example should read:
Code:
LoadPlugin("c:\myprojects\dvinfo\release\dvinfo.dll")
file1 = "c:\myprojects\type2a.avi"
Avisource(file1)
DVInfo(file1, "rec_time")
Trim(1000,2000)
Quote:
3) For the permanent subtitle inlays which I do want, where in the script do I position the TextSub filter in relation to Trim and DVInfo?
Can you explain this more, please? I thought you said were creating a text file to use in a separate script.

Last edited by Gavino; 11th August 2009 at 14:53. Reason: triple quotes needed
Gavino is offline   Reply With Quote
Old 11th August 2009, 17:42   #39  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 588
Quote:
Originally Posted by Gavino View Post
Can you explain this more, please? I thought you said were creating a text file to use in a separate script.
Hello Gavino,

Thanks for your help so far. What I wrote is indeed a little confusing, because two sets of subtitles are involved.

The first set is for selectable DVD DATECODE subtitles which I hope to create with DVInfo (as mentioned in my initial post).

The second set exists already and contains background information text which in this case I actually want to inlay into the video during serving.

I've tested TextSub with this in my usual little script and it inlays text exactly the way I want it. I'm just not sure how to construct a script that serves trimmed footage and renders the DATECODES of that to text and also correctly inlays these TextSub inlays into the trimmed video stream.

I hope this explains it better?
fvisagie is offline   Reply With Quote
Old 11th August 2009, 18:20   #40  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by fvisagie View Post
I hope this explains it better?
Yes, indeed, sorry for not understanding first time.

Assuming the timecodes in your subtitle file are relative to the original clip, then TextSub should come before Trim.

It doesn't matter whether TextSub comes before DVInfo or after, since they will work independently (and because TextSub doesn't alter the frame numbers, like eg Trim does).
Gavino is offline   Reply With Quote
Reply

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 21:17.


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