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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 14th July 2006, 21:15   #1  |  Link
dallas_dan
Registered User
 
Join Date: May 2006
Posts: 21
Can avisynth export thumbnails?

What would you use, in combination with avisynth, to export say three frames from an avi, resize them, and save them?
dallas_dan is offline   Reply With Quote
Old 14th July 2006, 21:31   #2  |  Link
Gerard V
Registered User
 
Gerard V's Avatar
 
Join Date: May 2006
Location: Wellington, New Zealand
Posts: 112
If you are only going to do this a few times, it would be much easier just to do the whole thing in Virtualdub. Ctrl-2 exports a frame from the output stream to the Windows clipboard.

So set up the filters to deinterlace, resize etc. and then clip the 3 particular frames you want to the clip board, paste into Gimp or Photoshop or whatever.
__________________
Gerard V - Comedy Hypnotist The World's 16th fastest Hypnotist
http://www.thathypnoshow.com and http://www.gerardv.com
Inventor of the Pink Panther hypno gag
Gerard V is offline   Reply With Quote
Old 14th July 2006, 21:38   #3  |  Link
Gerard V
Registered User
 
Gerard V's Avatar
 
Join Date: May 2006
Location: Wellington, New Zealand
Posts: 112
If you really want to do this in Avisynth you could look at http://www.avisynth.org/ImageWriter

Use trim to turn your entire movie into one that is only 3 frames long containing just the frames you want. Deinterlace, resize etc. to thumbnail size and then use Imagewriter to output the frames.

(Just a thought, 'cos I haven't tested this)
__________________
Gerard V - Comedy Hypnotist The World's 16th fastest Hypnotist
http://www.thathypnoshow.com and http://www.gerardv.com
Inventor of the Pink Panther hypno gag
Gerard V is offline   Reply With Quote
Old 14th July 2006, 22:40   #4  |  Link
dallas_dan
Registered User
 
Join Date: May 2006
Posts: 21
Well, the idea is that I will be processing thousands of videos. I would like to set three capture points, say 15 secs. apart, to capture frames. That way I would have three chances to capture a decent frame. Then I would manually go through and select the frame I want to use. For the 20% or so of videos that don't get good frame selections, I would go back and manually export frames.
dallas_dan is offline   Reply With Quote
Old 15th July 2006, 06:13   #5  |  Link
Gerard V
Registered User
 
Gerard V's Avatar
 
Join Date: May 2006
Location: Wellington, New Zealand
Posts: 112
Try
Quote:
AVISource("V:\Clips\Snaps3.avi").Trim(0,1130) # Make it quite short
Killaudio()
SeparateFields() # Not needed if not interlaced video
SelectOdd() # Not needed if not interlaced video
BicubicResize(100,80) # Make thumbnail size
ConvertToRGB()
ImageWriter(file="c:\temp\Thumb",start=0375,end=0375,type="jpg")
ImageWriter(file="c:\temp\Thumb",start=0750,end=0750,type="jpg")
ImageWriter(file="c:\temp\Thumb",start=1125,end=1125,type="jpg")
And play it. Change the folders and file names to suit of course.
__________________
Gerard V - Comedy Hypnotist The World's 16th fastest Hypnotist
http://www.thathypnoshow.com and http://www.gerardv.com
Inventor of the Pink Panther hypno gag
Gerard V is offline   Reply With Quote
Old 15th July 2006, 06:17   #6  |  Link
anonymez
Registered User
 
Join Date: Jun 2006
Posts: 54
maybe something like

Code:
avisource("video.avi")
selectevery(375,0) #select frame every 15 sec, for PAL
lanczosresize(w,h) #if you wish to resize
imagewriter("C:\path")
or simply use the first three lines only, open the script in vdub, file-->save image sequence

anonymez is offline   Reply With Quote
Old 18th July 2006, 20:31   #7  |  Link
dallas_dan
Registered User
 
Join Date: May 2006
Posts: 21
Quote:
Originally Posted by Gerard V
Try


And play it. Change the folders and file names to suit of course.
This looks like this will do the trick, but what do I process the avs file with? I opened in vdub, and tried saving image sequence, but it started saving every frame.

I'm testing a combination of what you and anonymez posted.
dallas_dan is offline   Reply With Quote
Old 18th July 2006, 21:02   #8  |  Link
dallas_dan
Registered User
 
Join Date: May 2006
Posts: 21
You guys rock...I pieced together bits from both of your ideas, and this seems to do the trick perfectly! Now what if I want to take two sizes 120x90 and 240x180 and save thumbs? Is it best to run two seperate scripts, or is this something that can be ran once?

Code:
avisource("D:video.avi")
Killaudio()
SeparateFields() # Not needed if not interlaced video
SelectOdd() # Not needed if not interlaced video
BicubicResize(120,90) # Make thumbnail size
ConvertToRGB()
selectevery(450,0) #select frame every 15 sec
imagewriter("D:\thumbs\",type="jpg")
dallas_dan is offline   Reply With Quote
Old 18th July 2006, 21:44   #9  |  Link
hanfrunz
Registered User
 
hanfrunz's Avatar
 
Join Date: Feb 2002
Location: Germany
Posts: 541
Of course you can

try:
Code:
avisource("D:video.avi")
Killaudio()
SeparateFields() # Not needed if not interlaced video
SelectOdd() # Not needed if not interlaced video
selectevery(450,0) #select frame every 15 sec
ConvertToRGB()

size1=BicubicResize(120,90) # Make thumbnail size 1
size2=BicubicResize(240,180) # Make thumbnail size 2

size1.imagewriter("D:\thumbs1\",type="jpg")
size2.imagewriter("D:\thumbs2\",type="jpg")

return 1 # you have to return something...
Quote:
Now what if I want to take two sizes 120x90 and 240x180 and save thumbs? Is it best to run two seperate scripts, or is this something that can be ran once?

Code:
avisource("D:video.avi")
Killaudio()
SeparateFields() # Not needed if not interlaced video
SelectOdd() # Not needed if not interlaced video
BicubicResize(120,90) # Make thumbnail size
ConvertToRGB()
selectevery(450,0) #select frame every 15 sec
imagewriter("D:\thumbs\",type="jpg")
hanfrunz is offline   Reply With Quote
Old 18th July 2006, 21:56   #10  |  Link
dallas_dan
Registered User
 
Join Date: May 2006
Posts: 21
Quote:
Originally Posted by hanfrunz
Of course you can

try:
Code:
avisource("D:video.avi")
Killaudio()
SeparateFields() # Not needed if not interlaced video
SelectOdd() # Not needed if not interlaced video
selectevery(450,0) #select frame every 15 sec
ConvertToRGB()

size1=BicubicResize(120,90) # Make thumbnail size 1
size2=BicubicResize(240,180) # Make thumbnail size 2

size1.imagewriter("D:\thumbs1\",type="jpg")
size2.imagewriter("D:\thumbs2\",type="jpg")

return 1 # you have to return something...
Hmmm, I get "The script's return value was not a video clip"
dallas_dan is offline   Reply With Quote
Old 19th July 2006, 18:31   #11  |  Link
dallas_dan
Registered User
 
Join Date: May 2006
Posts: 21
Sorry, I am still new to this script. Can anybody help point out what I am doing wrong?
dallas_dan is offline   Reply With Quote
Old 19th July 2006, 18:38   #12  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
try:
return ()
smok3 is offline   Reply With Quote
Old 19th July 2006, 19:16   #13  |  Link
dallas_dan
Registered User
 
Join Date: May 2006
Posts: 21
Quote:
Originally Posted by smok3
try:
return ()
That throws an error too "Script error: syntax error (C:\thumbnail4.avs, line 11, column 9)"

Here is my script:
Code:
avisource("D:video.avi")
Killaudio()
SeparateFields() # Not needed if not interlaced video
SelectOdd() # Not needed if not interlaced video
selectevery(90,0) #select frame every 3 sec
ConvertToRGB()
size1=BicubicResize(120,90) # Make thumbnail size 1
size2=BicubicResize(240,180) # Make thumbnail size 2
size1.imagewriter("D:\thumbs\120\",type="jpg")
size2.imagewriter("D:\thumbs\240\",type="jpg")
return ()
dallas_dan is offline   Reply With Quote
Old 19th July 2006, 19:23   #14  |  Link
LocalH
Registered User
 
Join Date: Mar 2005
Posts: 135
Try return size1. If you're using ImageWriter to output your stills, then you really don't care what you return as the video clip.
LocalH is offline   Reply With Quote
Old 19th July 2006, 19:36   #15  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
yeah, right, now i see nothing gets through by default....
smok3 is offline   Reply With Quote
Old 19th July 2006, 19:38   #16  |  Link
dallas_dan
Registered User
 
Join Date: May 2006
Posts: 21
Quote:
Originally Posted by LocalH
Try return size1. If you're using ImageWriter to output your stills, then you really don't care what you return as the video clip.
That doesn't error, but it also doesn't create any thumbnails. Maybe I should just create two seperate scripts?
dallas_dan is offline   Reply With Quote
Reply


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 20:19.


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