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. |
1st January 2002, 09:01 | #1 | Link |
Just a kid at heart
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 |
1st January 2002, 20:32 | #3 | Link |
Just a kid at heart
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. |
3rd January 2002, 22:49 | #4 | Link |
Just a kid at heart
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?
|
10th January 2002, 18:55 | #5 | Link |
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. |
25th September 2002, 11:44 | #6 | Link |
Registered User
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. |
25th September 2002, 13:35 | #7 | Link |
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 |
25th September 2002, 14:07 | #8 | Link |
C64
Join Date: Apr 2002
Location: Austria
Posts: 830
|
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. |
25th September 2002, 17:25 | #9 | Link |
Registered User
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 |
25th September 2002, 18:18 | #10 | Link | |
Registered User
Join Date: Aug 2002
Location: Avantasia
Posts: 177
|
Quote:
still no ppm, but a lot of pain less. cheers ! |
|
26th September 2002, 09:15 | #11 | Link |
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 |
27th September 2002, 23:36 | #14 | Link |
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... |
30th September 2002, 10:44 | #15 | Link |
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. |
30th September 2002, 11:55 | #16 | Link |
Registered User
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 |
30th September 2002, 13:44 | #17 | Link | |
Registered User
Join Date: Jun 2002
Location: Spain
Posts: 153
|
Quote:
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 |
|
30th September 2002, 16:23 | #18 | Link |
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 |
4th October 2002, 14:55 | #20 | Link |
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|