PDA

View Full Version : we need a Quicktime input filter


hanfrunz
14th December 2003, 16:31
Hello,

where can i find a sample code that reads "frame n" from any (reference qt's too!) quickime-movie-file (using the Qt librarys) and returns a frame in the original colorspace to my app?

qtreader.zip can't be the solution!

i just downloaded all windows samples from the apple developer-site, but maybe somebody helps me before i studied all of them...

hanfrunz

ffynnon
14th December 2003, 20:21
I'm looking for a similar solution and would be interested in anything you find...

I need to convert quicktime to avi staying YUV, not converting to RGB and back. I'm thinking you need to do the same...though for specific frames.

On the PC, it is said that Premiere Pro works in YUV. (edit: just learned it only does YUV in certain circumstances--mainly DV) I've imported a YUV quicktime file (blackmagic 10 bit) and exported to Huff, but it comes out as RGB32 unless you tell it *convert* to YUV.

On the mac FCP can do YUV, but I doubt you could render out to Huff (I hope I'm wrong on this).

The QTreader has to work in RGB, yes?

ffynnon
14th December 2003, 20:54
If development on a filter begins, would it be possible to fix the fps problem that qtreader experiences?

We can use selectevery and assumefps or changefps, but it would be nice to not have to worry about it...

Mug Funky
15th December 2003, 14:14
i believe it can be done indirectly using the 3ivx (??) quicktime directshow splitter along with Directshowsource.

haven't tried this though.

[edit] actually, this is kinda problematic. i haven't been able to get the various quicktime-in-directshow filters to talk to each other. it may be possible, but for now i'd say grit your teeth and put up with unnecessary colourspace conversions until a nice "qtsource" is written.

shitowax
15th December 2003, 15:44
The 3ivx splitter should in theory be able to split and give to directshow graph any compressed samples (audio or video). After that, in practical, it works nicely with MJPEG, MPEG-4 video, SVQ1 and SVQ3 using ffdshow, AAC and MP3 audio. All the other formats are not tested and probably don't work. Reference movies (quicktime or mp4)don't work as well, but are on my TODO list. Beware that a lot of video are VFR in quicktime or mp4 format ...

Originally posted by Mug Funky
i believe it can be done indirectly using the 3ivx (??) quicktime directshow splitter along with Directshowsource.

haven't tried this though.

[edit] actually, this is kinda problematic. i haven't been able to get the various quicktime-in-directshow filters to talk to each other. it may be possible, but for now i'd say grit your teeth and put up with unnecessary colourspace conversions until a nice "qtsource" is written.

Mug Funky
15th December 2003, 17:01
ah. thanks for the info :) i was testing it with a sorenson 3 clip, so that'd be the problem. too bad it's not as easy as with the RealMedia splitter. i don't go near macs (bad experiences at uni), so i try to keep away from quicktime. but there are times when you need it.

sh0dan
15th December 2003, 17:13
I think the Quicktime SDK is the way to go. I've downloaded the SDK and all samples - but that's all I've had time for.

shitowax
15th December 2003, 17:25
Sorenson video 3 works perfectly with 3ivx + ffdshow. The only problem is a lot of trailer use QDesign audio for which there is no directshow decoder.

Originally posted by Mug Funky
ah. thanks for the info :) i was testing it with a sorenson 3 clip, so that'd be the problem. too bad it's not as easy as with the RealMedia splitter. i don't go near macs (bad experiences at uni), so i try to keep away from quicktime. but there are times when you need it.

hanfrunz
15th December 2003, 17:31
mmh,

is it not possible and more elegant to use the original quicktime files to do all decoding and just pass the data to an avisynth or directshow filter?

hanfrunz

hanfrunz
16th December 2003, 01:14
okay i checked some of the sample code from apple. Doesn't look good :( all player-samples just use the qt-player. No line of code does actualy copy any byte of a video frame... The Quicktime world seems to be very, very capsulated... but i think there's hope, if sh0dan had some time during christmas ;)

hoppefully,
hanfrunz

Stux
16th December 2003, 06:36
You can definitely do what you want to do with QT API, its just the documentation is sometimes a bit crazy

QT is built from many many layers. The Player is just the top layer, and then you have the Movie Toolbox, and then the Image Compression Manager, and then the Component Manager etc, all layered on top of each other. If you want to, you can skip the Movie Toolbox and talk direct to the ICM to get decompressed frames back.

The basic logic is this

1) open a movie
2) seek to an interesting frame (ie frame i++)
3) decode frame into a GWorld of the output format you want (ie 'yuvs' or something)
4) copy pixels from GWorld to where ever you want (a GWorld is the QT equivalent of a HBITMAP (sortof))
5) goto 2
6) close movie
7) destroy GWorld

audio is similar, but different.

Apple have a good mini tute called something like "QuickTime for Windows Programmers" which is good at getting the concepts across. Basically QT on Windows is an entire port of the entire Mac OS Classic toolbox (ie mac version of Win32)

Mug Funky
16th December 2003, 11:04
Sorenson video 3 works perfectly with 3ivx + ffdshow. The only problem is a lot of trailer use QDesign audio for which there is no directshow decoder.


okay. not on my machine :) i can get zoomplayer to play sorenson and mp3 in quicktime, but i get random division by zero errors, plus zoomplayer doesn't appear to be using directshow to do this (i get no access to the filter information while playing quicktime).

graphedit will not build a graph, but ican build one manually. the furthest it gets is bringing up an activemovie window and crashing.

may i ask which filters i should use to make sorenson 3 playback possible?

shitowax
16th December 2003, 11:37
To be able to play Sorenson video .mov into directshow you need to:
- install latest ffdshow beta (the SVQ3 codec is in since august I think) and verify that the SVQ3 codec support is activated in the property page.
- install 3ivx D4 4.5 and use the 3ivx Config tool to "allow unsupported decoders" in the splitter property page.

That's all :)

Originally posted by Mug Funky
okay. not on my machine :) i can get zoomplayer to play sorenson and mp3 in quicktime, but i get random division by zero errors, plus zoomplayer doesn't appear to be using directshow to do this (i get no access to the filter information while playing quicktime).

graphedit will not build a graph, but ican build one manually. the furthest it gets is bringing up an activemovie window and crashing.

may i ask which filters i should use to make sorenson 3 playback possible?

sh0dan
16th December 2003, 12:59
Sorenson via Directshow is a good thing, but Quicktime reference files are just as needed. I have to go through vfapi to be able to open them for now. An image-only QT-reader would be nice for a start.

The "Basics\Offscreen.win" seems interesting:
Offscreen is a sample application that demonstrates how to use
the Quicktime for Windows 3.0 NewGWorldFromHBITMAP function. The code "wraps" an offscreen GWorld around an existing DIB (created with the Win32 CreateDIBSection function) using NewGWorldFromHBITMAP, and then by draws a movie frame-by-frame into the offscreen GWorld.

V_ICE
25th December 2003, 10:12
I'm not sure if this is what your after but the Cyberlink QuickTime Source Filter "CLQTSrc.ax" from PowerDirector 3 demo allows QT movies to be opened via Directshowsource.

hanfrunz
25th December 2003, 21:27
thats sounds interessting i'll try it in a give a report, if it can open qt-refs and how colorspaces are handeled...

hanfrunz

sh0dan
26th December 2003, 12:18
Please do!

I wouldn't mind writing a QuikcTime import filter, but it pretty far down my list. Fixing DSS sound glitches is further up my list anyway.

hanfrunz
27th December 2003, 00:39
my report:

the filter works very well! It definitaly uses the Quicktime-engine to decode (error messages look very apple-like...) QT-Refs also work!

BUT it only seems to produce RGB32 (if the mov is RGB32) and RGB24 (all other formats like DV-material)

So now we have to check if it is possible to get the YV12 data or maybe QT only works in the RGB colorspace internaly ??!!


I used two methods to check:

1. directshowsource("mov.mov").info() in the avs-script
2. ffdshow (set do decode all raw-video) and info() in the avisynth part. played with graphedit. The filter-tree looks like this: qtinputfilter->ffdshow (no colorspace conversionfilter)


So this filter is a good replacement for qtreader! But it's not perfect!

P.S. there are several other ds-filters in the powerdirector package the that look very interesting!

hanfrunz

Stux
27th December 2003, 05:16
Its possible to get YUV422 data from most codecs, but I think QT won't translate from RGB to YUV, basically you can only get 422 or 420 out of codecs which offer it as a decode format

Steve56
29th December 2003, 01:04
I'm also very interested in a way to transcode my captured QuickTime DV streams without any quality loss due to colorspace conversion with QTReader.

I also tried FireStore DV File Converter (http://www.focusinfo.com/products/firestore/dvconversionsuite/dvcsuite.html)

With it you can for example convert from a QuickTime DV to a AVI DV without recompression by another DV codec (if I understood everything right :-)

Everything was working fine except some high motion scenes came out blocky after conversion. This may either be a bug of DV File Converter or in the way my Formac Studio Software writes the QuickTime DV files.

Does anyone know another way to bring QuickTime DV to AVI DV format, which can directly be opened in AviSynth, without recompression? What about Premiere or Media Cleaner?

Still, best of all (speed and quality vice) would be a native QuickTime import function in AviSynth, so one could still use all those great filters.

Mug Funky
29th December 2003, 05:37
hmmm.. there are a lot of things that claim to convert QT DV to AVI DV without recompression, but i've not found anything that actually DOES it without recompression.

this is the main reason i hate to use apple stuff - they make claims without evidence. i got burnt by final cut pro, and will most likely never use it again, but i'm still left with a few captures i had to do on a mac (no PCs with 1394 at my uni).

premiere and other NLE programs usually will do a direct stream copy for DV content, but they're extremely tempramental as to whether they recompress or not, and in practice i've never got a QT to losslessly convert to AVI.

quicktime pro is supposed to be able to do it as well... you can try these programs - if you get them to work please let us know :)

Wilbert
29th December 2003, 14:24
the filter works very well! It definitaly uses the Quicktime-engine to decode (error messages look very apple-like...) QT-Refs also work!

P.S. there are several other ds-filters in the powerdirector package the that look very interesting!
I also got it to work. Very nice!

It also contains a dshow filter to read images: CLImage.ax. But if I open a jpg in graphedit it uses "qedit.dll" to read the pic (that's what GSpot says). Either way, when I try to open it in AviSynth using the script:

DirectShowSource("D:\Test\Quicktime\wp1.jpe", fps=30, audio=false)

I got the message:

DirectShowSource: unable to determine the duration of the video

It makes sense, because the duration is infinite (I guess). Is it possible to import pictures in AviSynth using directshowsource somehow?

sh0dan
29th December 2003, 15:21
The problem is that DirectShow will report a length of 0 frames and 0 milliseconds.

Steve56
31st December 2003, 22:15
Originally posted by Steve56
[B]I'm also very interested in a way to transcode my captured QuickTime DV streams without any quality loss due to colorspace conversion with QTReader.

I also tried FireStore DV File Converter (http://www.focusinfo.com/products/firestore/dvconversionsuite/dvcsuite.html)

With it you can for example convert from a QuickTime DV to a AVI DV without recompression by another DV codec (if I understood everything right :-)

Everything was working fine except some high motion scenes came out blocky after conversion. This may either be a bug of DV File Converter or in the way my Formac Studio Software writes the QuickTime DV files.

Today, I once again tried the DV File Converter on the problematic QuickTime DV MOV.

This time I told it to convert to Canopus AVI instead of AVI.

Voila, when opened in VDubMod I saw, to my surprise, the blocky error parts are gone! The video looks perfect now! Best of all, it stays YUY2. So no more QTReader/RGB conversion in AviSynth!

The errors I encountered before must have something to do with the default Microsoft DV codec.

I wish all of you a Happy New Year!

ffynnon
1st January 2004, 21:51
This looks promising, though it currently only works with DV based source files. I need to convert 4:2:2 YUV Blackmagic files to HUFFYUV. It claims it will write HUFF, but won't recognize quicktimes other than DV.

I hope they expand their source options (and have emailed them as much).

Is this a true "lossless" conversion? It doesn't sound like it if some codecs have proved problematic...

Zep
2nd January 2004, 11:29
just do what i do and export from QT to a lossless format you can read. Sure it is an extra step but it works perfectly.

ffynnon
2nd January 2004, 22:10
I sent an email to Firestore that you all might be interested in (though it strays out of the "quicktime input filter" topic into QT conversion and YUV issues. Hope this is viewed as relevant to some:


Request:
I am interested in converting YUV quicktimes to YUV (HUFFYUV or similar) AVI
files. It looks like your product will do this--but only with DV source
files. Are there plans to expand the supported source file formats? I am
specifically interested in the Blackmagic 8-bit YUV codec.

Does your program feature an all YUV pipeline? After Effects will import
Blackmagic files and export AVIs, but processes all video in RGB first. I'm
looking for a way to avoid this color space conversion.

Thanks for the info!

_________________________________________

Response:

After some investigations I found out that the Blackmagic 8-bit YUV codec
uses "2Vuy" as the codec id and this is why the software does not recognize
the source file. Please note we support the standard 8-bit YUV codec
("2vuy"). It would not be difficult for us to recognize the Blackmagic codec
too, please let me know if you need such a version.

The bad news for you is that our software processes RGB internally. There
are some reasons for that: surprisingly not all DV codecs can encode/decode
YUV on Windows. In addition upon conversion from 8-bit RGB to 8-bit YCbCr,
three-quarters of the available colors are lost. That is an RGB triplet
contains 4 times as much information as a YUV triplet.

Regards,

Steve56
5th January 2004, 13:26
Originally posted by ffynnon
_________________________________________

Response:

After some investigations I found out that the Blackmagic 8-bit YUV codec
uses "2Vuy" as the codec id and this is why the software does not recognize
the source file. Please note we support the standard 8-bit YUV codec
("2vuy"). It would not be difficult for us to recognize the Blackmagic codec
too, please let me know if you need such a version.

The bad news for you is that our software processes RGB internally. There
are some reasons for that: surprisingly not all DV codecs can encode/decode
YUV on Windows. In addition upon conversion from 8-bit RGB to 8-bit YCbCr,
three-quarters of the available colors are lost. That is an RGB triplet
contains 4 times as much information as a YUV triplet.

Regards,

Does this mean, when converting from DV to DV it, it also encodes using RGB colorspace? I can't think so, this would be a really unnecessary waste of time?!

sh0dan
5th January 2004, 13:52
From the bare looks of it, it seems like the DV maerial is decompressed and recompressed afterwards, with an RGB-stage inbetween.

Certainly if they insert a watermark, they cannot deal with compressed data.

@Steve56: Does the speed/CPU-usage give any hints on whether it is recompressing the material?

ffynnon
5th January 2004, 18:06
I certainly took it to mean *all* video is processed in RGB. The blackmagic codec I wanted to use is YUV--just not YUY2.

Firestore was quite quick to respond to my query--you might try dropping them a line at their website

http://www.focusinfo.com/contact.html

though filling out webforms is a pain.

Steve56
5th January 2004, 21:36
@sh0dan: As of speed, I would think it does not reencode, 'coz it's really fast, must be > factor 2 or 3 than exporting it from QuickTime. If this means anything at all :-)

I think DV video is also a blockbased compression, just as MPEG 2? If so, one could check if the watermarks are inside block boundaries, so it would be possible for them to just overlay the watermark areas, leaving the rest of the video untouched.

In the DV Converter description they say:

The conversion does not involve decompression/compression so there is no quality loss.

I also read in their specs, that DV Converter only converts where it's absolutely necessary!

But to be sure, is there some way to compare UV mapped color values, as you could do with RGB footage in Photoshop or others?

hanfrunz
11th January 2004, 18:09
does someone know how to use the PDQTFileWriter.ax filter (part of powerdirector)? This could be the solution to convert any "windows"-video to the qt-world...

hanfrunz

bilu
12th January 2004, 16:32
Originally posted by shitowax
To be able to play Sorenson video .mov into directshow you need to:
- install latest ffdshow beta (the SVQ3 codec is in since august I think) and verify that the SVQ3 codec support is activated in the property page.
- install 3ivx D4 4.5 and use the 3ivx Config tool to "allow unsupported decoders" in the splitter property page.

That's all :) I can't :(

Using 3ivx as you said and ffdshow-20031128 with SVQ3, SVQ1 and Other MPEG4 enabled (tried with disabled, same result).

Playing it with Zoom Player I can see that 3ivx is the splitter, but there is no decoder - some problem with ffdshow I guess :sly:


Bilu

Leak
12th January 2004, 17:06
Originally posted by bilu
Using 3ivx as you said and ffdshow-20031128 with SVQ3, SVQ1 and Other MPEG4 enabled (tried with disabled, same result).

Playing it with Zoom Player I can see that 3ivx is the splitter, but there is no decoder - some problem with ffdshow I guess :sly:

Are you sure Zoom Player isn't your problem? At least when Quicktime is installed, it will try to play MOV files using the Quicktime browser plugin; maybe it won't try DirectShow for MOV files even if Quicktime isn't installed?

np: T.Raumschmiere - Zartbitter (The Great Rock'n'Roll Swindle)

bilu
12th January 2004, 17:21
It does try DShow - 3ivx splitter shows up.

I'm trying also in an Avisynth script like this:

DirectShowSource("D:\avs25\troy-tsr_m480.mov",24)

with no results :confused:


Bilu

Wilbert
12th January 2004, 17:38
http://forum.doom9.org/showthread.php?s=&threadid=417453

Try the one V_ICE and hanfrunz were talking about (the Cyberlink QuickTime Source Filter "CLQTSrc.ax" from PowerDirector 3 demo). That one works at least.

bilu
12th January 2004, 18:00
You mean this link http://forum.doom9.org/showthread.php?s=&postid=417453#post417453

right?

Bilu

Wilbert
12th January 2004, 19:53
That's the one I meant. Forgot to check the link :D

bilu
12th January 2004, 20:28
I can decode QT into DShow using 3ivx and FFDshow now, but most trailers I've tried have QDesign Audio (which has no DShow filters).

http://forum.doom9.org/showthread.php?s=&postid=426868#post426868

Solution: QuickTime Player allows you to extract the video track and save as self-contained: I made a MOV with just a video track this way.

But still can't play this through DShowSource() :confused:

EDIT: This is valid method to produce a DShow source - I can even play MOVs in WMP9 now.

I haven't tried Cyberlink filters yet, but its odd that a valid DShow source that plays on WMP9 doesn't play as DShowSource()... :confused:


Bilu

BlindWanderer
14th January 2004, 18:20
Well if you are going to code a quicktime filter, it would be really cool to include a way to control QuicktimeVR files.