Log in

View Full Version : Grab frames from Avisynth projects


cdrinfo
11th October 2005, 14:18
I am trying to grab pictures from an Avisynth script i made to see some changes between various encoders...

Media Player Classic 6.4 doesn't playback the project since its YV12, while VirtualDub 1.6 can open the project but cannot save a single frame (or not?) but rather a series of frames...

Any help would be appreciated :thanks:

Update: It seems that i forgot the old phrase RTFM, there is already the "ImageWriter " command, which seems to solve my problems :D

Guest
11th October 2005, 14:25
VirtualDub can save a frame. Use Video/Copy source frame to clipboard. Then paste it into your graphics editor and save it.

cdrinfo
11th October 2005, 14:28
neuron2 thanks for your quick response, just another question, what is the best format for comparing images, PNG or BMP? I know BMP is uncompressed but the size for web use is huge

unskinnyboy
11th October 2005, 14:32
You can save a series of frames in VirtualDubMoD (File --> Save Image Sequence) but you will need to convert to RGB first (add ConvertToRGB() at the end of your script). Mind you that colorspace conversion is lossy. I would recommend PNG as the output format.

cdrinfo
11th October 2005, 14:55
unskinnyboy, i don't want to save a sequence of frames (1,2,3,4...) but specific frames, i don't see any option at VirtualDubMod to choose such frames?

unskinnyboy
11th October 2005, 15:17
Load the .avs into VirtualDubMoD, press Ctrl+G, enter the frame #, press OK, press Ctrl+1, paste onto your image editor, save as PNG/JPG.

Guest
11th October 2005, 16:21
what is the best format Per forum rule 12, we frown upon such questions.

cdrinfo
11th October 2005, 17:20
@neuron2: Per forum rule 12, we frown upon such questions.

Ok i understand, let me rephrase, whats the suggested format for using at web (already got an answer!)

@ unskinnyboy, thanks for your help, it worked very well!

esby
11th October 2005, 20:02
@cdrinfo:

Use png for lossless compression.
Use jpeg if you don't care about the quality you can lose.

esby

Inc
11th October 2005, 20:59
You can save a series of frames in VirtualDubMoD (File --> Save Image Sequence) but you will need to convert to RGB first (add ConvertToRGB() at the end of your script)
If the image is shown in Vdub's window, then a conversion in the system for converting YV12 or YUY2 Bitstreams out of avisynth has been done already as Vdub requests RGB32 Data. Means in Vdub the image is already RGB and so it simply does paste the RGB Imagecontent to the clipboard.

Or does "Save Imagesequence" keep the native colorspace? I dont think so, correct me if I'm wrong.

Lossless Formats incl. some compression gain:
- Tiff using LZW compression (if available in you image editor appl.)
- BMP or PNG followed by a ZIP or 7zip compression afterwards

(both are logically not viewable in a forums post)

unskinnyboy
11th October 2005, 21:38
If the video is set to 'Direct Stream Copy' and you do a 'Save Image Sequence', you will need to convert to RGB in your script, else you will get this:

http://img336.imageshack.us/img336/8462/vdmerror8mw.jpg

'Save Image Sequence' will work if Fast Recompress, Normal Recompress or Full Processing Mode is selected. So I suppose while recompressing/processing is when VirtualDubMoD actually does the conversion to RGB32?

Leak
12th October 2005, 07:01
- BMP or PNG followed by a ZIP or 7zip compression afterwards
At least with PNG, using ZIP or 7-Zip on a properly PNG-encoded/-compressed image won't help, as it is compressed already - thus you'll probably gain as much as you get from compressing an MP3, JPG or ZIP... i.e. zero.

If you really want the maximum (lossless) compression possible with PNG, just run it through PNGOUT (http://advsys.net/ken/utils.htm), which will squeeze the maximum possible amount of compression out of it, but that'll take a while...

Inc
12th October 2005, 08:22
Ah, thanx to both of you for the info!

unskinnyboy
12th October 2005, 13:03
At least with PNG, using ZIP or 7-Zip on a properly PNG-encoded/-compressed image won't help, as it is compressed already - thus you'll probably gain as much as you get from compressing an MP3, JPG or ZIP... i.e. zero.
There is a compression utility which *can* compress JPEGs upto 30% with no loss, or so they claim - StuffIt (http://www.stuffit.com/win/index.html).

foxyshadis
12th October 2005, 19:47
They also never came through on their promise to make any kind of image viewer utility or plugin, so it's just a gimmick. (And it's about 10-20x as slow as jpeg compression.) It isn't even that hard to implement your own version, the hard part is making it useful for anything other than archiving. :p

I believe jpeg/jls and tiff are the only formats that can save yuv. jls (lossless jpeg) in fact is almost always much smaller than png, nearly as fast, but again, as far as I know no browser plugins exist, just image editor. ;_;

And, uh, back to the real topic now. >.>

mg262
12th October 2005, 20:05
There's some really useful stuff in this thread last -- thanks, all!

searching for further information on lossless JPEG led me to this:

http://www.hydrogenaudio.org/forums/lofiversion/index.php/t19582.html

Scroll down and see the size comparisons. (And note the familiar face!)