Login  Register

Re: Converting video stream in .tif images

Posted by Michael Schmid on Aug 03, 2010; 5:12pm
URL: http://imagej.273.s1.nabble.com/Converting-video-stream-in-tif-images-tp3687371p3687374.html

Hi Felipe,

AviSynth can load VOB files using external plugins.
If you open your VOB file in VirtualDub via AviSynth, it will be  
decoded only once. You can then use some non-lossy encoder in  
VirtualDub for saving.

AviSynth is a Frameserver, so it works a bit like a virtual stack in  
ImageJ: it reads the file as required to fulfill the requests for  
individual video frames issued by another program like VirtualDub.  
You have to write a small AviSynth script for each of your input  
files and open that script instead of the .VOB or .AVI in VirtualDub.

There is an example for a script loading VOB files (same as d2v  
files) at
http://avisynth.org/mediawiki/ 
FAQ_loading_clips#How_do_I_load_MPEG-1.2FMPEG-2.2FDVD_VOB.2FTS.
2FPVA_into_AviSynth.3F

You can also use AviSynth scripts to extract frames, e.g. using the  
trim filter
   http://avisynth.org/mediawiki/Trim
or directly write the output using its ImageWriter. You can write  
them as individual images that can be opened with ImageJ, or as YUY2  
avi (ConvertToYUY2) that is also readable by ImageJ and has no  
compression except chroma subsampling also present in any MPEG stream  
like VOB.
   http://avisynth.org/mediawiki/ImageWriter

I have not tried, but I guess that you could do the following in  
AviSynth:

LoadPlugin("d:\myAviSyntPlugins\dgdecode.dll")
MPEG2Source("d:\myDataFiles\filename.vob")
# assumes that your input is interlaced video
ConvertToYUY2(clip, interlaced=true)
# maybe create a new clip via the Weave filter here (i.e., reduce the  
frame rate as you are vonverting from interlaced to progressive)
Imagewriter("d:\myDataFiles\part1.avi", start = 1000, end = 1100)

By the way, you cannot feed AviSynth output directly into ImageJ  
i.e., you can't open an AviSynth script in ImageJ instead of an AVI  
file. That's because ImageJ does not use the functions of the  
operating system to read AVI files, in contrast to most platform-
specific programs that read AVI files.

Hope this helps,

Michael
________________________________________________________________


On 3 Aug 2010, at 18:07, Felipe Franco wrote:

> Hey,
>  I m working in a windows pc on molecular imaging and we need to  
> measure the
> fluorescence of organs in diferents intervals, not in a specific time.
>  I just cannot find any software that is able to take an video  
> stream (
> working in set intervals ) and transforme it in a stack .tif. Do  
> you guys
> have some sugestion? Do you guys think that if i convert my .vob  
> file ( dvd
> video ) in quick time and then into a stack will lose some quality?
>  I need to point out that this video has about 1 hour in high  
> quality and I
> intent to take some intervals between 5 and 15 minutes to run my  
> analysis.
> I've tried to use virtualdub but, to open the video files in this  
> software,
> first need to convert in .avi using the software "convert vob to  
> avi " and
> I'm afraid of losing quality. Moreover, I cannot find the function  
> of taking
> several shots in a row of intervals of my interest.
>   Thank you and sorry being repetitive..
>    Felipe
>
> --
> View this message in context: http://imagej.588099.n2.nabble.com/ 
> Converting-video-stream-in-tif-images-tp5369038p5369038.html
> Sent from the ImageJ mailing list archive at Nabble.com.