Log in

View Full Version : new filter: import/export uncompressed videofiles


Pages : [1] 2

hanfrunz
16th April 2003, 18:44
Hello,

if nobody tells me, that this impossible i will start coding a new filter. The idea is to open an uncompressed AVI (or any other fileformat), use a few filters and then save the resulting frames back to the original file (or to a new file)! So i do not need twice the discspace. The framerate, size and colorspace must be the same as the original of course. With this filter it should be possible to access uncompressed Quicktimes, Avid OMFs, etc...

A script using this filter could look like this:

LoadPlugin("importuncompressedfile.dll")
LoadUncompressedFile("Filename",OffsetToRawVideoData,Height, Width,Colorspace, NumberOfFrames, OffsetBetweenFrames)
...
[put your filters here]
...
SaveUncompressesFile("Filename",OffsetToRawVideoData,Height, Width,Colorspace, NumberOfFrames, OffsetBetweenFrames)

Does anybody see any problems that may come to me?

thanks
hanfrunz

mf
16th April 2003, 19:35
As far as I know computers, this should work with uncompressed files as you said. Lossless compressed files on the other hand have unpredictible framesizes and you would have to buffer a whole lot of input frames to make sure you don't overwrite anything you haven't read yet.

sh0dan
16th April 2003, 20:09
The only "major" problem I see it that it requires extremely linear frame access to work. You risk overwriting a frame that has not been processed yet - and even worse - you risk that if your reader is asked to deliver a frame again, it will return a different (processed) one.

In limited cases it is possible.

Si
16th April 2003, 22:27
@hanfrunz
I don't imagine that many (maybe any apart from uncompressed) avi's have a constant frame size.

It'd be completely non-standard and limited.

Linear only like sh0dan says.


But a very good idea - thinking outside the box :D

regards
Simon (on 3 Glenmorangies - hic) :)

hanfrunz
19th April 2003, 01:30
Hi again,

i attached the first version of my "importuncompressedfile"-filter.
It can import uncompressed .omf (avid) and uncompressed .avi-files.
The export filter can directly write to omf and avi.

This version is very slow, i think my way of accessing the file is not the best... if someone could give me a hint, i will optimize that :)

See readme.txt for further information.
Good night.

hanfrunz

sh0dan
19th April 2003, 15:46
Instead of reading single bytes, you should read an entire line at the time, and do rearrangements after that.

hanfrunz
22nd April 2003, 22:50
Hello,

i attached a new version of the filter. It is much faster now, because it reads a whole frame at once.

hanfrunz

hanfrunz
3rd May 2003, 01:51
Hello,

damm it! Avid uses checksums in uncompressed .omf-files! So the exportfilter does not work correct for .omf-files! (playback is green and a lot of errormessages apear, if you only look frame by frame its okay...)
I will attach some examples tomorrow, because i am to tired now... maybe someone has an idea how to calculate the checksums (4 byte/field).

hanfrunz

sh0dan
4th May 2003, 12:20
It could be a CRC32, or it could be all pixels xor'ed.

hanfrunz
4th May 2003, 22:28
and again a new version:

http://home.austrosearch.at/hanfrunz/iuf_v1.2.zip.html
just download and rename to .zip

news:
you can import/export uncompressed Quicktime-movies (compression=none, color=millions/millions+=RGB24/32)

hanfrunz

hanfrunz
25th May 2003, 23:48
version 1.3 is out!

there is a new filter which imports uncompressed bitmap-sequences like TIFF or Pixar.

please send me a PM, then i send you the package.
Or wait until i found a new webspace or somebody hosts my 28k file :)

[EDIT]
now you can download it from:
iuf_v1.3.zip (http://galileo.spaceports.com/~hanfrunz/iuf_v1.3.zip)

hanfrunz

hanfrunz
25th January 2004, 23:45
Hello,

a new version is out

iuf_v1.4.zip (http://www.geocities.com/hanfrunz/iuf_v1.4.zip)

you can import uncompressed Quicktimefiles with the Blackmagic codec (with interleaved audio) now:see here (http://www.decklink.com/support.asp)

hanfrunz

EDIT: mmh there is a problem with blackmagic-files that are longer than 10 seconds... a new version will follow in the next days...

hanfrunz
7th March 2004, 22:30
Hello,
and again an new version.

iuf_v1.5.zip (http://www.geocities.com/hanfrunz/iuf_v1.5.zip)

the importUncompressedSequence function can now import cineon files.
I used the lib from www.xnview.com (http://www.xnview.com) to do so. Theoreticaly it should be possible to import over 100 filetypes, but i only used cineon, maybe anybody could check this out.
There is a second mode called "dirtycineon" which does not use proper LUT-operation to convert the 10bit/log data to RGB32, but it is faster and can be used for previewing or offline editing it has a inbuid reduceby2 and reduceby4 function if you handle highres files (like 2k film or hd).

I think there a some things that could be optimized in the "dirtycineon" part, maybe the mmx/sse-freaks could check that :)

The support for blackmagic files is not supported in this version, because of too many problems, but maybe in the next version.

hanfrunz

kassandro
7th March 2004, 23:27
Behind SaveUncompressesFile there is an idea which resurfaces here from time to time. Namely, encoder plugins, SaveUncompressesFile is something like an encoder, though an extremely simple one. Of course then there should be an exe version of Avisynth. In his example script, vdub is only used to trigger the encoding process, which is actually done by SaveUncompressesFile.
We have already plugins like avisource, mpeg2dec3 for generating clips, filter plugins for processing clips and encoder plugins would be there for destroying clips again. The whole processing cycle would then be completely within Avisynth. A nice theoretical idea.

Wilbert
8th March 2004, 10:16
@hanfrunz,

Your link doesn't work?

hanfrunz
8th March 2004, 11:33
hi wilbert,
just copy/paste the link to a new window, then it works.

hanfrunz

MrTibs
9th March 2004, 17:14
Any hope that you will be able to support Huffy? I realize that Huffy is a compressed lossless codec but most people doing captures use it as their codec. It would be quite good to be able to re-compress a capture to reduce its size. Right now I use a simple script like this:

# Trim out comercials
Trim(....

#reverse pulldown
IVTC(...

#Crop out overscan
Crop(...

As you can see from my pseudo-script, I am removing frames so I have little chance of writing over a frame that I am trying to read (assuming a frame buffer of a couple of frames.)

hanfrunz
9th March 2004, 19:42
Hello MrTibs,

NO! there will never be Huffy-Support, because the framesize is not constant, so you can't write back processed frames at the same position, which my filter does.

hanfrunz

Dali Lama
14th March 2004, 19:16
Hello,

I don't have access to a computer to check right now, but will hanfrunz's filter accept DV compression? I belief it is constant bitrate and should have constant framesize. This would be great for editing/filtering with low disk space.

Regards,

Dali

hanfrunz
14th March 2004, 19:52
Hello Dali Lama,
mmh interesting idea, but right now this is not possible, because my filter cannot de- and encode DV-streams, and i think i'm not able to implement a DV codec, but maybe somebody else feels inspired?

hanfrunz

tateu
1st October 2005, 20:26
Anyone successfully using this with uncompressed OMF files or have another plugin that can read them? I'm having trouble figuring out what the offset values should be. I have NTSC 720x486 uncompressed OMF files created by an Avid Adrenaline and by After FX 6.5.

I've also downloaded what's left of the OMF Toolkit (did not come with documentation) and have started trying to write my own OMF Reader plugin. I'm not having a whole lot of luck with that either. I can successfully read a few frames before it crashes. I think it's the offset values again causing the major problems.

hanfrunz
4th October 2005, 19:51
hello tateu,

when i wrote this filter, i only tested PAL-files, so i can't help you with the offsets. But i can give some tipps to find them out.

-generate a clip with one black frame, then a white frame.
-use 8 bit files. 10bit arent supported
-use your favorite hexeditor to find out where the black frame starts.
-do the same with the white frame
-avid also stores some lines of video above the picture data (timecode etc.), so you have more than 480 lines/frame
-if i remeber right the fields are stored one after the other, they are not weaved

if you really start a real omf-import filter, tell me maybe i can hlp you.

regards,
hanfrunz

tateu
5th October 2005, 09:47
Thanks for the offer of help. I actually made some good progress tonight on my OMF import filter. I can successfully read all of the NTSC 1:1 sample OMF files that I have. I can read the 1:1 PAL samples too, but the field order is reversed. I haven't yet figured out how to determine the correct field order from the OMF.

The next steps will be to figure out the field order issue. So far, all of my NTSC files are lower field first and the PAL files are upper field first. If that turns out to be a rule set in stone I can easily change my filter to always read PAL files upper field first. Then, I'd like to be able to read audio data and compressed (DV, tiff, jpeg) video data and eventually create OMF files. And then, of course, fixing the millions of bugs that it probably has...Whether I can actually ever accomplish any of these things is another story. I'm leaving for vacation in a few days, though, so I probably won't be able to make any more progress on this filter for a few weeks.

To use it, you will need omfToolkit.dll in your system path, which can be downloaded from OMF.zip at
http://www.aafassociation.org/download/ about 1/3 of the way down the page in the link for "OMF developer libraries."

Here are two 1:1 OMF 2.0 files that I was using for testing purposes. They were created with After FX v6.5 and just cycle through 10 different solid colors over and over. They are 1:1 OMF 2.0, PAL and NTSC. I have also successfully tested OMF 1.0 files captured by an Avid Adrenaline.
http://www.tateu.net/software/dl.php?f=OMFColorsNTSC
http://www.tateu.net/software/dl.php?f=OMFColorsPAL

And here is the current source and compiled dll in case anyone wants to take a look:
http://www.tateu.net/software/dl.php?f=OmfSource

The syntax is:
OMFInput("Colors_v2_NTSC_1-1.omf")

iC3
22nd November 2005, 03:25
Hi Hanfrunz,

Did you ever get anywhere with using Blackmagic Quicktimes?
I have just been having the same problem and have foung using the quicktimereader.vfp allows Blamagick HD Qt's to be imported of any length and size.
Playback is a little slow though for my liking. Id like to import HD quicktimes,
post process them and read them out as DPX frames.

iC3

Mug Funky
22nd November 2005, 07:18
iC3 - if you've got tons of disk space you can use ffmpeg to rip the data out of the mov and whack it into an avi file. not an ideal solution i know...

also you can do future caps on a PC if you're allowed to rip the decklink card out of the mac it's in.

good to see another melbournite. you're in good company :)

Mug Funky
27th March 2007, 15:23
yo, i noticed that "dirtycineon" doesn't appear to work. says "file not found", and quotes the correct filename.

if i change "dirtycineon" to "cineon", the problem goes away.

...basically i've a sudden selfish interest in getting a dpx sequence into an OMF as quickly as possible (preferably as soon as they come off the scanner, but realistically i'll probably have to work on the previous roll while the current one is scanning).

hanfrunz
31st March 2007, 10:18
@Mug Funky
i have to take a a deep look in the latest sourcecode maybe i fixed this problem :) If i remember right "dirtycineon" just read the rgb values directly from the cineon file. "Cineon" uses the xnview-library...

squid_80
31st March 2007, 13:09
Working from your v1.5 sourcecode there seemed to be an if statement missing that was causing the file not found error to always be thrown. Also I tweaked the shifting code a bit since it was doing a signed right shift instead of unsigned:
dstp[w+2] = source[dummy];
dstp[w+1] = (source[dummy+1] << 2) + ((unsigned char)source[dummy+2] >> 6);
dstp[w ] = (source[dummy+2] << 4) + ((unsigned char)source[dummy+3] >> 4);
The colours come out a lot better now :)

I'm putting some finishing touches on some SSE2 code to do the bit shifting, let me know if you want me to post it here.

squid_80
31st March 2007, 14:00
Well that was easier than I thought: http://members.optusnet.com.au/squid_80/importuncompressedfile.dll

Someone speed test this for me, I can't discern any difference here since I've only got 5 dpx files to play with. (Source code is of course available upon request, I just don't have the room to host it at the moment.)

Wilbert
31st March 2007, 16:40
Someone speed test this for me, I can't discern any difference here since I've only got 5 dpx files to play with. (Source code is of course available upon request, I just don't have the room to host it at the moment.)
I will host it if you send it to me: wilbertdijkhof at yahoo.com :)

Mug Funky
1st April 2007, 06:58
thanks heaps for this squid! :)

speed for 77 dpx files (1k - 1024x768, 10-bit log) is about 35fps as read from my SATA drive. that's fantastic. in fact, running rgblut("10 x 256 / ^ 64 * 64 -") on it didn't incur any noticable speed penalty (that's a hacky log-to-lin conversion that i pulled out of my bottom).

machine is AMD X2 4200+ @ 2.2GHz with a pretty vanilla SATA drive.

for some reason the machine at work running off the SAN is a lot slower (it'd otherwise be a much better testing bed, with access to nearly limitless dpx files of different sizes). i think that might be machine specific, as copying a sequence locally still gave me a rather flaccid 3-4fps. i'll have to track down a beefier machine that's not being used...

to give an indication of what's possible with this format, the grading machine at work is a similar spec machine (intel's equivalent i guess) and it's able to play out 2k (2048x1556) with 32 bit processing, ~4 layers of 3d luts and spline windows at a steady 25fps :). it uses GPU for a lot of that though.

morsa
2nd April 2007, 21:35
what is that machine using? Some kind of "lustre" or what? ;)

Mug Funky
2nd April 2007, 22:36
@ morsa: close but no discreet. it's a newish one called "scratch".

jmac698
6th April 2007, 22:26
can you add a feature to return >8bit files as two clips, with high byte and low byte? then we could instantly have HDR video feature (high dynamic range).
masktools should be enough to manipulate it, though it will be awkward to handle a carry. An HDR brightness function would need three steps.
low=omfimport("low","hdr.omf")
high=omfimport("high","hdr.omf")
bright=+20
carry=yv12lut(low,"x bright + 255 > 1 0 ?")
low1=yv12lut(low,"x bright +")
high1=yv12lutxy(high,carry,"x y +")

Well I won't write it now, but I think it's possible.

Mug Funky
7th April 2007, 02:55
that might be more a feature for avisynth 3... though it's not a bad idea to do a workaround in 8 bit, it could get unwieldy.

jmac698
7th April 2007, 17:01
hanfrunz,
this may help
http://aaf.sourceforge.net/
open media framework interchange, invented by Avid in 1998, finally gained accepted on a wider basis with microsoft, who then developed an SDK, with most of the code from the old Avid SDK. It's freely distributable including derived works.
It can import older file formats.
And could you make another dirtyimportlow that has the lower bits - if 10bit format, put them in the top two bits please.
I can write log converter just in script!

Mug Funky
9th April 2007, 07:45
@ jmac698:

you wont get much extra in those 2 bits, considering film grain works as a dither here (unless you're working with 70mm or Imax in 2k...). though it would be awesome to be able to do grading and compositing in avisynth :)

Cooger
4th May 2008, 00:35
I have my post here:
http://forum.doom9.org/showthread.php?t=137442

And I was refered by Wilbert to this post.

This is a very needed plugin, in my opinion. I am personally interested in feeding 10bit log DPX into avisyth and encode to bluray via meGUI.
(more of my problems in the post above)

I may be wrong here, but as I think, that Bluray encoding is 8 bit, the plugin could apply a rec709 LUT on the DPX.

That way, I would be able to have a quick- dailies renderout on bluray.
If this plugin is able to do that... OMG !!!

Is there a way I can contribute? I can generate various tiff, dpx and quicktime uncompressed sequences from the RED ONE footage, via the RED Alert program. Since its my own footage, and I would limit the lenght, there would be no royalty problems.

Jonas

www.jonasrejman.com/carved

Mug Funky
6th May 2008, 11:36
wow! who's asking for dailies on blu-ray? that's a bit extravagent isn't it?

(sry, i only say that because all i've got for dailies is an antique Ursa Gold w/ twigi. SD only)

btw, Cooger: Scratch is awesome with red stuff. 2k -> HDCAM-SR with grades... realtime.

Cooger
6th May 2008, 22:00
Hi there, again.

Well, clients are asking for that. The clear advantage is, that they can play it back on their home theatre systems.

SCRATCH or Speedgrade RX are grading tools. They do not help you with encoding and authoring to Bluray. Again, if you are able to afford SCRATCH with SDI and HDCAM deck, and are able to get the client another deck to playback, you are off the hook.

I was looking for an alternative without tapes. I hate tapes. ;-D

Jonas

www.jonasrejman.com

smok3
6th May 2008, 22:19
Cooger, care to shortly describe your editing/post/grading workflow with the red? (what software, codecs, resolutions, ect)

Cooger
7th May 2008, 01:32
Sure.

You get r3d out of the camera. This can be currently processed by RedCine, RedAlert (both applications from RED company), Assimilate's SCRATCH and unofficial Iridias Speedgrade RX.

RedAlert is a per shoot "digital negative" development tool to DPX,TIFF,QUICKTIME 4:4:4/4:4:2

RedCine is primary grading tool, where you can trim shoots and load xml files, that work as edit lists. Its best used with FCP and a software called Crimson Workflow, that translates FCP xml into RedCine xml. Here again, you can output to DPX, TIFF, QT uncompressed...

SCRATCH can read FCP xmls directly and conforms. It is a full grading tool, that natively reads and outputs the r3d files in realtime via GPU acceleration. You should have a Quadro FX 4600 for that, for realtime on a broadcast monitor, you need the SDI version.

Speedgrade is a grading tool, I have not tested that yet.


The camera also creates so called QT wrappers, that you can playback in quarter, half and full resolution. It does not full debayer though. for playback in high res, you need a BEEFY computer.


The workflow I chose for Carved was: r3d -> QT wrappers into FCP -> edit in FCP -> xml EDL output -> xml EDL input SCRATCH -> grading in SCRATCH in realtime 2k -> DPX sequence render out 2k/1080p/720p/SD -> encode for DCI/Bluray/mkv/DVD/(iphone)


This is considered the cinema workflow, as it delivers the highest quality. You render the DPX from the r3d and then encode into your deliery format.

The video workflow would be, that you transcode the data via the QT wrappers into Apple Pro Rez HQ, edit and output with Kona/BLackmagic/whatever you like. It of course defeats a little bit the whole RAW acquisition of the RED camera, as those codecs and transcodes kill your picture.


A low-end cinema sollution is: FCP -> crimson -> redcine -> DPX RENDER -> (AFter Effects, titles, etc.) -> delivery.


Hope that helps sort of.


Jonas

p.s.

Call me Jonas, I have this stupid nickname, I may get a new registration here.


www.jonasrejman.com

smok3
7th May 2008, 07:34
:thanks:

Mug Funky
20th May 2008, 17:04
@ cooger:

i don't mind tapes, but the SRW 5500 is a different beast...

i don't think i've ever used so many four letter words before i met that thing. for something so advanced it's a complete pile of balls.

interesting to hear about speedgrade supporting redcode. i was hoping scratch would have the edge a bit longer (purely selfish reasons of course - i'm at the only place in my town with a scratch).

...too bad i'm stuck on the Ursa for a while yet though.

Jenyok
7th May 2010, 09:22
Where can I download IUF plugin ?

http://www.geocities.com/hanfrunz/iuf_v1.5.zip - does not work long time.

foxyshadis
8th May 2010, 01:40
http://avisynth.org/warpenterprises/files/iuf_25_dll_20040307.zip

Wilbert does a great job of archiving filters at http://avisynth.org/warpenterprises/

Jenyok
12th May 2010, 07:35
foxyshadis

Great thank's to you !

Dogway
30th October 2010, 08:29
I was discussing this in another thread but it came to be this filter which triggers an libgfl201.dll error when encoding in x264CLI, even when Im not using this filter. It doesnt seem to harm my encodings, but I wonder if I can use this filter in the future I just read it relies on the libraries of xnview, do I lack downloading something? I downloaded the libgfl201.dll, libgfl211.dll and libgfl311.dll files, I tried placing them on system32, and now x264CLI asks me for msvcp70.dll.

Besides it I tried to load a cineon file and avisynth reported an error: Loadplugin: Unable to load....
Im using avisynth 2.5.7 MT on WinXP SP3

Dogway
15th November 2010, 02:49
How do you make this to work? I have got many virus lately trying to find the needed files to run this... Do I need to buy some kind of software?

Dogway
8th February 2011, 20:32
Okay, I found this file "ImageMagick-6.5.8_dll.zip (http://www.wilbertdijkhof.com/Immaavs_v151.zip)" and this plugin (http://www.wilbertdijkhof.com/Immaavs_v151.zip) also which seems to don't load cineon files. I put the IM_MOD_RL_cin_.dll file in system32, set the variable, and run ImportUncompressedFile, but still the same error.