Author Topic: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter  (Read 557610 times)

KurtAugust

  • Freshman
  • **
  • Posts: 73
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #50 on: September 10, 2014, 08:55:35 AM »
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

  • Member
  • ***
  • Posts: 113
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #51 on: September 10, 2014, 10:37:19 AM »
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

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3217
  • 60Da / 1100D / EOSM
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #52 on: September 10, 2014, 12:44:08 PM »
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

  • Member
  • ***
  • Posts: 113
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #53 on: September 10, 2014, 01:20:37 PM »
Thank-you! I'd better learn to compile then… ;)

menoc

  • Senior
  • ****
  • Posts: 272
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #54 on: September 11, 2014, 01:50:09 AM »
Quote
Just 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

  • Developer
  • Hero Member
  • *****
  • Posts: 3217
  • 60Da / 1100D / EOSM
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #55 on: September 11, 2014, 02:16:59 AM »
read this thread starting at reply #18

mg_dev

  • New to the forum
  • *
  • Posts: 1
  • 550D
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #56 on: September 11, 2014, 05:38:44 PM »
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

  • Senior
  • ****
  • Posts: 266
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #57 on: September 13, 2014, 04:19:06 AM »
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:
Code: [Select]
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

  • Senior
  • ****
  • Posts: 454
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #58 on: September 13, 2014, 05:30:55 AM »
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

  • Senior
  • ****
  • Posts: 454
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #59 on: September 13, 2014, 06:54:42 AM »
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

  • Senior
  • ****
  • Posts: 266
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #60 on: September 13, 2014, 07:16:59 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.

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

  • Senior
  • ****
  • Posts: 454
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #61 on: September 13, 2014, 04:03:15 PM »
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

  • Senior
  • ****
  • Posts: 266
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #62 on: September 13, 2014, 04:22:14 PM »
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

  • Developer
  • Hero Member
  • *****
  • Posts: 3217
  • 60Da / 1100D / EOSM
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #63 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 :)

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

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3105
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #64 on: September 13, 2014, 07:08:58 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: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

dmilligan

  • Developer
  • Hero Member
  • *****
  • Posts: 3217
  • 60Da / 1100D / EOSM
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #65 on: September 13, 2014, 11:05:25 PM »
EDIT: okay, I think I've basically got it

What about G/M shift?

g3gg0

  • Developer
  • Hero Member
  • *****
  • Posts: 3105
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #66 on: September 14, 2014, 02:19:02 AM »
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:
Code: [Select]
            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: paypal@g3gg0.de
ONLY donate for things we have done, not for things you expect!

ayshih

  • Senior
  • ****
  • Posts: 266
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #67 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!
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

mk11174

  • Hero Member
  • *****
  • Posts: 809
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #68 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?
500D/T1i  550D/T2i  600D/T3i  700D/T5i

mario1000

  • New to the forum
  • *
  • Posts: 29
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #69 on: September 14, 2014, 07:23:14 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

  • Senior
  • ****
  • Posts: 266
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #70 on: September 14, 2014, 07:41:47 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!

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

  • Senior
  • ****
  • Posts: 454
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #71 on: September 14, 2014, 06:41:48 PM »
(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

  • Senior
  • ****
  • Posts: 454
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #72 on: September 14, 2014, 07:03:37 PM »
(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

  • Senior
  • ****
  • Posts: 266
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #73 on: September 14, 2014, 07:40:00 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.

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

  • Hero Member
  • *****
  • Posts: 4251
Re: MLVFS - a FUSE based, "on the fly" MLV to CDNG converter
« Reply #74 on: September 14, 2014, 07:45:19 PM »
Is this xmp creation present on mac as well working with ae or is it a windows thing?