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 1st January 2002, 09:01   #1  |  Link
TelemachusMH
Just a kid at heart
 
TelemachusMH's Avatar
 
Join Date: Oct 2001
Location: Wouldn't you like to know ;-)
Posts: 272
returning a bitmap from an avs

Is it possible to return a bitmap image (or any image) from an avs script. I would like to make a script that will get a specific frame out of an mpeg-2 file, but I only want the script to return that one frame.

Thanks for the help,
TelemachusMH
TelemachusMH is offline   Reply With Quote
Old 1st January 2002, 18:03   #2  |  Link
TactX
Registered User
 
Join Date: Oct 2001
Location: /home/tactx/
Posts: 367

Open your avs in VirtualDub.

Mark the frame(s) you want.

Save Image Sequence.
TactX is offline   Reply With Quote
Old 1st January 2002, 20:32   #3  |  Link
TelemachusMH
Just a kid at heart
 
TelemachusMH's Avatar
 
Join Date: Oct 2001
Location: Wouldn't you like to know ;-)
Posts: 272
I would like to extract one frame and save it into a bitmap file without using other programs, just avisynth, if possible.

A little correction, I would like to get the bitmap from the avs with just avsynth I will save it into a file by other means.

Last edited by TelemachusMH; 1st January 2002 at 20:38.
TelemachusMH is offline   Reply With Quote
Old 3rd January 2002, 22:49   #4  |  Link
TelemachusMH
Just a kid at heart
 
TelemachusMH's Avatar
 
Join Date: Oct 2001
Location: Wouldn't you like to know ;-)
Posts: 272

Does avisynth with no audio acually return a video or is a a series of bitmap images? If you set it to trim everything but one frame can you open it in paint or get it out some how so that it can?
TelemachusMH is offline   Reply With Quote
Old 10th January 2002, 18:55   #5  |  Link
dinesh
Registered User
 
Join Date: Nov 2001
Posts: 70

My understanding is that AVISynth is a video frame server and only returns an AVI File equivalent. Trimming it to One frame would result in an AVI File output of one frame.
Without the help of any other application (such as VDub or any other), I do not think you can get a BMP file from AVISynth output alone.
dinesh is offline   Reply With Quote
Old 25th September 2002, 11:44   #6  |  Link
Rrrough
Registered User
 
Rrrough's Avatar
 
Join Date: Aug 2002
Location: Avantasia
Posts: 177
would a "snapshot-filter", that is taking snapshots at a configurable frame-distance be realizable ??? that would make image quality measuring a lot easier...

EDIT : favorable output format would be ppm ()

cheers

Last edited by Rrrough; 25th September 2002 at 11:48.
Rrrough is offline   Reply With Quote
Old 25th September 2002, 13:35   #7  |  Link
Malcolm
Registered User
 
Join Date: Sep 2002
Location: Germany
Posts: 352
an AVS is a 'file'. so it _always_ has to be opened by a program! AVISynth only operates on demand. That is the program with which you opened the AVS is requesting the next frame or audio.
If you opened an AVI, the codec decompresses the requested frame and gives it to the requesting program.
If you opened an AVS, AVISynth itself request a frame from the codec, processes it (through the functions and filters noted in the AVS) and then returns the processed frame to the requesting program.

bye, Malcolm
Malcolm is offline   Reply With Quote
Old 25th September 2002, 14:07   #8  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 831
In principal can AviSynth filter output something (Text,...) to a file.
But what would be the advantage of using a filter over using an application which does that already (as VD) ?

And using SelectEvery() outputs only some frames to VD which can then be saved via Save Image Sequence.

For image comparison open VD (preferably the VirtualDubAVS from Belgabor) twice and load your test scripts.
WarpEnterprises is offline   Reply With Quote
Old 25th September 2002, 17:25   #9  |  Link
Rrrough
Registered User
 
Rrrough's Avatar
 
Join Date: Aug 2002
Location: Avantasia
Posts: 177
well, just as usual, I didn't make my idea clear. I know very well, what an avisynth script does, that's why I'm asking for a (scriptable) filter to do the output. i am trying to do image quality measure just like you did, warpenterprises with your compare()-script. i don't want to do that with PSNR (well, I consider using that too, as you get a big bunch of values with your script), but with a program called DCTune, as described in the following threads :

http://forum.doom9.org/showthread.php?threadid=34034

http://forum.doom9.org/showthread.ph...0&pagenumber=4

DCTune computes a perceptual error, which is supposedly better to evaluate picture (video) quality than PSNR (I'm no expert there...)
Therefore you need 2 pictures, the original and the decoded picture to compare, both needed as ppm file. Until now, Im doing this by jumping with VD to the frame number of interest, copying it to clipboard, pasting it in GIMP, saving it as BMP and converting it to PPM with Slowview. Doing that on a lot of pictures (to get a better statistic) is really painful... thus my question.
But I'll definetly try your script as well, warp !

cheers
Rrrough is offline   Reply With Quote
Old 25th September 2002, 18:18   #10  |  Link
Rrrough
Registered User
 
Rrrough's Avatar
 
Join Date: Aug 2002
Location: Avantasia
Posts: 177
Quote:
And using SelectEvery() outputs only some frames to VD which can then be saved via Save Image Sequence
aaah, sunlight strikes my eyes, thanx man, that makes my day !!!
still no ppm, but a lot of pain less.

cheers !
Rrrough is offline   Reply With Quote
Old 26th September 2002, 09:15   #11  |  Link
jonas
Registered User
 
Join Date: Jul 2002
Posts: 35
well, this is basically the same question as the one that started the thread, but in other words,

but how much does a RGB24 frame differ from an BMP. BMP is plain a RGB file, isn't it?
So would it be possible to easily convert an RGB24 frame to BMP format?

jonas
jonas is offline   Reply With Quote
Old 26th September 2002, 21:35   #12  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 831
@Rrrough: hey, what about using TMPG to output to an image sequence? It natively supports PPM
WarpEnterprises is offline   Reply With Quote
Old 26th September 2002, 22:56   #13  |  Link
Rrrough
Registered User
 
Rrrough's Avatar
 
Join Date: Aug 2002
Location: Avantasia
Posts: 177
@Warp

didn't use it before, but thanx for another hint, will try it right away ! I guess, my image quality measuring gets fully automated soon !
Thanx again !!!

cheers
Rrrough is offline   Reply With Quote
Old 27th September 2002, 23:36   #14  |  Link
SILICON
Registered User
 
Join Date: Jun 2002
Location: Spain
Posts: 153
I I have a program to measure the black bands of a film. But not like capturing a single frame (for AVS script to BMP format)

With that data I can calculate accurate resize. The height of IMAGE to be 16x (a exact number of macroblocks. This improvement the quality.

It can do it somebody?

Thanks...
SILICON is offline   Reply With Quote
Old 30th September 2002, 10:44   #15  |  Link
Neoze
Registered User
 
Join Date: Sep 2002
Location: France
Posts: 28
@Rrrough
>I guess, my image quality measuring gets fully automated soon !

Seem to be very promising. Tell us when you have success.


@SILICON
Fitcd do the job. It have an option to add border correspondind to your tv overscan. It's better for macroblock saving.
Neoze is offline   Reply With Quote
Old 30th September 2002, 11:55   #16  |  Link
Rrrough
Registered User
 
Rrrough's Avatar
 
Join Date: Aug 2002
Location: Avantasia
Posts: 177
No big deal anymore, thanx again, warp !!!
Neoze, I'm already using it mainly for custom quantization matrices, look here :
http://forum.doom9.org/showthread.php?threadid=34493
but of course anything is possible, e.g. filter settings, codec settings, etc. I just like to have an objective view on these things.

cheers
Rrrough is offline   Reply With Quote
Old 30th September 2002, 13:44   #17  |  Link
SILICON
Registered User
 
Join Date: Jun 2002
Location: Spain
Posts: 153
Quote:
Originally posted by Neoze
@SILICON
Fitcd do the job. It have an option to add border correspondind to your tv overscan. It's better for macroblock saving. [/B]
Well, i know FITCD. I explain you all, for donīt mistake. Iīm sure that you know all this.

In a 2:35 aspectratio, we have a black border, a film and another black border. When we do resize we must take care of that the top and botoon black borders and the image have a height multiply of 16. That improvement the compression.

By example:
LoadPlugin("PATH\MPEG2DEC.DLL")
# load the film (resolution = 720x480)
Mpeg2Source("PATH\PELICULA.D2V")
# Resizes to 448x256 (16*16=256)
BilinearResize(448,256,27,72,666,336)
# add top and botoon black border (16x7=112). Add overscan (16).
AddBorders(16,112,16,112)

I want make a automatic FITCD. The new program measurin the top and botton black edge (they are not always equal)and, after, will make the calculate the correct value. This way I save the tedious work to measure them manually.

The problem is that I can't capture one image of avisynth.

You can see a actual aplication (in java) in

http://www.vcdsp.com/ripeo/calculado...e/recorte.html . Itīs in Spanish languaje, but i can traslate to english if you like.

Bye
SILICON is offline   Reply With Quote
Old 30th September 2002, 16:23   #18  |  Link
Neoze
Registered User
 
Join Date: Sep 2002
Location: France
Posts: 28
@SILICON

if you want to export a few picture from a clip why not do:
clip=avisource...
picture1=trim(clip,500,-1)
picture2=trim(clip,1500,-1)
picture3=trim(clip,2500,-1)
picture4=trim(clip,3500,-1)
.../...
pictures=picture1+picture2+picture3+picture4
return pictures

and you open your file via tmpgenc and choose file/output to file/sequence

It's possible to automatise the process with tmpgenc with a little script you will name scriptxxx.vbs

dim osh
set osh = wscript.createobject("wscript.shell")
osh.run "C:\PROGRA~1\TMPGEN~2.146\TMPGEnc.exe",0
wscript.sleep 2000
osh.sendkeys "%F{u}"
wscript.sleep 500
osh.sendkeys "{DOWN}"
wscript.sleep 100
osh.sendkeys "{DOWN}"
wscript.sleep 100
osh.sendkeys "{DOWN}"
wscript.sleep 500
osh.sendkeys "{ENTER}"
osh.sendkeys "c:\temp\picture"
wscript.sleep 500

Maybee there is some tmpgenc command line who can do the job?
Or better to drive tmpgenc via dde or objects?
If somebody know a better way to do this job, if will appreciate any suggestion or reading.

Cheers
Neoze is offline   Reply With Quote
Old 2nd October 2002, 22:52   #19  |  Link
Neoze
Registered User
 
Join Date: Sep 2002
Location: France
Posts: 28
@SILICON
Quote:
I want make a automatic FITCD. The new program measurin the top and botton black edge (they are not always equal)and, after,
Have you some news?
Neoze is offline   Reply With Quote
Old 4th October 2002, 14:55   #20  |  Link
ronnylov
Registered User
 
Join Date: Feb 2002
Location: Borås, Sweden
Posts: 492
This is how I make a bitmap picture of one frame:
Open the avs in virtualdub, go to the frame you want.
Then copy input frame to clipboard.
Open Paint and paste to a new image.
Save the image in Paint as a bmp file.
__________________
Ronny
ronnylov 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 02:36.


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