MLVFS - a FUSE based, "on the fly" MLV to CDNG converter

Started by dmilligan, August 31, 2014, 02:01:24 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

KurtAugust

Seeing this evolve so fast is like watching the Big Bang from your couch with a lovely cup of coffee. Very clever thinking!
www.kurtaugustyns.com @HetRovendOog

timbytheriver

Thank-you @dmilligan et al for this breakthrough work.

After following your new .dmg based instructions I'm getting an error running on Mac OSX 10.7.5

Operation fails after after selecting a mount folder:

=====

! The action "Run Shell Script" encountered an error.

I click > Show Workflow

The workflow appears > I click it. The workflow dialogue boxes appear, containing:

~/Library/Services/MLVFS.workflow/Contents/mlvfs "$2" --mlv_dir="$1"

Could you help please?

Cheers

tim
5D3 1.1.3
5D2 2.1.2

dmilligan

Quote from: timbytheriver on September 10, 2014, 10:37:19 AM
Mac OSX 10.7.5
I have not tested it on anything but Mavericks (10.9). You may need to compile it yourself if you want it to work on older versions.

timbytheriver

5D3 1.1.3
5D2 2.1.2

menoc

QuoteJust select the first DNG and click import, the whole thing will be imported (don't worry about the check box). Or you can just use the "Media Browser", the DNGs should show up as a single clip and you can drag/drop it into your timeline.

Great thanks guys! That works in Premiere and Media Encoder. It does not work in After Effects CC 2014 though- I get an error

https://www.dropbox.com/s/67k7r7mjhfxgn8x/Screen%20Shot%202014-09-10%20at%207.28.46%20PM.png?dl=0

dmilligan


mg_dev

Hi guys. I started tracing this topic some time ago, and I decided to share my conclusion :)

First, I'm interesting this topic from developer point of view rather than end user. I tried to convert MLV movie to set od DNGs using modified (fork) raw2cdng. I've prapared NVidia CUDA depth converters (in dynamic linked library). Sadly, summary processing time were not reduce too much because of hard drive bottleneck.. Creating 100 or 1000s  1-2Mb DNGs give huge overhead for disk-writing efficiency. 

Second, We all know - the idea of mounting MLV movies as a transparent 'drive' or folder is really good. But my approach is different a little bit - I will try to store DNGs in .ISO or .UDF (universal disk format). Output can be mounted on every platform. Writing huge data to one file is often more efficient than little data to  many files..
Or maybe someone tested this solution?..

I know that "ISO" access to DNGs won't be easier than mounting MLV in MLVFS, but it is kind of solution:)

I'll let You know, if I get better processing results :). And of course, I'll share my project if You want.

ayshih

I'm happy to announce that I've gotten an analogous implementation of MLVFS running on Windows using Pismo File Mount Audit Package.  After installing PFMAP, download the MLV formatter DLL from Bitbucket (https://bitbucket.org/dmilligan/mlvfs/downloads/mlvfs.dll) and then register it with PFMAP by entering on a command prompt:

pfm register mlvfs.dll

You can then mount any individual MLV video by right-clicking on it and selecting "Quick Mount", which will turn that video into a virtual folder containing the virtual DNGs.  The virtual folder also has support for creating and modifying additional files (e.g., XMP sidecar files), but the files are not preserved when the video is unmounted.

It's far better than the workaround with the Linux VM, but I don't know if it's better than g3gg0's WebDAV approach because I haven't tried it. 
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

Frank7D

Hi ayshih,
I tried your pismo method with no success.
I have been using pismo to mount avisynth files for years now, so I already had PFMAP (I believe).
I downloaded the file (but it was just "mlvfs", with no ".dll" on the end).
I changed the named to add ".dll" on the end.
I opened a command prompt, went to the directory with the file, and registered the file per your instructions.
I tried to quick mount an mlv file, but got a message saying it was an unsupported file format.

Edit:  Never mind, the problem was all me; I was using an old build of PFMAP. Once I installed the latest one I was fine.

Thanks for this great option! Can't wait to play with it!

Frank7D

Using pismo, I am getting no wav files in the virtual folders.

Also, the folders are read-only by default, so I have to right-click them and make them writable in order to import the virtual DNGs into After Effects.

ayshih

Quote from: Frank7D on September 13, 2014, 06:54:42 AM
Using pismo, I am getting no wav files in the virtual folders.
Yup, I haven't implemented audio yet, but it shouldn't be too difficult since it's up and running on the FUSE side.

Quote from: Frank7D on September 13, 2014, 06:54:42 AM
Also, the folders are read-only by default, so I have to right-click them and make them writable in order to import the virtual DNGs into After Effects.
Hmm, the folder itself should already be writable, but I guess After Effects really wants the DNGs to be writable.  Be careful when making the DNGs writable; things could break in weird and fantastic ways because I didn't protect all of the possible calls (on the presumption that the DNGs were read-only).
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

Frank7D

One other thing (using pismo): When I open the virtual DNGs in ACR or After Effects with white balance set to "As Shot", the "Temperature" is incorrect. For example, my camera (7D) was set to 5100 and the DNG opened with 2600.

ayshih

The DNG writing code for white balance needs work, because it doesn't have model-specific or preset-specific white-balance multipliers.  Perhaps you should create an issue on Bitbucket!
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

dmilligan

Someone explain to me the math behind how to get from temperature to RGB multipliers, and I'll fix it :)

QuoteAsShotNeutral specifies the selected white balance at time of capture, encoded as the coordinates of a perfectly neutral color in linear reference space values.

g3gg0

Quote from: dmilligan on September 13, 2014, 05:21:40 PM
Someone explain to me the math behind how to get from temperature to RGB multipliers, and I'll fix it :)
https://bitbucket.org/hudson/magic-lantern/src/e12ad3d84e7bc5b61e27c9e9e5a7c0423b39598c/contrib/g3gg0-tools/MLVViewSharp/DebayerBase.cs?at=unified

basically this:

            /* get the XYZ --> cone reference whites for requested temperatures */
            Matrix dst = coneDomain * KelvinToXYZ(ColorTemperature);
            /* verify: do all our matrices that came from dcraw really convert raw to D65? */
            Matrix src = coneDomain * KelvinToXYZ(6500);

            /* scale coordinates in cone color space */
            Matrix xyzScale = new Matrix(3, 3);
            xyzScale[0, 0] = dst[0] / src[0];
            xyzScale[1, 1] = dst[1] / src[1];
            xyzScale[2, 2] = dst[2] / src[2];

            /* finally scale colors */
            Matrix xyzKelvinWb = coneDomain.Inverse() * xyzScale * coneDomain;

            /* now combine the whole thing to get RAW --> RAW-WB --> XYZ --> Kelvin-WB --> XYZ --> (s)RGB --> RGB-WB */
            CamToRgbMatrix = WhiteBalanceMatrix * RGBToXYZMatrix.Inverse() * xyzKelvinWb * XYZToCamMatrix.Inverse() * WhiteBalanceMatrixRaw;
Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

dmilligan

EDIT: okay, I think I've basically got it

What about G/M shift?

g3gg0

never tried.

would set up a function that gives you the RGB values for the G/M shift, which is quite simple.  ([R, G, B] = [128-x, 128+x, 128-x])
then transform it to XYZ and straight forward to bradford cone domain.
then just do the same scaling as with kelvin.

basically you could do this with any white point in any color space.

so:

            Matrix gmShiftRef = new Matrix(3, 1);
            gmShiftRef [0] = 0.5;
            gmShiftRef [1] = 0.5;
            gmShiftRef [2] = 0.5;

            Matrix gmShiftRgb = new Matrix(3, 1);
            gmShiftRgb[0] = 0.5-gmShift;
            gmShiftRgb[1] = 0.5+gmShift;
            gmShiftRgb[2] = 0.5-gmShift;

            Matrix dst = RGBToXYZMatrix* gmShiftRgb;
            Matrix src = RGBToXYZMatrix* gmShiftRef;

            Matrix coneScale = new Matrix(3, 3);
            coneScale [0, 0] = dst[0] / src[0];
            coneScale [1, 1] = dst[1] / src[1];
            coneScale [2, 2] = dst[2] / src[2];

            Matrix xyzGMShift = XYZBradford.Inverse() * coneScale * XYZBradford;

Help us with datasheets - Help us with register dumps
magic lantern: 1Magic9991E1eWbGvrsx186GovYCXFbppY, server expenses: [email protected]
ONLY donate for things we have done, not for things you expect!

ayshih

MLVFS for Windows using PFM now extracts audio as well (DLL download).  Let me know if you encounter any bugs!
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

mk11174

This is pretty cool, can the RAW files somehow be added to work with this. Or is it only possible with MLV?
500D/T1i  550D/T2i  600D/T3i  700D/T5i

mario1000

Quote from: ayshih on September 14, 2014, 06:19:10 AM
MLVFS for Windows using PFM now extracts audio as well (DLL download).  Let me know if you encounter any bugs!

Hi ayshih
thanks a lot for your work but the download link does not work (it says that it found a dead link). Could you please fix this.
Thanks in advance

Edit: download link works!

ayshih

Quote from: mk11174 on September 14, 2014, 06:27:25 AM
This is pretty cool, can the RAW files somehow be added to work with this. Or is it only possible with MLV?
I don't think there's any limitation precluding implementing RAW support, although the lack of metadata is a little annoying.  However, I myself am more interested in making sure we fully support MLV files rather than worrying about the "older" format.  I encourage any interested developers to contribute to the code, of course!

Quote from: mario1000 on September 14, 2014, 07:23:14 AM
thanks a lot for your work but the download link does not work (it says that it found a dead link). Could you please fix this.
Thanks for letting me know!  Looks like Bitbucket got a little confused, so I've re-uploaded it.
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

Frank7D

(using pismo)
Now I have audio (.wav) files also; thanks!
One thing I notice: when I import the (virtual) sequence into After Effects, an .xmp (sidecar) file appears in the virtual folder. I believe these files normally contain the ACR settings used to import the sequence.
However, when I unmount the mlv and then mount it again, the xmp is gone. Maybe this is a good thing, since it implies AFX is not altering the mlv file.
If I want to retain the AFX/ACR import settings more permanently, I can save an xmp manually in the ACR settings folder (or maybe just drag the xmp from the virtual folder into a real folder).

Frank7D

(using pismo)
What controls the naming of the (virtual) DNGs and WAVs?
All my DNG names are of the form ffffffff.DNG
All the WAVs are "_AUDIO.WAV"
This can be confusing when dealing with multiple MLV files.

ayshih

Quote from: Frank7D on September 14, 2014, 06:41:48 PM
However, when I unmount the mlv and then mount it again, the xmp is gone. Maybe this is a good thing, since it implies AFX is not altering the mlv file.
If I want to retain the AFX/ACR import settings more permanently, I can save an xmp manually in the ACR settings folder (or maybe just drag the xmp from the virtual folder into a real folder).
Yup, while the virtual filesystem allows the creation of real files (e.g., XMP sidecars), I haven't yet implemented any preservation of those files after unmounting.  Dragging/copying the XMP files out of the virtual filesystem should work fine.

Quote from: Frank7D on September 14, 2014, 07:03:37 PM
What controls the naming of the (virtual) DNGs and WAVs?
The naming scheme, which is the same as on the FUSE versions, can certainly be changed.  I presume you want the filename of the MLV video prepended to the individual DNG files and WAV file?
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

Danne

Is this xmp creation present on mac as well working with ae or is it a windows thing?